Skip to content

Commit 03320b4

Browse files
committed
Fix contains, all functions not support isUsingNativeStorage function in YukiHookPrefsBridge
1 parent 635e8b5 commit 03320b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookPrefsBridge.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
460460
* @return [Boolean] 是否包含
461461
*/
462462
fun contains(key: String) =
463-
if (isXposedEnvironment)
463+
if (isXposedEnvironment && isUsingNativeStorage.not())
464464
currentXsp.contains(key)
465465
else currentSp.contains(key)
466466

@@ -473,7 +473,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
473473
* @return [HashMap] 全部类型的键值数组
474474
*/
475475
fun all() = hashMapOf<String, Any?>().apply {
476-
if (isXposedEnvironment)
476+
if (isXposedEnvironment && isUsingNativeStorage.not())
477477
currentXsp.all.forEach { (k, v) -> this[k] = v }
478478
else currentSp.all.forEach { (k, v) -> this[k] = v }
479479
}

0 commit comments

Comments
 (0)