3 Commits
2.97 ... 2.98

Author SHA1 Message Date
3f3a92f192 Update version to 2.98 2023-04-21 02:21:55 +08:00
49f18ef8c3 Added enable or disable prefs cache function 2023-04-21 02:15:08 +08:00
73173cd7ab Update YukiHookAPI 2023-04-21 01:29:06 +08:00
6 changed files with 66 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
[![Blank](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/fankes/MIUINativeNotifyIcon)
[![Blank](https://img.shields.io/badge/license-AGPL3.0-blue)](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/LICENSE)
[![Blank](https://img.shields.io/badge/version-v2.97-green)](https://github.com/fankes/MIUINativeNotifyIcon/releases)
[![Blank](https://img.shields.io/badge/version-v2.98-green)](https://github.com/fankes/MIUINativeNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/fankes/MIUINativeNotifyIcon/total?label=Release)](https://github.com/fankes/MIUINativeNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.fankes.miui.notify/total?label=LSPosed%20Repo&logo=Android&style=flat&labelColor=F48FB1&logoColor=ffffff)](https://github.com/Xposed-Modules-Repo/com.fankes.miui.notify/releases)
[![Telegram](https://img.shields.io/badge/Follow-Telegram-blue.svg?logo=telegram)](https://t.me/XiaofangInternet)

View File

@@ -72,8 +72,8 @@ android {
dependencies {
compileOnly 'de.robv.android.xposed:api:82'
implementation 'com.highcapable.yukihookapi:api:1.1.9'
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.1.9'
implementation 'com.highcapable.yukihookapi:api:1.1.10'
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.1.10'
implementation 'com.github.duanhong169:drawabletoolbox:1.0.7'
implementation "com.github.topjohnwu.libsu:core:5.0.4"
implementation 'androidx.annotation:annotation:1.6.0'

View File

@@ -26,6 +26,7 @@ package com.fankes.miui.notify.data
import android.content.Context
import com.fankes.miui.notify.const.IconRuleSourceSyncType
import com.highcapable.yukihookapi.YukiHookAPI
import com.highcapable.yukihookapi.hook.factory.prefs
import com.highcapable.yukihookapi.hook.log.loggerW
import com.highcapable.yukihookapi.hook.param.PackageParam
@@ -39,6 +40,9 @@ object ConfigData {
/** 启用模块 */
val ENABLE_MODULE = PrefsData("_enable_module", true)
/** 启用数据缓存 */
val ENABLE_PREFS_CACHE = PrefsData("_enable_prefs_cache", true)
/** 启用模块日志 */
val ENABLE_MODULE_LOG = PrefsData("_enable_module_log", false)
@@ -106,6 +110,8 @@ object ConfigData {
is Context, is PackageParam -> this.instance = instance
else -> error("Unknown type for init ConfigData")
}
/** 设置是否启用数据缓存 */
YukiHookAPI.Configs.isEnablePrefsBridgeCache = isEnablePrefsCache
}
/**
@@ -190,6 +196,16 @@ object ConfigData {
putBoolean(ENABLE_MODULE, value)
}
/**
* 是否启用数据缓存
* @return [Boolean]
*/
var isEnablePrefsCache
get() = getBoolean(ENABLE_PREFS_CACHE)
set(value) {
putBoolean(ENABLE_PREFS_CACHE, value)
}
/**
* 是否启用模块日志
* @return [Boolean]

View File

@@ -164,6 +164,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
binding.moduleEnableSwitch.bind(ConfigData.ENABLE_MODULE) {
onInitialize {
binding.moduleEnableLogSwitch.isVisible = it
binding.moduleEnableLogText.isVisible = it
binding.modulePrefsCacheEnableSwitch.isVisible = it
binding.modulePrefsCacheEnableText.isVisible = it
binding.expAllDebugLogButton.isVisible = it && ConfigData.isEnableModuleLog
binding.colorIconHookItem.isVisible = it
binding.statusIconCountItem.isVisible = isLowerAndroidR.not() && it
@@ -176,6 +179,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
SystemUITool.showNeedRestartSnake(context = this@MainActivity)
}
}
binding.modulePrefsCacheEnableSwitch.bind(ConfigData.ENABLE_PREFS_CACHE) {
onChanged { SystemUITool.showNeedRestartSnake(context = this@MainActivity) }
}
binding.moduleEnableLogSwitch.bind(ConfigData.ENABLE_MODULE_LOG) {
onInitialize { binding.expAllDebugLogButton.isVisible = it && ConfigData.isEnableModule }
onChanged {

View File

@@ -253,10 +253,47 @@
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="5dp"
android:text="启用模块"
android:textColor="@color/colorTextGray"
android:textSize="15sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="10dp"
android:alpha="0.6"
android:lineSpacingExtra="6dp"
android:text="模块关闭后一切功能都将彻底停止工作。"
android:textColor="@color/colorTextDark"
android:textSize="12sp" />
<com.fankes.miui.notify.ui.widget.MaterialSwitch
android:id="@+id/module_prefs_cache_enable_switch"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="10dp"
android:text="启用数据缓存"
android:textColor="@color/colorTextGray"
android:textSize="15sp" />
<TextView
android:id="@+id/module_prefs_cache_enable_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="5dp"
android:alpha="0.6"
android:lineSpacingExtra="6dp"
android:text="此选项默认开启,默认情况下模块会将数据缓存在内存中,防止每次重复读取数据造成卡顿,如果开启此选项后一段时间导致系统界面 (系统 UI) 崩溃 (内存溢出),你可以尝试关闭此选项,但是这有可能会造成在通知较多时下拉通知栏出现卡顿。"
android:textColor="@color/colorTextDark"
android:textSize="12sp" />
<com.fankes.miui.notify.ui.widget.MaterialSwitch
android:id="@+id/module_enable_log_switch"
android:layout_width="match_parent"
@@ -284,6 +321,7 @@
android:textSize="15sp" />
<TextView
android:id="@+id/module_enable_log_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
@@ -291,7 +329,7 @@
android:layout_marginBottom="10dp"
android:alpha="0.6"
android:lineSpacingExtra="6dp"
android:text="模块关闭后一切功能都将彻底停止工作。"
android:text="默认情况下不建议开启此选项,仅在模块故障时开启,此时你可以发送调试日志给开发者帮助我们快速定位问题。"
android:textColor="@color/colorTextDark"
android:textSize="12sp" />
</LinearLayout>

View File

@@ -12,8 +12,8 @@ ext {
targetSdk : 33
]
app = [
versionName : '2.97',
versionCode : 37,
versionName : '2.98',
versionCode : 38,
signingConfigs: [
secretConfigsDirPath : "${projectDir.getAbsolutePath()}/.secret",
secretConfigsFileName: "key_store_secret.json"