Fix when now is xposed environment "isRunInNewXShareMode" function use host prefs to judge's bug

This commit is contained in:
2022-08-10 03:03:30 +08:00
parent 3ab997432a
commit 5f28f41188

View File

@@ -180,11 +180,13 @@ class YukiHookModulePrefs private constructor(private var context: Context? = nu
* @return [Boolean] 仅限在模块中判断 - 在 (Xposed) 宿主环境中始终返回 false * @return [Boolean] 仅限在模块中判断 - 在 (Xposed) 宿主环境中始终返回 false
*/ */
val isRunInNewXShareMode val isRunInNewXShareMode
get() = runCatching { get() = if (isXposedEnvironment.not())
/** 执行一次装载 */ runCatching {
sPref.edit() /** 执行一次装载 */
isUsingNewXSharePrefs sPref.edit()
}.getOrNull() ?: false isUsingNewXSharePrefs
}.getOrNull() ?: false
else false
/** /**
* 自定义 Sp 存储名称 * 自定义 Sp 存储名称