From db1c4f34dfa8295bbc097fbe78a63bc80d1adfbf Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Sun, 10 Apr 2022 00:55:36 +0800 Subject: [PATCH] Fix a possible bug --- .../api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt index 7cc7f2aa..67ed76e5 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt @@ -168,7 +168,7 @@ object YukiHookAPI { * @param wrapper 代理包装 [PackageParamWrapper] */ internal fun onXposedLoaded(wrapper: PackageParamWrapper) = - YukiHookXposedBridge.packageParamCallback?.invoke(PackageParam(wrapper)).apply { printSplashLog() } + YukiHookXposedBridge.packageParamCallback?.invoke(PackageParam(wrapper).apply { printSplashLog() }) /** * 配置 [YukiHookAPI] 相关参数 @@ -229,7 +229,7 @@ object YukiHookAPI { fun encase(baseContext: Context?, initiate: PackageParam.() -> Unit) { isLoadedFromBaseContext = true when { - hasXposedBridge && baseContext != null -> initiate.invoke(baseContext.packagePararm.apply { printSplashLog() }) + hasXposedBridge && baseContext != null -> initiate.invoke(baseContext.packageParam.apply { printSplashLog() }) else -> printNoXposedEnvLog() } } @@ -254,7 +254,7 @@ object YukiHookAPI { (if (baseContext != null) if (hooker.isNotEmpty()) { printSplashLog() - hooker.forEach { it.assignInstance(packageParam = baseContext.packagePararm) } + hooker.forEach { it.assignInstance(packageParam = baseContext.packageParam) } } else yLoggerE(msg = "Failed to passing \"encase\" method because your hooker param is empty")) else printNoXposedEnvLog() } @@ -273,7 +273,7 @@ object YukiHookAPI { * 通过 baseContext 创建 Hook 入口类 * @return [PackageParam] */ - private val Context.packagePararm get() = PackageParam(PackageParamWrapper(packageName, processName, classLoader, applicationInfo)) + private val Context.packageParam get() = PackageParam(PackageParamWrapper(packageName, processName, classLoader, applicationInfo)) /** * 是否存在 [XposedBridge]