diff --git a/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM.java b/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM.java index 4fd9b3b95..dec880ae7 100644 --- a/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM.java +++ b/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM.java @@ -1401,7 +1401,7 @@ public long handle(Emulator emulator) { log.debug("GetObjectField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1425,7 +1425,7 @@ public long handle(Emulator emulator) { log.debug("GetBooleanField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1470,7 +1470,7 @@ public long handle(Emulator emulator) { log.debug("GetIntField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1494,7 +1494,7 @@ public long handle(Emulator emulator) { log.debug("GetLongField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1519,7 +1519,7 @@ public long handle(Emulator emulator) { log.debug("GetFloatField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1555,7 +1555,7 @@ public long handle(Emulator emulator) { log.debug("SetObjectField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1581,7 +1581,7 @@ public long handle(Emulator emulator) { log.debug("SetBooleanField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1628,7 +1628,7 @@ public long handle(Emulator emulator) { log.debug("SetIntField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1654,7 +1654,7 @@ public long handle(Emulator emulator) { log.debug("SetLongField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1683,7 +1683,7 @@ public long handle(Emulator emulator) { log.debug("SetFloatField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1709,7 +1709,7 @@ public long handle(Emulator emulator) { log.debug("SetDoubleField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); diff --git a/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM64.java b/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM64.java index 46f13acd4..e5804f3e9 100644 --- a/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM64.java +++ b/unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM64.java @@ -1428,7 +1428,7 @@ public long handle(Emulator emulator) { log.debug("GetObjectField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1452,7 +1452,7 @@ public long handle(Emulator emulator) { log.debug("GetBooleanField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1476,7 +1476,7 @@ public long handle(Emulator emulator) { log.debug("GetByteField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1514,7 +1514,7 @@ public long handle(Emulator emulator) { log.debug("GetIntField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1538,7 +1538,7 @@ public long handle(Emulator emulator) { log.debug("GetLongField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1562,7 +1562,7 @@ public long handle(Emulator emulator) { log.debug("GetFloatField object=" + object + ", jfieldID=" + jfieldID); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1598,7 +1598,7 @@ public long handle(Emulator emulator) { log.debug("SetObjectField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1624,7 +1624,7 @@ public long handle(Emulator emulator) { log.debug("SetBooleanField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1671,7 +1671,7 @@ public long handle(Emulator emulator) { log.debug("SetIntField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1696,7 +1696,7 @@ public long handle(Emulator emulator) { log.debug("SetLongField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1725,7 +1725,7 @@ public long handle(Emulator emulator) { log.debug("SetFloatField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException(); @@ -1754,7 +1754,7 @@ public long handle(Emulator emulator) { log.debug("SetDoubleField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value); } DvmObject dvmObject = getObject(object.toIntPeer()); - DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType(); + DvmClass dvmClass = dvmObject == null ? null : dvmObject instanceof DvmClass ? (DvmClass) dvmObject : dvmObject.getObjectType(); DvmField dvmField = dvmClass == null ? null : dvmClass.getField(jfieldID.toIntPeer()); if (dvmField == null) { throw new BackendException();