Modify merge YukiHookPrefsBridge cache function to LruCache and add new PreferencesCacheManager

This commit is contained in:
2023-04-20 22:48:55 +08:00
parent ea609fb1c3
commit cc321df3b8
4 changed files with 331 additions and 161 deletions

View File

@@ -404,6 +404,8 @@ fun edit(): Editor
> 创建新的 `Editor`。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。
@@ -426,6 +428,8 @@ fun edit(initiate: Editor.() -> Unit)
自动调用 `Editor.apply` 方法。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。
@@ -444,16 +448,12 @@ fun clearCache()
**Function Illustrate**
> 清除 `XSharedPreferences` 中缓存的键值数据。
> 清除 `YukiHookPrefsBridge` 中缓存的键值数据。
无论是否开启 `YukiHookAPI.Configs.isEnablePrefsBridgeCache`。
调用此方法将清除当前存储的全部键值缓存。
下次将从 `XSharedPreferences` 重新读取。
在 (Xposed) 宿主环境中使用。
## Editor <span class="symbol">- class</span>
```kotlin:no-line-numbers
@@ -470,6 +470,8 @@ inner class Editor internal constructor()
请使用 `edit` 方法来获取 `Editor`。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。

View File

@@ -396,6 +396,8 @@ fun edit(): Editor
> 创建新的 `Editor`。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。
@@ -418,6 +420,8 @@ fun edit(initiate: Editor.() -> Unit)
自动调用 `Editor.apply` 方法。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。
@@ -436,16 +440,12 @@ fun clearCache()
**功能描述**
> 清除 `XSharedPreferences` 中缓存的键值数据。
> 清除 `YukiHookPrefsBridge` 中缓存的键值数据。
无论是否开启 `YukiHookAPI.Configs.isEnablePrefsBridgeCache`。
调用此方法将清除当前存储的全部键值缓存。
下次将从 `XSharedPreferences` 重新读取。
在 (Xposed) 宿主环境中使用。
## Editor <span class="symbol">- class</span>
```kotlin:no-line-numbers
@@ -462,6 +462,8 @@ inner class Editor internal constructor()
请使用 `edit` 方法来获取 `Editor`。
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
::: warning
在 (Xposed) 宿主环境下只读,无法使用。