Skip to content

Commit

Permalink
Improved LunarHelper on OOS15.
Browse files Browse the repository at this point in the history
Signed-off-by: DHD2280 <[email protected]>
  • Loading branch information
DHD2280 committed Jan 4, 2025
1 parent 84f6fae commit 6cc9db2
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import it.dhd.oxygencustomizer.xposed.XposedMods;
import it.dhd.oxygencustomizer.xposed.utils.toolkit.ReflectedClass;

public class OpUtils extends XposedMods {

private static final String listenPackage = SYSTEM_UI;
public static Class<?> QsColorUtil = null;
private static Class<?> OpUtils = null;
private static Class<?> QSFragmentHelper = null;
private Context mSysuiAppContext = null;
private static Object LunarHelper = null;
private static Class<?> FlavorTwoFeatureOption = null;

Expand Down Expand Up @@ -134,12 +136,13 @@ public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Th
if (LunarHelperClass != null) {
if (Build.VERSION.SDK_INT >= 35) {
Object LunarHelperCompanion = getStaticObjectField(LunarHelperClass, "Companion");
hookAllMethods(LunarHelperCompanion.getClass(), "getInstance", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (LunarHelper == null) LunarHelper = param.getResult();
}
});
ReflectedClass StatusBarHelper = ReflectedClass.of("com.oplus.systemui.statusbar.util.StatusBarHelper");
StatusBarHelper
.beforeConstruction()
.run(param -> {
mSysuiAppContext = (Context) param.args[0];
LunarHelper = callMethod(LunarHelperCompanion, "getInstance", mSysuiAppContext);
});
} else {
hookAllConstructors(LunarHelperClass, new XC_MethodHook() {
@Override
Expand Down

0 comments on commit 6cc9db2

Please sign in to comment.