From 46cdc126bd9434f964aa7bc6b4d3f2467291e54a Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Mon, 2 Dec 2024 17:11:28 +0100 Subject: [PATCH] Keep libart.so cache after HookBridge The previous commit 5da38f60a2ebfff7c0909f64a2c553d0752721eb is not complete since `GetArt(true)` will destroy the static SandHook::ElfImg object. Since in the previous two commits we have postponed the initialization of LSPlant, we can now keep the symbol cache of `libart` for the InitArtHooker call in method `OnNativeForkSystemServerPost`. Symbol cache works because we are using local static object in the function `GetArt`, whose life-cycle is not constraint by the function block. --- magisk-loader/src/main/jni/src/service.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/magisk-loader/src/main/jni/src/service.cpp b/magisk-loader/src/main/jni/src/service.cpp index 8307de1162f..e7b7e3f110f 100644 --- a/magisk-loader/src/main/jni/src/service.cpp +++ b/magisk-loader/src/main/jni/src/service.cpp @@ -248,7 +248,6 @@ namespace lspd { auto &binder = lspd::GetLibBinder(false); IPCThreadState::Init(binder.get()); lspd::GetLibBinder(true); - lspd::GetArt(true); LOGD("Done InitService"); }