YAHFA
YAHFA copied to clipboard
被Hook的方法执行多次后会抛出 java.lang.IncompatibleClassChangeError
java.lang.IncompatibleClassChangeError: The method '原始方法的信息' was expected to be of type static but instead was found to be of type virtual (declaration of '这里是hook方法的信息' appears in /storage/emulated/0/demoPlugin-debug.apk) 机型小米6 android8.0 已经加你QQ请通过一下
看了你博客的技术文章,说是通过清除 hotness_count_值来防止,但是实际上好像这个问题依旧存在,直接跑demo在androidO for 循环执行hook 很快就崩溃
试下最新的commit https://github.com/rk700/YAHFA/commit/ce83f47a8f0af54cf51e4858ced4319361dd51ae
通过kAccCompileDontBother
指定方法不编译,arm和aarch64的trampoline代码没有测试
能简单说下这里问题在哪吗,我这边想继续跟进测试 想交流一下我的QQ 211275834
可见相关说明 https://github.com/rk700/YAHFA/wiki/%E6%9B%B4%E6%96%B0%E8%AF%B4%E6%98%8E
小米5(7.0) 小米6(8.0)测试,android 7.0上面 调用30——40次(for循环执行的话定个一万次调用,几千次时候就无法执行了)后就无法调用hook函数了只执行原函数,8.0上稳定可以调用原函数和hook函数
android 6.0 360手机初测,方法findandhook这一步时候崩溃 正在换其它6.0手机跟测
Android 7.0试下把target method的access flag添加kAccNative
// set the target method to native so that Android O wouldn't invoke it with interpreter if(SDKVersion >= ANDROID_N) { int access_flags = read32((char *) targetMethod + OFFSET_access_flags_in_ArtMethod); LOGI("access flags is 0x%x", access_flags); access_flags |= kAccNative; memcpy( (char *) targetMethod + OFFSET_access_flags_in_ArtMethod, &access_flags, 4 ); }
是指的这样吗,把设置kAccNative的范围扩大到Android_N,我这边试了还是一样的问题,还是我理解错了
any updates on this issue ? @yaeio
same issue on xiaomi