feat: catching the single hooker exceptions

This commit is contained in:
2023-10-16 16:01:35 +08:00
parent 9a152a436d
commit 69419f9f2e

View File

@@ -23,6 +23,7 @@ package com.highcapable.yukihookapi.hook.entity
import com.highcapable.yukihookapi.YukiHookAPI import com.highcapable.yukihookapi.YukiHookAPI
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
import com.highcapable.yukihookapi.hook.log.YLog
import com.highcapable.yukihookapi.hook.param.PackageParam import com.highcapable.yukihookapi.hook.param.PackageParam
/** /**
@@ -44,7 +45,7 @@ abstract class YukiBaseHooker : PackageParam() {
*/ */
internal fun assignInstance(packageParam: PackageParam) { internal fun assignInstance(packageParam: PackageParam) {
assign(packageParam.wrapper) assign(packageParam.wrapper)
onHook() runCatching { onHook() }.onFailure { YLog.innerE("An exception occurred in $this", it) }
} }
/** 子类 Hook 开始 */ /** 子类 Hook 开始 */