mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2026-03-26 21:35:11 +08:00
fix: The refreshNotificationIcons does not work on ColorOS 16 (#89)
* fix: The refreshNotificationIcons does not work on ColorOS 16 * optimize field position Removed duplicate declaration of ViewConfigCoordinatorClass.
This commit is contained in:
@@ -115,6 +115,9 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
|
|
||||||
/** 原生存在的类 */
|
/** 原生存在的类 */
|
||||||
private val MediaDataClass by lazyClassOrNull("${PackageName.SYSTEMUI}.media.MediaData")
|
private val MediaDataClass by lazyClassOrNull("${PackageName.SYSTEMUI}.media.MediaData")
|
||||||
|
|
||||||
|
/** 原生存在的类 */
|
||||||
|
private val ViewConfigCoordinatorClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.collection.coordinator.ViewConfigCoordinator")
|
||||||
|
|
||||||
/** 原生存在的类 - 旧版本不存在 */
|
/** 原生存在的类 - 旧版本不存在 */
|
||||||
private val LegacyNotificationIconAreaControllerImpl by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.phone.LegacyNotificationIconAreaControllerImpl")
|
private val LegacyNotificationIconAreaControllerImpl by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.phone.LegacyNotificationIconAreaControllerImpl")
|
||||||
@@ -142,7 +145,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
|
|
||||||
/** ColorOS 存在的类 - 旧版本不存在 */
|
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||||
private val OplusNotificationGroupTemplateWrapperClass by lazyClassOrNull("com.oplus.systemui.notification.row.oplusgroup.OplusNotificationGroupTemplateWrapper")
|
private val OplusNotificationGroupTemplateWrapperClass by lazyClassOrNull("com.oplus.systemui.notification.row.oplusgroup.OplusNotificationGroupTemplateWrapper")
|
||||||
|
|
||||||
/** 根据多个版本存在不同的包名相同的类 */
|
/** 根据多个版本存在不同的包名相同的类 */
|
||||||
private val OplusNotificationIconAreaControllerClass by lazyClass(
|
private val OplusNotificationIconAreaControllerClass by lazyClass(
|
||||||
VariousClass(
|
VariousClass(
|
||||||
@@ -293,6 +296,13 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
name = "proxyOnContentUpdated"
|
name = "proxyOnContentUpdated"
|
||||||
parameterCount = 1
|
parameterCount = 1
|
||||||
} != null
|
} != null
|
||||||
|
|
||||||
|
private val isNotificationPresenter
|
||||||
|
get() = StatusBarNotificationPresenterClass.resolve().optional(silent = true)
|
||||||
|
.firstMethodOrNull {
|
||||||
|
name = "updateNotificationsOnDensityOrFontScaleChanged"
|
||||||
|
emptyParameters()
|
||||||
|
} != null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印日志
|
* 打印日志
|
||||||
@@ -785,7 +795,10 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
if (args().first().any() != null) instance<ImageView>().also { registerWallpaperColorChanged(it) }
|
if (args().first().any() != null) instance<ImageView>().also { registerWallpaperColorChanged(it) }
|
||||||
}
|
}
|
||||||
/** 注入通知控制器实例 */
|
/** 注入通知控制器实例 */
|
||||||
StatusBarNotificationPresenterClass.resolve().optional().constructor {}.hookAll().after { notificationPresenter = instance }
|
if (isNotificationPresenter)
|
||||||
|
StatusBarNotificationPresenterClass.resolve().optional().constructor {}.hookAll().after { notificationPresenter = instance }
|
||||||
|
else
|
||||||
|
ViewConfigCoordinatorClass?.resolve()?.optional()?.constructor {}?.hookAll()?.after { notificationPresenter = instance }
|
||||||
/** 替换通知面板背景 - 新版本 */
|
/** 替换通知面板背景 - 新版本 */
|
||||||
if (!isOldNotificationBackground)
|
if (!isOldNotificationBackground)
|
||||||
OplusNotificationBackgroundViewClass?.resolve()?.optional()?.apply {
|
OplusNotificationBackgroundViewClass?.resolve()?.optional()?.apply {
|
||||||
@@ -1023,4 +1036,4 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user