TypeError: не может записать свойство 'реализация' ошибки undefined` в frida - PullRequest
0 голосов
/ 29 января 2020

Я пытаюсь внедрить приведенный ниже скрипт, используя 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 inject. js ow asp .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();
        }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...