关闭Frida优化
frida hook时会主动进行一些优化,以提升性能,但是某些时候会导致实际被调用了的方法无法被hook到。
这个时候可以调用Java.deoptimizeEverything();取消优化,再进行hook。
Java.deoptimizeEverything(): forces the VM to execute everything with its interpreter. Necessary to prevent optimizations from bypassing method hooks in some cases, and allows ART’s Instrumentation APIs to be used for tracing the runtime.
参考:https://frida.re/docs/javascript-api/