From fd150d9dfd8444b23e9cdc2cefbecfac0935d144 Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Fri, 15 Sep 2023 13:01:13 +0600 Subject: [PATCH] QS Transparency: Remove parameterized condition from hook method --- .../iconify/xposed/mods/QSTransparency.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSTransparency.java b/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSTransparency.java index 7f6104aed..60d0fda8a 100644 --- a/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSTransparency.java +++ b/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSTransparency.java @@ -5,13 +5,12 @@ import static com.drdisagree.iconify.common.Preferences.QSALPHA_LEVEL; import static com.drdisagree.iconify.common.Preferences.QS_TRANSPARENCY_SWITCH; import static com.drdisagree.iconify.config.XPrefs.Xprefs; -import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; +import static de.robv.android.xposed.XposedBridge.hookAllMethods; import static de.robv.android.xposed.XposedHelpers.findClass; import static de.robv.android.xposed.XposedHelpers.findField; import static de.robv.android.xposed.XposedHelpers.getObjectField; import android.content.Context; -import android.view.View; import com.drdisagree.iconify.xposed.ModPack; @@ -42,9 +41,9 @@ public void updatePrefs(String... Key) { public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpParam) { if (!lpParam.packageName.equals(SYSTEMUI_PACKAGE)) return; - final Class ScrimController = findClass(SYSTEMUI_PACKAGE + ".statusbar.phone.ScrimController", lpParam.classLoader); + final Class ScrimControllerClass = findClass(SYSTEMUI_PACKAGE + ".statusbar.phone.ScrimController", lpParam.classLoader); - findAndHookMethod(ScrimController, "updateScrimColor", View.class, Integer.TYPE, Float.TYPE, new XC_MethodHook() { + hookAllMethods(ScrimControllerClass, "updateScrimColor", new XC_MethodHook() { protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (!qsTransparencyActive && !onlyNotifTransparencyActive) return; @@ -57,11 +56,11 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { } else { String scrimName = "unknown_scrim"; - if (findField(ScrimController, "mScrimInFront").get(param.thisObject).equals(param.args[0])) { + if (findField(ScrimControllerClass, "mScrimInFront").get(param.thisObject).equals(param.args[0])) { scrimName = "front_scrim"; - } else if (findField(ScrimController, "mScrimBehind").get(param.thisObject).equals(param.args[0])) { + } else if (findField(ScrimControllerClass, "mScrimBehind").get(param.thisObject).equals(param.args[0])) { scrimName = "behind_scrim"; - } else if (findField(ScrimController, "mNotificationsScrim").get(param.thisObject).equals(param.args[0])) { + } else if (findField(ScrimControllerClass, "mNotificationsScrim").get(param.thisObject).equals(param.args[0])) { scrimName = "notifications_scrim"; }