diff --git a/app/src/main/java/com/fankes/miui/notify/const/Const.kt b/app/src/main/java/com/fankes/miui/notify/const/Const.kt index 21f74df..7d16b5c 100644 --- a/app/src/main/java/com/fankes/miui/notify/const/Const.kt +++ b/app/src/main/java/com/fankes/miui/notify/const/Const.kt @@ -47,8 +47,8 @@ object Const { const val MODULE_VERSION_VERIFY_TAG = "module_version_verify" /** 发送通讯广播号标签 */ - const val MODULE_CHECKING_RECEIVER_TAG = "mnn_checking_action" + const val ACTION_MODULE_CHECKING_RECEIVER = "mnn_checking_action" /** 接收通讯广播号标签 */ - const val MODULE_HANDLER_RECEIVER_TAG = "mnn_handler_action" + const val ACTION_MODULE_HANDLER_RECEIVER = "mnn_handler_action" } \ No newline at end of file diff --git a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt index 0fa5e66..ebb3c83 100644 --- a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt +++ b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt @@ -164,7 +164,7 @@ class SystemUIHooker : YukiBaseHooker() { object : BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { context?.sendBroadcast(Intent().apply { - action = Const.MODULE_HANDLER_RECEIVER_TAG + action = Const.ACTION_MODULE_HANDLER_RECEIVER putExtra("isAction", true) putExtra("isValied", intent?.getStringExtra(Const.MODULE_VERSION_VERIFY_TAG) == Const.MODULE_VERSION_VERIFY) }) @@ -179,7 +179,7 @@ class SystemUIHooker : YukiBaseHooker() { private fun registerReceiver(context: Context) { if (isRegisterReceiver) return context.registerReceiver(userPresentReceiver, IntentFilter().apply { addAction(Intent.ACTION_USER_PRESENT) }) - context.registerReceiver(moduleReceiver, IntentFilter().apply { addAction(Const.MODULE_CHECKING_RECEIVER_TAG) }) + context.registerReceiver(moduleReceiver, IntentFilter().apply { addAction(Const.ACTION_MODULE_CHECKING_RECEIVER) }) isRegisterReceiver = true } diff --git a/app/src/main/java/com/fankes/miui/notify/ui/activity/MainActivity.kt b/app/src/main/java/com/fankes/miui/notify/ui/activity/MainActivity.kt index 159b5d5..df4e477 100644 --- a/app/src/main/java/com/fankes/miui/notify/ui/activity/MainActivity.kt +++ b/app/src/main/java/com/fankes/miui/notify/ui/activity/MainActivity.kt @@ -242,7 +242,7 @@ class MainActivity : BaseActivity() { openBrowser(url = "https://www.coolapk.com/u/876977", packageName = "com.coolapk.market") } /** 注册广播检查模块激活状态 */ - registerReceiver(hostReceiver, IntentFilter().apply { addAction(Const.MODULE_HANDLER_RECEIVER_TAG) }) + registerReceiver(hostReceiver, IntentFilter().apply { addAction(Const.ACTION_MODULE_HANDLER_RECEIVER) }) } /** 刷新模块状态 */ @@ -281,7 +281,7 @@ class MainActivity : BaseActivity() { refreshModuleStatus() /** 发送广播检查模块激活状态 */ sendBroadcast(Intent().apply { - action = Const.MODULE_CHECKING_RECEIVER_TAG + action = Const.ACTION_MODULE_CHECKING_RECEIVER putExtra(Const.MODULE_VERSION_VERIFY_TAG, Const.MODULE_VERSION_VERIFY) }) /** 经典样式启用后给出警告 */