mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-05 10:15:33 +08:00
fix: coloros 15 removed updateIconsForLayout method (#76)
This commit is contained in:
@@ -749,7 +749,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
StatusBarNotificationPresenterClass.constructor().hookAll().after { notificationPresenter = instance }
|
StatusBarNotificationPresenterClass.constructor().hookAll().after { notificationPresenter = instance }
|
||||||
/** 注入状态栏通知图标容器实例 */
|
/** 注入状态栏通知图标容器实例 */
|
||||||
OplusNotificationIconAreaControllerClass.apply {
|
OplusNotificationIconAreaControllerClass.apply {
|
||||||
var isOldWay = false
|
var way = 0
|
||||||
method {
|
method {
|
||||||
name = "updateIconsForLayout"
|
name = "updateIconsForLayout"
|
||||||
paramCount = 10
|
paramCount = 10
|
||||||
@@ -762,13 +762,20 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
method {
|
method {
|
||||||
name = "updateIconsForLayout"
|
name = "updateIconsForLayout"
|
||||||
paramCount = 1
|
paramCount = 1
|
||||||
}.onFind { isOldWay = true }
|
}.onFind { way = 1 }
|
||||||
|
method {
|
||||||
|
name = "updateStatusBarIcons"
|
||||||
|
}.onFind { way = 2 }
|
||||||
}.hook().after {
|
}.hook().after {
|
||||||
if (isOldWay) {
|
when (way) {
|
||||||
notificationIconInstances.clear()
|
1 -> notificationIconContainer = OplusNotificationIconAreaControllerClass.method { name = "getNotificationIcons" }.get(instance).invoke()
|
||||||
field { name = "mLastToShow" }.get(instance).list<View>()
|
2 -> {
|
||||||
.takeIf { it.isNotEmpty() }?.forEach { notificationIconInstances.add(it) }
|
notificationIconInstances.clear()
|
||||||
} else notificationIconContainer = args(index = 1).cast()
|
field { name = "mLastToShow" }.get(instance).list<View>()
|
||||||
|
.takeIf { it.isNotEmpty() }?.forEach { notificationIconInstances.add(it) }
|
||||||
|
}
|
||||||
|
else -> notificationIconContainer = args(index = 1).cast()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/** 注入状态栏通知图标容器实例 */
|
/** 注入状态栏通知图标容器实例 */
|
||||||
NotificationIconAreaControllerClass.apply {
|
NotificationIconAreaControllerClass.apply {
|
||||||
@@ -896,4 +903,4 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user