mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-06 10:45:20 +08:00
Fix a receiver bug
This commit is contained in:
@@ -41,7 +41,7 @@ object Const {
|
|||||||
const val MODULE_VERSION_CODE = BuildConfig.VERSION_CODE
|
const val MODULE_VERSION_CODE = BuildConfig.VERSION_CODE
|
||||||
|
|
||||||
/** 当前模块的版本校验 */
|
/** 当前模块的版本校验 */
|
||||||
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_202203281323"
|
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_20220329XXXX"
|
||||||
|
|
||||||
/** 当前模块的版本校验标签 */
|
/** 当前模块的版本校验标签 */
|
||||||
const val MODULE_VERSION_VERIFY_TAG = "module_version_verify"
|
const val MODULE_VERSION_VERIFY_TAG = "module_version_verify"
|
||||||
|
@@ -713,7 +713,9 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
afterHook {
|
afterHook {
|
||||||
if (firstArgs != null) instance<ImageView>().also {
|
if (firstArgs != null) instance<ImageView>().also {
|
||||||
|
/** 注册广播 */
|
||||||
registerReceiver(it.context)
|
registerReceiver(it.context)
|
||||||
|
/** 缓存实例 */
|
||||||
statusBarIconViews.add(it)
|
statusBarIconViews.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -867,11 +869,16 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method { name = "updateTime" }
|
method { name = "updateTime" }
|
||||||
afterHook {
|
afterHook {
|
||||||
if (isEnableHookColorNotifyIcon() && prefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO))
|
instance<View>().context.also {
|
||||||
IconAdaptationTool.prepareAutoUpdateIconRule(
|
/** 注册广播 */
|
||||||
context = instance<View>().context,
|
registerReceiver(it)
|
||||||
timeSet = prefs.get(DataConst.NOTIFY_ICON_FIX_AUTO_TIME)
|
/** 注册定时监听 */
|
||||||
)
|
if (isEnableHookColorNotifyIcon() && prefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO))
|
||||||
|
IconAdaptationTool.prepareAutoUpdateIconRule(
|
||||||
|
context = it,
|
||||||
|
timeSet = prefs.get(DataConst.NOTIFY_ICON_FIX_AUTO_TIME)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.ignoredHookClassNotFoundFailure()
|
}.ignoredHookClassNotFoundFailure()
|
||||||
|
Reference in New Issue
Block a user