Frida hook带handler的method

简介: 有些Class里面有Handler对象,就必须在 主线程里执行,否则报错E/AndroidRuntime( 2434): java.lang.ExceptionInInitializerErrorE/AndroidRuntime( 2434): at dalvik.

有些Class里面有Handler对象,就必须在 主线程里执行,否则报错

E/AndroidRuntime( 2434): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 2434): at dalvik.system.NativeStart.run(Native Method)
E/AndroidRuntime( 2434): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
E/AndroidRuntime( 2434): at android.os.Handler.(Handler.java:200)

Frida提供了这样的设施, 那就是 scheduleOnMainThread

send(Java.available); 

Java.perform(function () { 
    send(Java.androidVersion); 
    send(Java.isMainThread());

    Java.scheduleOnMainThread(function () { 
        send(Java.isMainThread());
        
        var Mgr = Java.use("me.app.im.Mgr");
        var MgrInstance = Mgr.a();
        var Region = MgrInstance.v();
        send(Region);       
    });
});
相关文章
new bind apply call instanceof 等笔记
new bind apply call instanceof 等笔记
34 0
|
3月前
|
缓存 Dart 开发工具
解决Flutter报错The method ‘File.create‘ has fewer named arguments than those of overridden method
解决Flutter报错The method ‘File.create‘ has fewer named arguments than those of overridden method
60 3
react-Native init初始化项目报错”TypeError: cli.init is not a function“
react-Native init初始化项目报错”TypeError: cli.init is not a function“
710 1
|
开发工具 Android开发
解决bug:运行项目时报异常 “Can't create handler inside thread that has not called Looper.prepare()”
解决bug:运行项目时报异常 “Can't create handler inside thread that has not called Looper.prepare()”
1201 0
|
6月前
|
资源调度 前端开发
npm/yarn link 测试包时报错 Warning: Invalid hook call. Hooks can only be called ...
npm/yarn link 测试包时报错 Warning: Invalid hook call. Hooks can only be called ...
80 0
|
JavaScript
[Vue warn]: Error in mounted hook: “TypeError: handler.call is not a function“
[Vue warn]: Error in mounted hook: “TypeError: handler.call is not a function“
283 0
[Vue warn]: Error in mounted hook: “TypeError: handler.call is not a function“
|
PHP Docker 容器
ThinkPHP5 运行Workerman报错:Fatal error: Call to undefined function pcntl_signal()
ThinkPHP5 运行Workerman报错:Fatal error: Call to undefined function pcntl_signal()
343 0
ThinkPHP5 运行Workerman报错:Fatal error: Call to undefined function pcntl_signal()
|
iOS开发
Objective-C的hook方案/ Method Swizzling
Method Swizzling是改变一个selector的实际实现的技术。
108 0
|
Java Android开发
frida hook Toast
牙叔教程 简单易懂
200 0
|
Ubuntu Java Android开发
Android插件化开发之Hook StartActivity方法(2)
Android插件化开发之Hook StartActivity方法(2)
223 0
Android插件化开发之Hook StartActivity方法(2)