diff --git a/app/src/main/java/com/fankes/coloros/notify/hook/entity/SystemUIHooker.kt b/app/src/main/java/com/fankes/coloros/notify/hook/entity/SystemUIHooker.kt index 46379a8..8d7263e 100644 --- a/app/src/main/java/com/fankes/coloros/notify/hook/entity/SystemUIHooker.kt +++ b/app/src/main/java/com/fankes/coloros/notify/hook/entity/SystemUIHooker.kt @@ -52,6 +52,7 @@ import com.fankes.coloros.notify.param.IconPackParams import com.fankes.coloros.notify.param.factory.isAppNotifyHookAllOf import com.fankes.coloros.notify.param.factory.isAppNotifyHookOf import com.fankes.coloros.notify.utils.factory.* +import com.fankes.coloros.notify.utils.tool.ActivationPromptTool import com.fankes.coloros.notify.utils.tool.BitmapCompatTool import com.fankes.coloros.notify.utils.tool.IconAdaptationTool import com.fankes.coloros.notify.utils.tool.SystemUITool @@ -556,11 +557,12 @@ object SystemUIHooker : YukiBaseHooker() { addAction(Intent.ACTION_PACKAGE_REPLACED) addAction(Intent.ACTION_PACKAGE_REMOVED) }) { context, intent -> - if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED).not() && - intent.getBooleanExtra(Intent.EXTRA_REPLACING, false) - ) return@registerReceiver - if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify) - intent.data?.schemeSpecificPart?.also { packageName -> + intent.data?.schemeSpecificPart?.also { packageName -> + if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED)) ActivationPromptTool.prompt(context, packageName) + if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED).not() && + intent.getBooleanExtra(Intent.EXTRA_REPLACING, false) + ) return@registerReceiver + if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify) when (intent.action) { Intent.ACTION_PACKAGE_ADDED -> { if (iconDatas.takeIf { e -> e.isNotEmpty() } @@ -570,7 +572,7 @@ object SystemUIHooker : YukiBaseHooker() { } Intent.ACTION_PACKAGE_REMOVED -> IconAdaptationTool.removeNewAppSupportNotify(context, packageName) } - } + } } /** 注入模块资源 */ onCreate { injectModuleAppResources() } diff --git a/app/src/main/java/com/fankes/coloros/notify/utils/tool/ActivationPromptTool.kt b/app/src/main/java/com/fankes/coloros/notify/utils/tool/ActivationPromptTool.kt new file mode 100644 index 0000000..593476d --- /dev/null +++ b/app/src/main/java/com/fankes/coloros/notify/utils/tool/ActivationPromptTool.kt @@ -0,0 +1,84 @@ +/* + * ColorOSNotifyIcon - Optimize notification icons for ColorOS and adapt to native notification icon specifications. + * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com) + * https://github.com/fankes/ColorOSNotifyIcon + * + * This software is non-free but opensource software: you can redistribute it + * and/or modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + *
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and eula along with this software. If not, see
+ *