mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-04 17:55:34 +08:00
移除不必要的 Hook,修复 MIUI 12 下依然卡顿的问题
This commit is contained in:
@@ -76,9 +76,6 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
private const val NotificationViewWrapperClass =
|
private const val NotificationViewWrapperClass =
|
||||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationViewWrapper"
|
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationViewWrapper"
|
||||||
|
|
||||||
/** 原生存在的类 */
|
|
||||||
private const val StatusBarIconViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.StatusBarIconView"
|
|
||||||
|
|
||||||
/** 原生存在的类 */
|
/** 原生存在的类 */
|
||||||
private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil"
|
private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil"
|
||||||
|
|
||||||
@@ -478,33 +475,6 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatusBarIconViewClass.hook {
|
|
||||||
/** 修复通知图标为彩色 - MIPUSH 修复 */
|
|
||||||
injectMember {
|
|
||||||
method { name = "updateIconColor" }
|
|
||||||
afterHook {
|
|
||||||
/** 获取自身 */
|
|
||||||
val iconImageView = instance<ImageView?>() ?: return@afterHook
|
|
||||||
|
|
||||||
/** 获取通知实例 */
|
|
||||||
val expandedNf = field { name = "mNotification" }.of<StatusBarNotification>(instance)
|
|
||||||
|
|
||||||
/** 对于之前没有通知图标色彩判断功能的版本判断是 MIUI 样式就停止 Hook */
|
|
||||||
if (!hasIgnoreStatusBarIconColor() && isShowMiuiStyle()) return@afterHook
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强制重新进行设置图标
|
|
||||||
* 防止 MIPUSH 不生效
|
|
||||||
*/
|
|
||||||
if (expandedNf?.isXmsf == true)
|
|
||||||
hookSmallIconOnSet(
|
|
||||||
context = iconImageView.context,
|
|
||||||
expandedNf,
|
|
||||||
expandedNf.notification?.smallIcon?.loadDrawable(iconImageView.context),
|
|
||||||
) { icon -> iconImageView.setImageBitmap(icon) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (NotificationHeaderViewWrapperInjectorClass.hasClass)
|
if (NotificationHeaderViewWrapperInjectorClass.hasClass)
|
||||||
NotificationHeaderViewWrapperInjectorClass.hook {
|
NotificationHeaderViewWrapperInjectorClass.hook {
|
||||||
/** 修复下拉通知图标自动设置回 APP 图标的方法 */
|
/** 修复下拉通知图标自动设置回 APP 图标的方法 */
|
||||||
|
Reference in New Issue
Block a user