Skip to content

Commit

Permalink
Fix color bug in message counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev4Mod committed Jul 4, 2024
1 parent 039c26b commit 6005680
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

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;
import android.app.Activity;
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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6005680

Please sign in to comment.