Avoid parsing libart for multiple times
Use GetArt instead of parsing the lib anew.
This commit is contained in:
parent
403b5fa516
commit
5da38f60a2
|
|
@ -218,10 +218,11 @@ namespace lspd {
|
|||
return;
|
||||
}
|
||||
|
||||
auto &art = lspd::GetArt();
|
||||
auto binder_class = JNI_FindClass(env, "android/os/Binder");
|
||||
exec_transact_backup_methodID_ = JNI_GetMethodID(env, binder_class, "execTransact",
|
||||
"(IJJI)Z");
|
||||
auto *setTableOverride = SandHook::ElfImg("/libart.so").getSymbAddress<void (*)(JNINativeInterface *)>(
|
||||
auto *setTableOverride = art->getSymbAddress<void (*)(JNINativeInterface *)>(
|
||||
"_ZN3art9JNIEnvExt16SetTableOverrideEPK18JNINativeInterface");
|
||||
if (!setTableOverride) {
|
||||
LOGE("set table override not found");
|
||||
|
|
@ -247,6 +248,7 @@ namespace lspd {
|
|||
auto &binder = lspd::GetLibBinder(false);
|
||||
IPCThreadState::Init(binder.get());
|
||||
lspd::GetLibBinder(true);
|
||||
lspd::GetArt(true);
|
||||
|
||||
LOGD("Done InitService");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue