Merge code

This commit is contained in:
2022-03-22 21:10:14 +08:00
parent edcd81c9e8
commit 3ecbe6159b

View File

@@ -142,11 +142,12 @@ class HookEntry : YukiHookXposedInitProxy {
/** /**
* 是否启用通知图标优化功能 * 是否启用通知图标优化功能
* @param isHooking 是否判断启用通知功能 - 默认:是
* @return [Boolean] * @return [Boolean]
*/ */
private val PackageParam.isEnableHookColorNotifyIcon private fun PackageParam.isEnableHookColorNotifyIcon(isHooking: Boolean = true) =
get() = prefs.getBoolean(ENABLE_NOTIFY_ICON_FIX, default = true) && prefs.getBoolean(ENABLE_NOTIFY_ICON_FIX, default = true) &&
prefs.getBoolean(ENABLE_NOTIFY_ICON_FIX_NOTIFY, default = true) (if (isHooking) prefs.getBoolean(ENABLE_NOTIFY_ICON_FIX_NOTIFY, default = true) else true)
/** /**
* 打印日志 * 打印日志
@@ -294,7 +295,7 @@ class HookEntry : YukiHookXposedInitProxy {
IconPackParams(param = this).iconDatas.apply { IconPackParams(param = this).iconDatas.apply {
when { when {
isNotEmpty() -> forEach { iconDatas.add(it) } isNotEmpty() -> forEach { iconDatas.add(it) }
isEmpty() && isEnableHookColorNotifyIcon -> loggerW(msg = "NotifyIconSupportData is empty!") isEmpty() && isEnableHookColorNotifyIcon(isHooking = false) -> loggerW(msg = "NotifyIconSupportData is empty!")
} }
} }
} }
@@ -441,7 +442,7 @@ class HookEntry : YukiHookXposedInitProxy {
param(ContextClass, IntentClass) param(ContextClass, IntentClass)
} }
afterHook { afterHook {
if (isEnableHookColorNotifyIcon) (lastArgs as? Intent)?.also { if (isEnableHookColorNotifyIcon()) (lastArgs as? Intent)?.also {
if (!it.action.equals(Intent.ACTION_PACKAGE_REPLACED) && if (!it.action.equals(Intent.ACTION_PACKAGE_REPLACED) &&
it.getBooleanExtra(Intent.EXTRA_REPLACING, false) it.getBooleanExtra(Intent.EXTRA_REPLACING, false)
) return@also ) return@also