diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiHookBridge.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiHookBridge.kt index 3d901c76..c5894c50 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiHookBridge.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/YukiHookBridge.kt @@ -35,6 +35,7 @@ import com.highcapable.yukihookapi.annotation.YukiGenerateApi import com.highcapable.yukihookapi.hook.factory.classOf import com.highcapable.yukihookapi.hook.factory.field import com.highcapable.yukihookapi.hook.factory.hasClass +import com.highcapable.yukihookapi.hook.log.yLoggerE import com.highcapable.yukihookapi.hook.param.PackageParam import com.highcapable.yukihookapi.hook.param.type.HookEntryType import com.highcapable.yukihookapi.hook.param.wrapper.PackageParamWrapper @@ -263,11 +264,13 @@ object YukiHookBridge { else null else -> null }?.also { - if (it.isCorrectProcess) YukiHookAPI.onXposedLoaded(it) - 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 + runCatching { + if (it.isCorrectProcess) YukiHookAPI.onXposedLoaded(it) + 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) } } } } \ No newline at end of file diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/factory/YukiBridgeFactory.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/factory/YukiBridgeFactory.kt index 22534dd0..061fd3f8 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/factory/YukiBridgeFactory.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/bridge/factory/YukiBridgeFactory.kt @@ -91,7 +91,7 @@ internal object YukiHookHelper { else -> error("Unexpected BaseFinder result interface type") } hookMember(member, callback) - }.onFailure { yLoggerE(msg = "Hooking Process exception occurred", e = it) }.getOrNull() ?: Pair(null, false) + }.onFailure { yLoggerE(msg = "An exception occurred when hooking internal function", e = it) }.getOrNull() ?: Pair(null, false) /** * Hook [Member]