Skip to content

Commit

Permalink
fix: UnlockBlurSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Dec 17, 2024
1 parent f6363a5 commit 6f3ff51
Showing 1 changed file with 38 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,48 @@ public class UnlockBlurSupported extends BaseHook {
@Override
public void init() throws NoSuchMethodException {
findAndHookMethod("com.miui.home.launcher.common.BlurUtilities",
"isBlurSupported",
new MethodHook() {
@Override
protected void before(MethodHookParam param) {
boolean isDefaultIcon = (boolean) XposedHelpers.callStaticMethod(
findClassIfExists("com.miui.home.launcher.DeviceConfig"),
"isDefaultIcon");
if (!isDefaultIcon)
param.setResult(true);
"isBlurSupported",
new MethodHook() {
@Override
protected void before(MethodHookParam param) {
boolean isDefaultIcon = (boolean) XposedHelpers.callStaticMethod(
findClassIfExists("com.miui.home.launcher.DeviceConfig"),
"isDefaultIcon");
if (!isDefaultIcon)
param.setResult(true);
}
}
}
);

findAndHookMethod("com.miui.home.launcher.folder.LauncherFolder2x2IconContainer",
"resolveTopPadding", Rect.class, new MethodHook() {
try {
findAndHookMethod("com.miui.home.launcher.folder.LauncherFolder2x2IconContainer",
"resolveTopPadding", Rect.class, new MethodHook() {
@Override
protected void before(MethodHookParam param) {
// Rect rect = (Rect) param.args[0];
View view = (View) param.thisObject;
XposedHelpers.callMethod(view,
"setPadding", 0,
XposedHelpers.callMethod(param.thisObject,
"getMContainerPaddingTop"), 0, 0);
param.setResult(null);
}
}
);
} catch (Error | Exception ignore) {
findAndHookMethod("com.miui.home.launcher.DeviceConfig", "isUseDefaultIconFolder1x1", new MethodHook() {
@Override
protected void before(MethodHookParam param) {
// Rect rect = (Rect) param.args[0];
View view = (View) param.thisObject;
XposedHelpers.callMethod(view,
"setPadding", 0,
XposedHelpers.callMethod(param.thisObject,
"getMContainerPaddingTop"), 0, 0);
param.setResult(null);
protected void before(MethodHookParam param) throws Throwable {
param.setResult(true);
}
}
);
});

findAndHookMethod("com.miui.home.launcher.DeviceConfig", "isUseDefaultIconFolderLarge", new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
param.setResult(true);
}
});
}
}
}

0 comments on commit 6f3ff51

Please sign in to comment.