mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-06 18:55:37 +08:00
尝试修复部分系统的问题,适配 ColorOS 11
This commit is contained in:
@@ -84,16 +84,18 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
/** 原生存在的类 */
|
/** 原生存在的类 */
|
||||||
private const val IconManagerClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconManager"
|
private const val IconManagerClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconManager"
|
||||||
|
|
||||||
/** ColorOS 存在的类 */
|
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||||
private const val OplusContrastColorUtilClass = "com.oplusos.util.OplusContrastColorUtil"
|
private const val OplusContrastColorUtilClass = "com.oplusos.util.OplusContrastColorUtil"
|
||||||
|
|
||||||
/** ColorOS 存在的类 */
|
|
||||||
private const val OplusPowerNotificationWarningsClass =
|
|
||||||
"com.oplusos.systemui.notification.power.OplusPowerNotificationWarnings"
|
|
||||||
|
|
||||||
/** ColorOS 存在的类 */
|
/** ColorOS 存在的类 */
|
||||||
private const val SystemPromptControllerClass = "com.oplusos.systemui.statusbar.policy.SystemPromptController"
|
private const val SystemPromptControllerClass = "com.oplusos.systemui.statusbar.policy.SystemPromptController"
|
||||||
|
|
||||||
|
/** 根据多个版本存在不同的包名相同的类 */
|
||||||
|
private val OplusPowerNotificationWarningsClass = VariousClass(
|
||||||
|
"com.oplusos.systemui.notification.power.OplusPowerNotificationWarnings",
|
||||||
|
"com.coloros.systemui.notification.power.ColorosPowerNotificationWarnings"
|
||||||
|
)
|
||||||
|
|
||||||
/** 根据多个版本存在不同的包名相同的类 */
|
/** 根据多个版本存在不同的包名相同的类 */
|
||||||
private val ExpandableNotificationRowClass = VariousClass(
|
private val ExpandableNotificationRowClass = VariousClass(
|
||||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.ExpandableNotificationRow",
|
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.ExpandableNotificationRow",
|
||||||
@@ -293,16 +295,17 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 修复并替换 ColorOS 原生灰度图标色彩判断 */
|
/** 修复并替换新版本 ColorOS 原生灰度图标色彩判断 */
|
||||||
NotificationUtilsClass.hook {
|
if (OplusContrastColorUtilClass.hasClass)
|
||||||
injectMember {
|
NotificationUtilsClass.hook {
|
||||||
method {
|
injectMember {
|
||||||
name = "isGrayscaleOplus"
|
method {
|
||||||
param(ImageViewClass, OplusContrastColorUtilClass.clazz)
|
name = "isGrayscaleOplus"
|
||||||
|
param(ImageViewClass, OplusContrastColorUtilClass.clazz)
|
||||||
|
}
|
||||||
|
replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } }
|
||||||
}
|
}
|
||||||
replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } }
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/** 替换状态栏图标 */
|
/** 替换状态栏图标 */
|
||||||
IconManagerClass.hook {
|
IconManagerClass.hook {
|
||||||
injectMember {
|
injectMember {
|
||||||
|
Reference in New Issue
Block a user