mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-06 18:55:25 +08:00
优化代码
This commit is contained in:
@@ -523,17 +523,21 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
afterHook {
|
afterHook {
|
||||||
/** 对于之前没有通知图标色彩判断功能的版本判断是 MIUI 样式就停止 Hook */
|
/** 对于之前没有通知图标色彩判断功能的版本判断是 MIUI 样式就停止 Hook */
|
||||||
if (!hasIgnoreStatusBarIconColor() && isShowMiuiStyle()) return@afterHook
|
if (!hasIgnoreStatusBarIconColor() && isShowMiuiStyle()) return@afterHook
|
||||||
|
|
||||||
/** 获取小图标 */
|
/** 获取小图标 */
|
||||||
val iconImageView =
|
val iconImageView =
|
||||||
NotificationHeaderViewWrapperClass.clazz
|
NotificationHeaderViewWrapperClass.clazz
|
||||||
.field { name = "mIcon" }.of<ImageView>(instance) ?: return@afterHook
|
.field { name = "mIcon" }.of<ImageView>(instance) ?: return@afterHook
|
||||||
/** 从父类中得到 mRow 变量 - [ExpandableNotificationRowClass] */
|
|
||||||
NotificationViewWrapperClass.clazz.field { name = "mRow" }.get(instance).apply {
|
/**
|
||||||
/** 获取其中的得到通知方法 */
|
* 从父类中得到 mRow 变量 - [ExpandableNotificationRowClass]
|
||||||
|
* 获取其中的得到通知方法
|
||||||
|
*/
|
||||||
val expandedNf =
|
val expandedNf =
|
||||||
ExpandableNotificationRowClass.clazz
|
ExpandableNotificationRowClass.clazz
|
||||||
.method { name = "getStatusBarNotification" }
|
.method { name = "getStatusBarNotification" }
|
||||||
.get(self).invoke<StatusBarNotification>()
|
.get(NotificationViewWrapperClass.clazz.field { name = "mRow" }.get(instance).self)
|
||||||
|
.invoke<StatusBarNotification>()
|
||||||
/** 执行 Hook */
|
/** 执行 Hook */
|
||||||
hookNotifyIconOnSet(iconImageView.context, expandedNf, iconImageView)
|
hookNotifyIconOnSet(iconImageView.context, expandedNf, iconImageView)
|
||||||
}
|
}
|
||||||
@@ -543,5 +547,4 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user