Commit 70a3a01a authored by swift_gan's avatar swift_gan Committed by swift_gan

update demo & doc

parent bd46d435
...@@ -157,6 +157,8 @@ XposedHelpers.findAndHookMethod(Activity.class, "onResume", new XC_MethodHook() ...@@ -157,6 +157,8 @@ XposedHelpers.findAndHookMethod(Activity.class, "onResume", new XC_MethodHook()
# Notice # Notice
## Call Origin
!!!!!!!! !!!!!!!!
when OS >= 8.0 when OS >= 8.0
...@@ -165,6 +167,14 @@ you must call backup method in hook method, if you want call it in other method, ...@@ -165,6 +167,14 @@ you must call backup method in hook method, if you want call it in other method,
because when ART trigger JIT from profiling, JIT will invoke -> ResolveCompilingMethodsClass -> ClassLinker::ResolveMethod -> CheckIncompatibleClassChange -> ThrowIncompatibleClassChangeError finally!!! because when ART trigger JIT from profiling, JIT will invoke -> ResolveCompilingMethodsClass -> ClassLinker::ResolveMethod -> CheckIncompatibleClassChange -> ThrowIncompatibleClassChangeError finally!!!
## Inline
we can do nothing to prevent some methods been inlined before app start, but we can try to disable VM Jit Inline after launch.
if you will hook some method that could be inlined, please call SandHook.disableVMInline()(OS >= 7.0) in Application.OnCreate()
# References # References
......
...@@ -23,6 +23,8 @@ public class MyApp extends Application { ...@@ -23,6 +23,8 @@ public class MyApp extends Application {
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
SandHook.disableVMInline();
try { try {
SandHook.addHookClass(JniHooker.class, SandHook.addHookClass(JniHooker.class,
CtrHook.class, CtrHook.class,
......
...@@ -77,16 +77,6 @@ extern "C" { ...@@ -77,16 +77,6 @@ extern "C" {
//try disable inline ! //try disable inline !
globalJitCompileHandlerAddr = reinterpret_cast<art::jit::JitCompiler **>(fake_dlsym(handle, "_ZN3art3jit3Jit20jit_compiler_handle_E")); globalJitCompileHandlerAddr = reinterpret_cast<art::jit::JitCompiler **>(fake_dlsym(handle, "_ZN3art3jit3Jit20jit_compiler_handle_E"));
// art::jit::JitCompiler* jitCompileHandlerGlobal = *reinterpret_cast<art::jit::JitCompiler**>(jitCompileHandlerGlobalAddr);
// art::jit::JitCompiler* jitCompileHandlerTemp = static_cast<art::jit::JitCompiler *>(jitCompilerHandle);
// if (jitCompileHandlerGlobal == nullptr) {
// return;
// }
// art::CompilerOptions* options = jitCompileHandlerGlobal->compilerOptions.get();
// Size inlineUnit = options->inline_max_code_units_;
// options->inline_max_code_units_ = 0;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment