-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nexus5 5.1.1 hook不工作 #26
Comments
5.1失败,6.0正常,可能与调用系统方法代码优化有关:https://github.com/rk700/YAHFA#workaround-for-method-inlining 具体需要检查应用调用Log.e处的机器指令 |
直接使用的findAndBackupAndHook ------------华为P9 7.0 ,不改代码也可以成功 |
提供下6.0的完整日志 |
01-01 20:06:56.658 200 789 D audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2 |
贴一下使用的代码,是在Button的onClick触发的,不知有没有什么影响
|
经测试,插件版的5.0,6.0,7.0都没问题, 内部直接findAndBackupAndHook,只有7.0可以,不是hook时机问题,同MainApp处hook也不行, 不知内部直接findAndBackupAndHook和插件版有什么不同,ArtMethod不一样?? |
从反馈来看,如果hook代码与目标处于不同classloader,可以正常hook;如果处于同一个classloader则会发生问题。 |
通过测试发现 |
debug模式下dex2oat编译时不会做代码优化,所以方法调用还是按照ArtMethod->entrypoint的方式;release模式下会优化代码,某些方法调用会直接跳转到已知的entrypoint https://github.com/rk700/YAHFA#workaround-for-method-inlining |
通过测试发现 你这个结论是在什么安卓版本得出的?5.0-5.1是不适用的,5.x没有判断debug,内联条件分Quick和Optimizing |
暂时解决了所有版本内联问题,只是牺牲性能太大 |
@zhuotong 不知道你咋解决的, 对于内联的方法, 对应ArtMethod的entrypoint并不会被调用, 实际上其它字段也没用到, 所以目前还没有兼顾性能的方案 |
用 #29 统一跟踪DexClassLoader的问题 |
日志全部打印了,但是hook不成功。
只hook了Log.e,同样的代码6.0 OK。
我把plugin和mainapp放一块了,没有用classloader,直接使用的findAndBackupAndHook。
The text was updated successfully, but these errors were encountered: