mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-05 18:25:28 +08:00
Fix a possible bug
This commit is contained in:
@@ -168,7 +168,7 @@ object YukiHookAPI {
|
|||||||
* @param wrapper 代理包装 [PackageParamWrapper]
|
* @param wrapper 代理包装 [PackageParamWrapper]
|
||||||
*/
|
*/
|
||||||
internal fun onXposedLoaded(wrapper: PackageParamWrapper) =
|
internal fun onXposedLoaded(wrapper: PackageParamWrapper) =
|
||||||
YukiHookXposedBridge.packageParamCallback?.invoke(PackageParam(wrapper)).apply { printSplashLog() }
|
YukiHookXposedBridge.packageParamCallback?.invoke(PackageParam(wrapper).apply { printSplashLog() })
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置 [YukiHookAPI] 相关参数
|
* 配置 [YukiHookAPI] 相关参数
|
||||||
@@ -229,7 +229,7 @@ object YukiHookAPI {
|
|||||||
fun encase(baseContext: Context?, initiate: PackageParam.() -> Unit) {
|
fun encase(baseContext: Context?, initiate: PackageParam.() -> Unit) {
|
||||||
isLoadedFromBaseContext = true
|
isLoadedFromBaseContext = true
|
||||||
when {
|
when {
|
||||||
hasXposedBridge && baseContext != null -> initiate.invoke(baseContext.packagePararm.apply { printSplashLog() })
|
hasXposedBridge && baseContext != null -> initiate.invoke(baseContext.packageParam.apply { printSplashLog() })
|
||||||
else -> printNoXposedEnvLog()
|
else -> printNoXposedEnvLog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ object YukiHookAPI {
|
|||||||
(if (baseContext != null)
|
(if (baseContext != null)
|
||||||
if (hooker.isNotEmpty()) {
|
if (hooker.isNotEmpty()) {
|
||||||
printSplashLog()
|
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 yLoggerE(msg = "Failed to passing \"encase\" method because your hooker param is empty"))
|
||||||
else printNoXposedEnvLog()
|
else printNoXposedEnvLog()
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ object YukiHookAPI {
|
|||||||
* 通过 baseContext 创建 Hook 入口类
|
* 通过 baseContext 创建 Hook 入口类
|
||||||
* @return [PackageParam]
|
* @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]
|
* 是否存在 [XposedBridge]
|
||||||
|
Reference in New Issue
Block a user