Fix module not loading on first run
This commit is contained in:
parent
4e41e141dd
commit
641ed369fa
2
core
2
core
|
|
@ -1 +1 @@
|
||||||
Subproject commit dd8dcfbab1d8aa8a408ab57cb5e934684679533d
|
Subproject commit d36d284f3908e7f5eb8bcb873e637cac2db27b01
|
||||||
|
|
@ -93,10 +93,11 @@ public class LSPApplication {
|
||||||
try {
|
try {
|
||||||
disableProfile(context);
|
disableProfile(context);
|
||||||
Startup.initXposed(false, ActivityThread.currentProcessName(), service);
|
Startup.initXposed(false, ActivityThread.currentProcessName(), service);
|
||||||
Log.i(TAG, "Start loading modules");
|
Log.i(TAG, "Bootstrap Xposed");
|
||||||
Startup.bootstrapXposed();
|
Startup.bootstrapXposed();
|
||||||
// WARN: Since it uses `XResource`, the following class should not be initialized
|
// WARN: Since it uses `XResource`, the following class should not be initialized
|
||||||
// before forkPostCommon is invoke. Otherwise, you will get failure of XResources
|
// before forkPostCommon is invoke. Otherwise, you will get failure of XResources
|
||||||
|
Log.i(TAG, "Load modules");
|
||||||
LSPLoader.initModules(appLoadedApk);
|
LSPLoader.initModules(appLoadedApk);
|
||||||
Log.i(TAG, "Modules initialized");
|
Log.i(TAG, "Modules initialized");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,15 @@ namespace lspd {
|
||||||
env->DeleteLocalRef(dex_buffer);
|
env->DeleteLocalRef(dex_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PatchLoader::InitHooks(JNIEnv* env, const lsplant::InitInfo& initInfo) {
|
void PatchLoader::InitArtHooker(JNIEnv* env, const InitInfo& initInfo) {
|
||||||
|
Context::InitArtHooker(env, initInfo);
|
||||||
handler = initInfo;
|
handler = initInfo;
|
||||||
Context::InitHooks(env, handler);
|
art::DisableInline(initInfo);
|
||||||
art::DisableInline(handler);
|
art::DisableBackgroundVerification(initInfo);
|
||||||
art::DisableBackgroundVerification(handler);
|
}
|
||||||
|
|
||||||
|
void PatchLoader::InitHooks(JNIEnv* env) {
|
||||||
|
Context::InitHooks(env);
|
||||||
RegisterBypass(env);
|
RegisterBypass(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,8 +114,9 @@ namespace lspd {
|
||||||
auto array = (jbyteArray) env->GetStaticObjectField(stub, dex_field);
|
auto array = (jbyteArray) env->GetStaticObjectField(stub, dex_field);
|
||||||
auto dex = PreloadedDex {env->GetByteArrayElements(array, nullptr), static_cast<size_t>(JNI_GetArrayLength(env, array))};
|
auto dex = PreloadedDex {env->GetByteArrayElements(array, nullptr), static_cast<size_t>(JNI_GetArrayLength(env, array))};
|
||||||
|
|
||||||
|
InitArtHooker(env, initInfo);
|
||||||
LoadDex(env, std::move(dex));
|
LoadDex(env, std::move(dex));
|
||||||
InitHooks(env, initInfo);
|
InitHooks(env);
|
||||||
|
|
||||||
GetArt(true);
|
GetArt(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@ namespace lspd {
|
||||||
void Load(JNIEnv* env);
|
void Load(JNIEnv* env);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitHooks(JNIEnv* env, const lsplant::InitInfo& initInfo) override;
|
void InitArtHooker(JNIEnv* env, const lsplant::InitInfo& initInfo) override;
|
||||||
|
|
||||||
|
void InitHooks(JNIEnv* env) override;
|
||||||
|
|
||||||
void LoadDex(JNIEnv* env, PreloadedDex&& dex) override;
|
void LoadDex(JNIEnv* env, PreloadedDex&& dex) override;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue