frida icon indicating copy to clipboard operation
frida copied to clipboard

Android 12 Java.choose problem

Open JonyFish opened this issue 2 years ago • 6 comments

js code: setImmediate(function() { console.log("[] Starting script"); Java.perform(function () { Java.choose("com.mycompany.myapp.MainActivity", { "onMatch":function(instance){ console.log("[] Instance found"); }, "onComplete":function() { console.log("[*] Finished heap search") } }); }); }); result: [on_message] message: {'type': 'error', 'description': 'TypeError: not a function', 'stack': 'TypeError: not a function\n at _chooseObjectsArtModern (frida/node_modules/frida-java-bridge/lib/class-factory.js:286)\n at (frida/node_modules/frida-java-bridge/lib/class-factory.js:245)\n at pt (frida/node_modules/frida-java-bridge/lib/android.js:552)', 'fileName': 'frida/node_modules/frida-java-bridge/lib/class-factory.js', 'lineNumber': 286, 'columnNumber': 1} data: None

JonyFish avatar Apr 05 '22 16:04 JonyFish

I had the same problem

androiddevelop avatar May 02 '22 09:05 androiddevelop

+1

qingpengchen2011 avatar May 07 '22 23:05 qingpengchen2011

+1

tinker-li avatar May 14 '22 10:05 tinker-li

Implemented in the Android 12 branch (still in progress), if anyone's interested in testing it.

oleavr avatar May 19 '22 20:05 oleavr

+1, but my problem is in android 7。。。。

yjshi2015 avatar Jun 11 '22 11:06 yjshi2015

is there any update? i'm using android 12 simulator. meet the error here: {'type': 'error', 'description': "TypeError: cannot read property 'value' of undefined", 'stack': "TypeError: cannot read property 'value' of undefined\n at onMatch (/script1.js:23)\n at _chooseObjectsJvm (frida/node_modules/frida-java-bridge/lib/class-factory.js:269)\n at choose (frida/node_modules/frida-java-bridge/lib/class-factory.js:247)\n at choose (frida/node_modules/frida-java-bridge/index.js:264)\n at <anonymous> (/script1.js:30)\n at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:12)\n at perform (frida/node_modules/frida-java-bridge/index.js:205)\n at <eval> (/script1.js:31)", 'fileName': '/script1.js', 'lineNumber': 23, 'columnNumber': 1}

script here `Java.perform(function() { var context = Java.use('android.app.ActivityThread').currentApplication().getApplicationContext(); console.log("testeste") context.openFileOutput.implementation = function(a, b) { console.log("Hello world"); this.openFileOutput(a, b); }

})`

creathy123 avatar Sep 20 '22 04:09 creathy123

+1, but my problem is in android 7。。。。

android 7 +1

wordhui avatar Oct 25 '22 13:10 wordhui