Fix contains, all functions not support isUsingNativeStorage function in YukiHookPrefsBridge

This commit is contained in:
2023-04-18 22:15:56 +08:00
parent 635e8b5e40
commit 03320b40fa

View File

@@ -460,7 +460,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
* @return [Boolean] 是否包含 * @return [Boolean] 是否包含
*/ */
fun contains(key: String) = fun contains(key: String) =
if (isXposedEnvironment) if (isXposedEnvironment && isUsingNativeStorage.not())
currentXsp.contains(key) currentXsp.contains(key)
else currentSp.contains(key) else currentSp.contains(key)
@@ -473,7 +473,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
* @return [HashMap] 全部类型的键值数组 * @return [HashMap] 全部类型的键值数组
*/ */
fun all() = hashMapOf<String, Any?>().apply { fun all() = hashMapOf<String, Any?>().apply {
if (isXposedEnvironment) if (isXposedEnvironment && isUsingNativeStorage.not())
currentXsp.all.forEach { (k, v) -> this[k] = v } currentXsp.all.forEach { (k, v) -> this[k] = v }
else currentSp.all.forEach { (k, v) -> this[k] = v } else currentSp.all.forEach { (k, v) -> this[k] = v }
} }