frida-java-bridge 6.2.1 → 6.2.2

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.
Files changed (2) hide show
  1. package/lib/android.js +14 -3
  2. package/package.json +1 -1
package/lib/android.js CHANGED
@@ -30,7 +30,6 @@ const kAccSkipAccessChecks = 0x00080000;
30
30
  const kAccSingleImplementation = 0x08000000;
31
31
  const kAccNterpEntryPointFastPathFlag = 0x00100000;
32
32
  const kAccNterpInvokeFastPathFlag = 0x00200000;
33
- const kAccCompileDontBother = 0x02000000;
34
33
  const kAccPublicApi = 0x10000000;
35
34
  const kAccXposedHookedMethod = 0x10000000;
36
35
 
@@ -435,6 +434,18 @@ function _getApi () {
435
434
  temporaryApi.vm = vms.readPointer();
436
435
 
437
436
  if (isArt) {
437
+ const apiLevel = getAndroidApiLevel();
438
+
439
+ let kAccCompileDontBother;
440
+ if (apiLevel >= 27) {
441
+ kAccCompileDontBother = 0x02000000;
442
+ } else if (apiLevel >= 24) {
443
+ kAccCompileDontBother = 0x01000000;
444
+ } else {
445
+ kAccCompileDontBother = 0;
446
+ }
447
+ temporaryApi.kAccCompileDontBother = kAccCompileDontBother;
448
+
438
449
  const artRuntime = temporaryApi.vm.add(pointerSize).readPointer();
439
450
  temporaryApi.artRuntime = artRuntime;
440
451
  const runtimeOffset = getArtRuntimeSpec(temporaryApi).offset;
@@ -3314,6 +3325,8 @@ class ArtMethodMangler {
3314
3325
  }
3315
3326
 
3316
3327
  replace (impl, isInstanceMethod, argTypes, vm, api) {
3328
+ const { kAccCompileDontBother, artNterpEntryPoint } = api;
3329
+
3317
3330
  this.originalMethod = fetchArtMethod(this.methodId, vm);
3318
3331
 
3319
3332
  const originalFlags = this.originalMethod.accessFlags;
@@ -3351,8 +3364,6 @@ class ArtMethodMangler {
3351
3364
 
3352
3365
  // Replace Nterp quick entrypoints with art_quick_to_interpreter_bridge to force stepping out
3353
3366
  // of ART's next-generation interpreter and use the quick stub instead.
3354
- const { artNterpEntryPoint } = api;
3355
-
3356
3367
  if (artNterpEntryPoint !== undefined && quickCode.equals(artNterpEntryPoint)) {
3357
3368
  patchArtMethod(hookedMethodId, {
3358
3369
  quickCode: api.artQuickToInterpreterBridge
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida-java-bridge",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "Java runtime interop from Frida",
5
5
  "main": "index.js",
6
6
  "files": [