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 等笔记
37 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
61 3
react-Native init初始化项目报错”TypeError: cli.init is not a function“
react-Native init初始化项目报错”TypeError: cli.init is not a function“
727 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()”
1224 0
|
人工智能 自然语言处理 前端开发
小程序引入组件库报错VM128:1 Unhandled promise rejection TypeError: WebAssembly.instantiate(): Argument 0 must
小程序引入组件库报错VM128:1 Unhandled promise rejection TypeError: WebAssembly.instantiate(): Argument 0 must
60 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“
288 0
[Vue warn]: Error in mounted hook: “TypeError: handler.call is not a function“
|
iOS开发
Objective-C的hook方案/ Method Swizzling
Method Swizzling是改变一个selector的实际实现的技术。
108 0
|
JavaScript 安全
Frida-syscall-interceptor
Frida-syscall-interceptor
Frida-syscall-interceptor
|
Java Android开发
frida hook Toast
牙叔教程 简单易懂
201 0
|
Kotlin
【错误记录】布局组件加载错误 ( Attempt to invoke virtual method ‘xxx$Callback android.view.Window.getCallback()‘ )
【错误记录】布局组件加载错误 ( Attempt to invoke virtual method ‘xxx$Callback android.view.Window.getCallback()‘ )
315 0