修复状态栏图标不是纯黑的问题

This commit is contained in:
2022-03-17 03:35:18 +08:00
parent f433da040c
commit 740a250a59
3 changed files with 9 additions and 3 deletions

2
.idea/misc.xml generated
View File

@@ -23,7 +23,7 @@
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -30,7 +30,7 @@ android {
buildTypes {
release {
minifyEnabled true
minifyEnabled false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

View File

@@ -79,6 +79,9 @@ class HookEntry : YukiHookXposedInitProxy {
/** 原生存在的类 */
private const val StatusBarIconViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.StatusBarIconView"
/** 原生存在的类 */
private const val NotificationIconContainerClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.phone.NotificationIconContainer"
/** 根据多个版本存在不同的包名相同的类 */
private val ExpandableNotificationRowClass = VariousClass(
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.ExpandableNotificationRow",
@@ -532,7 +535,10 @@ class HookEntry : YukiHookXposedInitProxy {
instance<ImageView>().also {
if (hasIgnoreStatusBarIconColor(it.context, field { name = "mNotification" }
.of<StatusBarNotification>(instance))) it.colorFilter = null
else it.setColorFilter(field { name = "mCurrentSetColor" }.of<Int>(instance) ?: 0)
/** 防止图标不是纯黑的问题 */
else it.setColorFilter(
field { name = "mCurrentSetColor" }.of<Int>(instance)
?.let { color -> if (color == -419430401) color else Color.BLACK } ?: 0)
}
}
}