frida-java-bridge 7.0.5 → 7.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/android.js +13 -12
- package/package.json +1 -1
package/lib/android.js
CHANGED
|
@@ -967,14 +967,14 @@ export function getArtClassSpec (vm) {
|
|
|
967
967
|
const fInfo = {
|
|
968
968
|
artArrayLengthSize: 4,
|
|
969
969
|
artArrayEntrySize: fieldSpec.size,
|
|
970
|
-
// java/
|
|
971
|
-
artArrayMax:
|
|
970
|
+
// java/io/File has 15 fields on Android 16.
|
|
971
|
+
artArrayMax: 25
|
|
972
972
|
};
|
|
973
973
|
|
|
974
974
|
const mInfo = {
|
|
975
975
|
artArrayLengthSize: pointerSize,
|
|
976
976
|
artArrayEntrySize: methodSpec.size,
|
|
977
|
-
// java/
|
|
977
|
+
// java/io/File has 63 methods on Android 16.
|
|
978
978
|
artArrayMax: 100
|
|
979
979
|
};
|
|
980
980
|
|
|
@@ -985,7 +985,7 @@ export function getArtClassSpec (vm) {
|
|
|
985
985
|
}
|
|
986
986
|
|
|
987
987
|
const length = (lengthSize === 4) ? header.readU32() : header.readU64().valueOf();
|
|
988
|
-
if (length
|
|
988
|
+
if (length <= 0) {
|
|
989
989
|
return null;
|
|
990
990
|
}
|
|
991
991
|
|
|
@@ -1002,7 +1002,8 @@ export function getArtClassSpec (vm) {
|
|
|
1002
1002
|
return false;
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
|
-
|
|
1005
|
+
const artArrayEnd = Math.min(artArray.length, info.artArrayMax);
|
|
1006
|
+
for (let i = 0; i !== artArrayEnd; i++) {
|
|
1006
1007
|
const fieldPtr = artArray.data.add(i * info.artArrayEntrySize);
|
|
1007
1008
|
if (fieldPtr.equals(needle)) {
|
|
1008
1009
|
return true;
|
|
@@ -1014,7 +1015,7 @@ export function getArtClassSpec (vm) {
|
|
|
1014
1015
|
return false;
|
|
1015
1016
|
};
|
|
1016
1017
|
|
|
1017
|
-
const clazz = env.findClass('java/
|
|
1018
|
+
const clazz = env.findClass('java/io/File');
|
|
1018
1019
|
const clazzRef = env.newGlobalRef(clazz);
|
|
1019
1020
|
|
|
1020
1021
|
try {
|
|
@@ -1023,8 +1024,8 @@ export function getArtClassSpec (vm) {
|
|
|
1023
1024
|
object = getApi()['art::JavaVMExt::DecodeGlobal'](vm, thread, clazzRef);
|
|
1024
1025
|
});
|
|
1025
1026
|
|
|
1026
|
-
const fieldInstance = env.getFieldId(clazzRef, '
|
|
1027
|
-
const fieldStatic = env.getStaticFieldId(clazzRef, '
|
|
1027
|
+
const fieldInstance = env.getFieldId(clazzRef, 'path', 'Ljava/lang/String;');
|
|
1028
|
+
const fieldStatic = env.getStaticFieldId(clazzRef, 'separatorChar', 'C');
|
|
1028
1029
|
|
|
1029
1030
|
let offsetStatic = -1;
|
|
1030
1031
|
let offsetInstance = -1;
|
|
@@ -1037,20 +1038,20 @@ export function getArtClassSpec (vm) {
|
|
|
1037
1038
|
}
|
|
1038
1039
|
}
|
|
1039
1040
|
if (offsetInstance === -1 || offsetStatic === -1) {
|
|
1040
|
-
throw new Error('Unable to find fields in java/
|
|
1041
|
+
throw new Error('Unable to find fields in java/io/File; please file a bug');
|
|
1041
1042
|
}
|
|
1042
1043
|
const sfieldOffset = (offsetInstance !== offsetStatic) ? offsetStatic : 0;
|
|
1043
1044
|
const ifieldOffset = offsetInstance;
|
|
1044
1045
|
|
|
1045
1046
|
let offsetMethods = -1;
|
|
1046
|
-
const methodInstance = env.getMethodId(clazzRef, '
|
|
1047
|
+
const methodInstance = env.getMethodId(clazzRef, 'length', '()J');
|
|
1047
1048
|
for (let offset = 0; offset !== MAX_OFFSET; offset += 4) {
|
|
1048
1049
|
if (offsetMethods === -1 && hasEntry(object, offset, methodInstance, mInfo)) {
|
|
1049
1050
|
offsetMethods = offset;
|
|
1050
1051
|
}
|
|
1051
1052
|
}
|
|
1052
1053
|
if (offsetMethods === -1) {
|
|
1053
|
-
throw new Error('Unable to find methods in java/
|
|
1054
|
+
throw new Error('Unable to find methods in java/io/File; please file a bug');
|
|
1054
1055
|
}
|
|
1055
1056
|
|
|
1056
1057
|
let offsetCopiedMethods = -1;
|
|
@@ -1063,7 +1064,7 @@ export function getArtClassSpec (vm) {
|
|
|
1063
1064
|
}
|
|
1064
1065
|
}
|
|
1065
1066
|
if (offsetCopiedMethods === -1) {
|
|
1066
|
-
throw new Error('Unable to find copied methods in java/
|
|
1067
|
+
throw new Error('Unable to find copied methods in java/io/File; please file a bug');
|
|
1067
1068
|
}
|
|
1068
1069
|
|
|
1069
1070
|
spec = {
|