Skip to content

Commit

Permalink
Merge pull request #350 from Mahmud0808/beta
Browse files Browse the repository at this point in the history
Merge beta into stable
  • Loading branch information
Mahmud0808 authored Nov 13, 2023
2 parents ee55c6d + 91dccfe commit 4a91a94
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ protected void afterHookedMethod(MethodHookParam param) {

View notificationBackgroundView = (View) getObjectField(param.thisObject, "mBackgroundNormal");

setObjectField(param.thisObject, "mCurrentBackgroundTint", 0);
try {
setObjectField(param.thisObject, "mCurrentBackgroundTint", (int) param.args[0]);
} catch (Throwable ignored) {
}

callMethod(getObjectField(notificationBackgroundView, "mBackground"), "clearColorFilter");
setObjectField(notificationBackgroundView, "mTintColor", 0);
notificationBackgroundView.invalidate();
Expand All @@ -246,6 +250,7 @@ protected void afterHookedMethod(MethodHookParam param) {

hookAllMethods(ActivatableNotificationViewClass, "setBackgroundTintColor", removeNotificationTint);
hookAllMethods(ActivatableNotificationViewClass, "updateBackgroundColors", removeNotificationTint);
hookAllMethods(ActivatableNotificationViewClass, "updateBackgroundTint", removeNotificationTint);

XC_MethodHook replaceTintColor = new XC_MethodHook() {
@Override
Expand All @@ -256,10 +261,14 @@ protected void beforeHookedMethod(MethodHookParam param) {
}
};

try {
hookAllMethods(NotificationBackgroundViewClass, "setCustomBackground$1", replaceTintColor);
} catch (Throwable ignored) {
}

try {
hookAllMethods(NotificationBackgroundViewClass, "setCustomBackground", replaceTintColor);
} catch (Throwable ignored) {
hookAllMethods(NotificationBackgroundViewClass, "setCustomBackground$1", replaceTintColor);
}

hookAllMethods(FooterViewClass, "updateColors", new XC_MethodHook() {
Expand Down

0 comments on commit 4a91a94

Please sign in to comment.