Skip to content

Commit 9e1a6f2

Browse files
committed
Update demo
1 parent 7f7b8e9 commit 9e1a6f2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/HookEntry.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ object HookEntry : IYukiHookXposedInit {
103103
// 是否开启调试模式
104104
// 请注意 - 若作为发布版本请务必关闭调试功能防止对用户设备造成大量日志填充
105105
isDebug = true
106-
// Whether to enable the key-value cache function of [YukiHookModulePrefs]
106+
// Whether to enable the key-value cache function of [YukiHookPrefsBridge]
107107
// If there is no frequent interaction data with the Module App, it is recommended to enable it before the Host App restarts
108-
// If you need real-time interactive data, it is recommended to close or configure dynamically from [YukiHookModulePrefs]
109-
// 是否启用 [YukiHookModulePrefs] 的键值缓存功能
108+
// If you need real-time interactive data, it is recommended to close or configure dynamically from [YukiHookPrefsBridge]
109+
// 是否启用 [YukiHookPrefsBridge] 的键值缓存功能
110110
// 若无和模块频繁交互数据在宿主重新启动之前建议开启
111-
// 若需要实时交互数据建议关闭或从 [YukiHookModulePrefs] 中进行动态配置
112-
isEnableModulePrefsCache = true
111+
// 若需要实时交互数据建议关闭或从 [YukiHookPrefsBridge] 中进行动态配置
112+
isEnablePrefsBridgeCache = true
113113
// Whether to enable the current Xposed Module's own [Resources] cache function
114114
// Under normal circumstances, the resources of the Module App will not change
115115
// But in the case of locale changes, screen size changes. Etc. you need to refresh the cache
@@ -133,11 +133,11 @@ object HookEntry : IYukiHookXposedInit {
133133
// Enable will force [SharedPreferences] file permissions to be adjusted to [Context.MODE_WORLD_READABLE] (0664) at Module App startup
134134
// This is an optional experimental feature, this feature is not enabled by default
135135
// Only used to fix some systems that may still have file permission errors after enabling New XSharedPreferences
136-
// If you can use [YukiHookModulePrefs] normally, it is not recommended to enable this feature
136+
// If you can use [YukiHookPrefsBridge] normally, it is not recommended to enable this feature
137137
// 是否启用 Hook [SharedPreferences]
138138
// 启用后将在模块启动时强制将 [SharedPreferences] 文件权限调整为 [Context.MODE_WORLD_READABLE] (0664)
139139
// 这是一个可选的实验性功能 - 此功能默认不启用
140-
// 仅用于修复某些系统可能会出现在启用了 New XSharedPreferences 后依然出现文件权限错误问题 - 若你能正常使用 [YukiHookModulePrefs] 就不建议启用此功能
140+
// 仅用于修复某些系统可能会出现在启用了 New XSharedPreferences 后依然出现文件权限错误问题 - 若你能正常使用 [YukiHookPrefsBridge] 就不建议启用此功能
141141
isEnableHookSharedPreferences = false
142142
// Whether to enable the [YukiHookDataChannel] function of the current Xposed Module interacting with the Host App
143143
// Please make sure the Xposed Module's [Application] extends [ModuleApplication] to be valid

demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/ui/MainActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import com.highcapable.yukihookapi.demo_module.R
3737
import com.highcapable.yukihookapi.demo_module.data.DataConst
3838
import com.highcapable.yukihookapi.demo_module.databinding.ActivityMainBinding
3939
import com.highcapable.yukihookapi.hook.factory.dataChannel
40-
import com.highcapable.yukihookapi.hook.factory.modulePrefs
40+
import com.highcapable.yukihookapi.hook.factory.prefs
4141
import com.highcapable.yukihookapi.hook.xposed.parasitic.activity.base.ModuleAppCompatActivity
4242
import java.text.SimpleDateFormat
4343
import java.util.*
@@ -66,7 +66,7 @@ class MainActivity : ModuleAppCompatActivity() {
6666
moduleDemoYukiHookApiVersionText.text = "YukiHookAPI Version:${YukiHookAPI.API_VERSION_NAME}(${YukiHookAPI.API_VERSION_CODE})"
6767
moduleDemoYukiHookApiVersionZhText.text = "YukiHookAPI 版本"
6868
moduleDemoNewXshareText.text =
69-
"${if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences Readable" else "New XSharedPreferences"}${modulePrefs.isPreferencesAvailable}"
69+
"${if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences Readable" else "New XSharedPreferences"}${prefs().isPreferencesAvailable}"
7070
moduleDemoNewXshareZhText.text =
7171
if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences 是否可用" else "New XSharedPreferences 支持状态"
7272
moduleDemoResHookText.text = "Support Resources Hook:${YukiHookAPI.Status.isSupportResourcesHook}"
@@ -78,11 +78,11 @@ class MainActivity : ModuleAppCompatActivity() {
7878
it.isEnabled = false
7979
moduleDemoButton.isEnabled = false
8080
}
81-
it.setText(modulePrefs.get(DataConst.TEST_KV_DATA))
81+
it.setText(prefs().get(DataConst.TEST_KV_DATA))
8282
moduleDemoButton.setOnClickListener { _ ->
8383
moduleEnvironment {
8484
if (it.text.toString().isNotEmpty()) {
85-
modulePrefs.edit { put(DataConst.TEST_KV_DATA, it.text.toString()) }
85+
prefs().edit { put(DataConst.TEST_KV_DATA, it.text.toString()) }
8686
Toast.makeText(applicationContext, "Saved", Toast.LENGTH_SHORT).show()
8787
} else Toast.makeText(applicationContext, "Please enter the text", Toast.LENGTH_SHORT).show()
8888
}

0 commit comments

Comments
 (0)