Skip to content

Commit

Permalink
OpUtils: fix for OOS15.
Browse files Browse the repository at this point in the history
Signed-off-by: DHD2280 <[email protected]>
  • Loading branch information
DHD2280 committed Nov 16, 2024
1 parent a12b50a commit 0cfc884
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import static de.robv.android.xposed.XposedHelpers.callStaticMethod;
import static de.robv.android.xposed.XposedHelpers.findClass;
import static de.robv.android.xposed.XposedHelpers.getStaticIntField;
import static it.dhd.oxygencustomizer.xposed.utils.ReflectionTools.findClassInArray;

import android.content.Context;
import android.graphics.Color;
import android.os.Build;

import androidx.core.content.res.ResourcesCompat;

Expand Down Expand Up @@ -41,7 +43,7 @@ public static int getPrimaryColor(Context mContext) {
public static boolean isMediaIconNeedUseLightColor(Context context) {
if (QsColorUtil == null) return false;
try {
return (boolean) callStaticMethod(QsColorUtil, "isMediaIconNeedUseLightColor", context);
return (boolean) callStaticMethod(QsColorUtil, Build.VERSION.SDK_INT >= 35 ? "isIconNeedUseLightColor" : "isMediaIconNeedUseLightColor", context);
} catch (Throwable t) {
return false;
}
Expand Down Expand Up @@ -80,11 +82,9 @@ public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Th
OpUtils = null;
}

try {
QsColorUtil = findClass("com.oplus.systemui.qs.util.QsColorUtil", lpparam.classLoader);
} catch (Throwable t) {
QsColorUtil = null;
}
QsColorUtil = findClassInArray(lpparam,
"com.oplus.systemui.qs.base.util.QsColorUtil" /* OOS15 */,
"com.oplus.systemui.qs.util.QsColorUtil" /* OOS13-14 */);

try {
QSFragmentHelper = findClass("com.oplus.systemui.qs.helper.QSFragmentHelper", lpparam.classLoader);
Expand Down

0 comments on commit 0cfc884

Please sign in to comment.