From 60056806724951361bb44bba7a7d20ecf5d1fcff Mon Sep 17 00:00:00 2001 From: Dev4Mod Date: Thu, 4 Jul 2024 19:24:21 -0300 Subject: [PATCH] Fix color bug in message counter --- .../xposed/features/customization/CustomTheme.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/CustomTheme.java b/app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/CustomTheme.java index 6e9a8e69..783b6cb6 100644 --- a/app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/CustomTheme.java +++ b/app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/CustomTheme.java @@ -2,6 +2,7 @@ import static com.wmods.wppenhacer.utils.ColorReplacement.replaceColors; import static com.wmods.wppenhacer.utils.DrawableColors.replaceColor; +import static de.robv.android.xposed.XposedHelpers.findAndHookConstructor; import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; import android.Manifest; @@ -9,10 +10,15 @@ import android.app.Notification; import android.content.pm.PackageManager; import android.content.res.ColorStateList; +import android.graphics.BlendMode; +import android.graphics.BlendModeColorFilter; import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; +import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -181,6 +187,10 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable { }); var intBgHook = new IntBgColorHook(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + findAndHookConstructor(BlendModeColorFilter.class, int.class, BlendMode.class, intBgHook); + } + findAndHookConstructor(PorterDuffColorFilter.class, int.class, PorterDuff.Mode.class, intBgHook); findAndHookMethod(TextView.class.getName(), classLoader, "setTextColor", int.class, intBgHook); findAndHookMethod(Paint.class.getName(), classLoader, "setColor", int.class, intBgHook); findAndHookMethod(View.class.getName(), classLoader, "setBackgroundColor", int.class, intBgHook);