Skip to content

Commit

Permalink
fixes #616 #634 #626
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed May 25, 2019
1 parent 0fee90a commit f8c5d7a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions VirtualApp/lib/src/main/jni/Foundation/VMPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ bool (*orig_ProcessProfilingInfo)(void*, void*);
bool compileNothing(void* thiz, void* thread, void* method, bool osr) { return false; }
bool (*orig_CompileNothing)(void* thiz, void* thread, void* method, bool osr);

void (*org_notifyJitActivity)(void *);
void notifyNothing(void *thiz) {
return;
}

void disableJit(int apiLevel) {
#ifdef __arm__
void *libart = fake_dlopen("/system/lib/libart.so", RTLD_NOW);
Expand All @@ -466,6 +471,12 @@ void disableJit(int apiLevel) {
if (compileMethod) {
MSHookFunction(compileMethod, (void*) compileNothing, (void**) &orig_CompileNothing);
}

void *notifyJitActivity = fake_dlsym(libart, "_ZN3art12ProfileSaver17NotifyJitActivityEv");
if (notifyJitActivity) {
MSHookFunction(notifyJitActivity, (void *) notifyNothing,
(void **) &org_notifyJitActivity);
}
}
#endif
}
Expand Down

0 comments on commit f8c5d7a

Please sign in to comment.