frida-js调试记录:
1、指针丢失
Error: expected a pointer
将参数对象新建一个对象,再使用新建的对象:
Java.use("java.lang.String").$new(mAppKey)
2、深拷贝问题
frida.core.RPCException: Error: Current thread is not attached to the Java VM; please move this code inside a Java.perform() callback
引用传递,在使用frida时,无法读取,例如返回值是Object[], java.util.Map, 使用toString()等方法进行深拷贝传值;
result = java_map.toString();
3、hook的方法为成员方法
Error: c: cannot call instance method without an instance
当被hook的方法没有加static等类修饰符时,即为成员方法,需要对use的类实例化;
var instance = Java.use('com.vimin.hookClass').$new();