From 2999d1965b78989dc582be79af064ff9703a6262 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Wed, 1 Feb 2023 03:56:42 +0800 Subject: [PATCH] Revert "Fix some hooking process not always in the correct process problem in YukiXposedModule" --- .../hook/xposed/bridge/YukiXposedModule.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiXposedModule.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiXposedModule.kt index df6e9b7f..aa813e0f 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiXposedModule.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiXposedModule.kt @@ -212,13 +212,13 @@ internal object YukiXposedModule : IYukiXposedModuleLifecycle { if (isPackageLoaded(packageName, HookEntryType.RESOURCES).not() && packageName == AppParasitics.currentPackageName) assignWrapper(HookEntryType.RESOURCES, packageName, appResources = appResources) else null - }?.also { wrapper -> - if (wrapper.isCorrectProcess) runCatching { - if (wrapper.type != HookEntryType.ZYGOTE && wrapper.packageName == modulePackageName) - AppParasitics.hookModuleAppRelated(wrapper.appClassLoader, wrapper.type) - if (wrapper.type == HookEntryType.PACKAGE) AppParasitics.registerToAppLifecycle(wrapper.packageName) - if (wrapper.type == HookEntryType.RESOURCES) isSupportResourcesHook = true - packageParamCallback?.invoke(wrapper.instantiate().assign(wrapper).apply { YukiHookAPI.printSplashInfo() }) + }?.also { + runCatching { + if (it.isCorrectProcess) packageParamCallback?.invoke(it.instantiate().assign(it).apply { YukiHookAPI.printSplashInfo() }) + if (it.type != HookEntryType.ZYGOTE && it.packageName == modulePackageName) + AppParasitics.hookModuleAppRelated(it.appClassLoader, it.type) + if (it.type == HookEntryType.PACKAGE) AppParasitics.registerToAppLifecycle(it.packageName) + if (it.type == HookEntryType.RESOURCES) isSupportResourcesHook = true }.onFailure { yLoggerE(msg = "An exception occurred in the Hooking Process of YukiHookAPI", e = it) } } }