我正在尝试使用 frida 注入以下脚本
setImmediate(function() { //prevent timeout
console.log("[*] Starting script");
Java.perform(function() {
var bClass = Java.use("sg.vantagepoint.uncrackable1.a");
bClass.onClick.implementation = function(v) {
console.log("[*] onClick called");
// do nothing
}
console.log("[*] onClick handler modified")
})
})
抛出以下错误
Attaching...
[*] Starting script
TypeError: cannot write property 'implementation' of undefined
at [anon] (../../../frida-gum/bindings/gumjs/duktape.c:57636)
at /inject.js:10
at frida/node_modules/frida-java-bridge/lib/vm.js:11
at E (frida/node_modules/frida-java-bridge/index.js:346)
at frida/node_modules/frida-java-bridge/index.js:298
at frida/node_modules/frida-java-bridge/lib/vm.js:11
at frida/node_modules/frida-java-bridge/index.js:278
at /inject.js:13
at frida/runtime/core.js:55
命令我正在使用frida -U -l injection.js owasp.mstg.uncrackable1
下面一张是apk文件的反编译代码。
package sg.vantagepoint.uncrackable1;
public class MainActivity extends Activity {
private void a(String str) {
AlertDialog create = new AlertDialog.Builder(this).create();
create.setTitle(str);
create.setMessage("This is unacceptable. The app is now going to exit.");
create.setButton(-3, "OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int i) {
System.exit(0);
}
});
create.setCancelable(false);
create.show();
}