Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7b68534
Refactor DisplayUtils to use Resources.getSystem()
Crypt0Beaver Dec 5, 2025
d8b5b9c
Fix device config class selection logic
Crypt0Beaver Dec 5, 2025
53d2f04
Refactor initOS3Hook for new device configuration
Crypt0Beaver Dec 5, 2025
9a9c4fe
Refactor initOS3Hook to use findClassIfExists
Crypt0Beaver Dec 5, 2025
b8f6dd5
Change initOS3Hook method from Kotlin to Java
Crypt0Beaver Dec 5, 2025
3e85c61
Comment out unused imports and methods in WorkspacePadding
Crypt0Beaver Dec 5, 2025
a550948
Refactor padding methods to use setDimensionPixelSizeFormPrefs
Crypt0Beaver Dec 5, 2025
3504d16
Refactor workspace padding calculations
Crypt0Beaver Dec 5, 2025
a61c932
Remove unnecessary float conversion for padding
Crypt0Beaver Dec 5, 2025
e451ae8
Refactor workspace padding calculations in LayoutRules
Crypt0Beaver Dec 5, 2025
d00a97a
Refactor workspace padding retrieval logic
Crypt0Beaver Dec 5, 2025
a3ef37f
Fix padding calculations in LayoutRules.kt
Crypt0Beaver Dec 5, 2025
99c23d5
Refactor padding retrieval for workspace layout
Crypt0Beaver Dec 5, 2025
e85b16a
Refactor layout rules for cell dimensions and padding
Crypt0Beaver Dec 5, 2025
98a0ca1
Use getAppContext() for display metrics access
Crypt0Beaver Dec 5, 2025
c320b6c
Use Resources.getSystem() for display metrics
Crypt0Beaver Dec 5, 2025
7b07e35
Refactor workspace top padding retrieval in LayoutRules
Crypt0Beaver Dec 5, 2025
fd27d25
Change mWorkspaceTopPadding to use getObjectFieldAs
Crypt0Beaver Dec 5, 2025
bda381d
Add screen height to layout rules logging
Crypt0Beaver Dec 5, 2025
1cccd2c
Fix calculation of currentCellHeight with padding hooks
Crypt0Beaver Dec 5, 2025
6d60ad6
Refactor dp2px methods to use app context
Crypt0Beaver Dec 6, 2025
65cf8ad
Fix logging in DisplayUtils for density retrieval
Crypt0Beaver Dec 6, 2025
1a2182e
Integrate AndroidLogUtils for error logging
Crypt0Beaver Dec 6, 2025
7031b4a
Fix calculation of currentCellHeight with padding
Crypt0Beaver Dec 6, 2025
ec10e4d
Add logging to dp2px method in DisplayUtils
Crypt0Beaver Dec 6, 2025
8d4cd0a
Fix logging format in DisplayUtils.java
Crypt0Beaver Dec 6, 2025
b616ee9
Add logging to dp2px method in DisplayUtils
Crypt0Beaver Dec 6, 2025
b283144
Replace AndroidLogUtils with XposedLogUtils
Crypt0Beaver Dec 6, 2025
60b3a81
Refactor workspace padding logic in LayoutRules
Crypt0Beaver Dec 6, 2025
c37e1a2
Refactor mWorkspaceTopPadding access method
Crypt0Beaver Dec 6, 2025
17161ef
Add error handling and logging to conversion methods
Crypt0Beaver Dec 6, 2025
24fab2b
Refactor logging of rules object in LayoutRules.kt
Crypt0Beaver Dec 6, 2025
58f329f
Add logging for setDimensionPixelSizeFormPrefs
Crypt0Beaver Dec 6, 2025
0b7e38c
Modify workspace padding methods to use preference values
Crypt0Beaver Dec 6, 2025
8f965ca
Fix padding methods call to return dip and not pix
Crypt0Beaver Dec 6, 2025
26c7859
Add preference handling for workspace padding dimensions
Crypt0Beaver Dec 7, 2025
a09fa3d
Refactor workspace padding to use a common MethodHook factory
Dec 7, 2025
e0b6f4a
Refactor UnlockBlurSupported to adapt to OS3 Launcher
Dec 7, 2025
133d22b
Refactor UnlockBlurSupported to adapt to OS3 Launcher
Dec 7, 2025
cc74e51
Code cleanup
Dec 7, 2025
634bd79
Code cleanup
Dec 7, 2025
54ba48f
Code cleanup
Dec 7, 2025
5b40278
Code cleanup
Dec 7, 2025
7cdcd2f
Fix CornerSlide Module exception
Dec 7, 2025
ccf93f3
Fix CornerSlide Module exception
Dec 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ abstract class HomeBaseHookNew : BaseHook() {
param.result = DisplayUtils.dp2px(
mPrefsMap.getInt(key, defaultValue).toFloat()
)
logD(TAG, lpparam.packageName, "Invoke setDimensionPixelSizeFormPrefs with $key, $defaultValue - result: ${param.result}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,41 @@
import android.graphics.Rect;
import android.view.View;

import com.sevtinge.hyperceiler.hook.module.base.BaseHook;
import com.sevtinge.hyperceiler.hook.module.base.pack.home.HomeBaseHookNew;

import de.robv.android.xposed.XposedHelpers;

public class UnlockBlurSupported extends BaseHook {
public class UnlockBlurSupported extends HomeBaseHookNew {

Class<?> mDeviceConfig;
String mBlurUtilitiesCls;
String mLauncherFolder2x2IconContainer;

@SuppressWarnings("unused")
@Version(isPad = false, min = 600000000)
private void initOS3Hook() {
mDeviceConfig = findClassIfExists(DEVICE_CONFIG_NEW);
mBlurUtilitiesCls = "com.miui.home.common.utils.BlurUtilities";
mLauncherFolder2x2IconContainer = "com.miui.home.folder.LauncherFolder2x2IconContainer";
initBaseCore();
}

@Override
public void init() throws NoSuchMethodException {
findAndHookMethod("com.miui.home.launcher.common.BlurUtilities",
public void initBase() {
mDeviceConfig = findClassIfExists(DEVICE_CONFIG_OLD);
mBlurUtilitiesCls = "com.miui.home.launcher.common.BlurUtilities";
mLauncherFolder2x2IconContainer = "com.miui.home.launcher.folder.LauncherFolder2x2IconContainer";
initBaseCore();
}

private void initBaseCore() {
findAndHookMethod(mBlurUtilitiesCls,
"isBlurSupported",
new MethodHook() {
@Override
protected void before(MethodHookParam param) {
boolean isDefaultIcon = (boolean) XposedHelpers.callStaticMethod(
findClassIfExists("com.miui.home.launcher.DeviceConfig"),
mDeviceConfig,
"isDefaultIcon");
if (!isDefaultIcon)
param.setResult(true);
Expand All @@ -43,7 +64,7 @@ protected void before(MethodHookParam param) {
);

try {
findAndHookMethod("com.miui.home.launcher.folder.LauncherFolder2x2IconContainer",
findAndHookMethod(mLauncherFolder2x2IconContainer,
"resolveTopPadding", Rect.class, new MethodHook() {
@Override
protected void before(MethodHookParam param) {
Expand All @@ -58,16 +79,16 @@ protected void before(MethodHookParam param) {
}
);
} catch (Error | Exception ignore) {
findAndHookMethod("com.miui.home.launcher.DeviceConfig", "isUseDefaultIconFolder1x1", new MethodHook() {
findAndHookMethod(mDeviceConfig, "isUseDefaultIconFolder1x1", new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
protected void before(MethodHookParam param) {
param.setResult(true);
}
});

findAndHookMethod("com.miui.home.launcher.DeviceConfig", "isUseDefaultIconFolderLarge", new MethodHook() {
findAndHookMethod(mDeviceConfig, "isUseDefaultIconFolderLarge", new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
protected void before(MethodHookParam param) {
param.setResult(true);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,37 @@
import android.os.Bundle;
import android.view.MotionEvent;

import com.sevtinge.hyperceiler.hook.module.base.BaseHook;
import com.sevtinge.hyperceiler.hook.module.base.pack.home.HomeBaseHookNew;
import com.sevtinge.hyperceiler.hook.module.skip.GlobalActions;

import de.robv.android.xposed.XposedHelpers;

public class CornerSlide extends BaseHook {
public class CornerSlide extends HomeBaseHookNew {
public int inDirection = 0;

private Class<?> canTriggerAssistantActionParam3;

Context mContext;

@SuppressWarnings("unused")
@Version(isPad = false, min = 600000000)
private void initOS3Hook() {
canTriggerAssistantActionParam3 = long.class;
initBaseCore();
}

@Override
public void init() throws NoSuchMethodException {
public void initBase() {
canTriggerAssistantActionParam3 = int.class;
initBaseCore();
}
public void initBaseCore() {
findAndHookMethod("com.android.systemui.shared.recents.system.AssistManager",
"isSupportGoogleAssist", int.class,
MethodHook.returnConstant(true));
Class<?> FsGestureAssistHelper = findClassIfExists("com.miui.home.recents.FsGestureAssistHelper");
findAndHookMethod(FsGestureAssistHelper, "canTriggerAssistantAction",
float.class, float.class, int.class,
float.class, float.class, canTriggerAssistantActionParam3,
new MethodHook() {
@Override
protected void before(MethodHookParam param) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder.`-Static`.methodFi
import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createAfterHook
import kotlin.math.max

private const val M_WORKSPACE_TOP_PADDING = "mWorkspaceTopPadding"

private const val GET_VALUE = "getValue"

object LayoutRules : HomeBaseHookNew() {
private const val PHONE_RULES = "com.miui.home.launcher.compat.PhoneDeviceRules"
private const val PHONE_RULES_NEW = "com.miui.home.common.gridconfig.PhoneDeviceRules"
Expand All @@ -59,6 +63,7 @@ object LayoutRules : HomeBaseHookNew() {
private var currentCellWidth = 0
private var currentCellHeight = 0

@Suppress("unused")
@Version(isPad = false, min = 600000000)
private fun isOS3Hook() {
if (isUnlockGridsHook) {
Expand Down Expand Up @@ -218,45 +223,42 @@ object LayoutRules : HomeBaseHookNew() {
override fun after(param: MethodHookParam) {
val rules = param.thisObject

val maxGridWidth = rules.getIntField("mScreenWidth")
// logD(
// TAG,
// lpparam.packageName,
// "rules object: $rules Class fields: ${rules.javaClass.declaredFields.joinToString()}"
// )

val mScreenWidth = rules.getIntField("mScreenWidth")
val mScreenHeight = rules.getIntField("mScreenHeight")
val mCellWidth = rules.getIntField("mCellWidth")
val mCellHeight = rules.getIntField("mCellHeight")
val mWorkspaceCellSideDefault = rules.getIntField("mWorkspaceCellSideDefault")
val mCellCountY = rules.getIntField("mCellCountY")
val mWorkspaceTopPadding = rules.callMethodAs<Int>("getWorkspacePaddingTop")
val mWorkspaceTopPadding =
rules.getObjectFieldAs<Any>(M_WORKSPACE_TOP_PADDING)
.callMethodAs<Int>(GET_VALUE)
val mWorkspaceCellPaddingBottom =
rules.getObjectFieldAs<Any>("mWorkspaceCellPaddingBottom")
.callMethodAs<Int>("getValue")
.callMethodAs<Int>(GET_VALUE)

val sWorkspacePaddingTop = if (isSetWSPaddingTopHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_top",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_top", 0))
} else {
-1
}

val sWorkspacePaddingBottom = if (isSetWSPaddingBottomHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_bottom",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_bottom", 0))
} else {
-1
}

val sWorkspaceCellSide = if (isSetWSPaddingSideHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_horizontal",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_horizontal", 0))
} else {
-1
}
Expand All @@ -275,34 +277,35 @@ object LayoutRules : HomeBaseHookNew() {
currentCellWidth = mCellWidth
currentCellHeight = mCellHeight

val cellWorkspaceHeight = mCellWidth * mCellCountY
//val cellWorkspaceHeight = mCellHeight * mCellCountY

if (isUnlockGridsHook || isSetWSPaddingSideHook) {
currentCellWidth = (maxGridWidth - if (isSetWSPaddingSideHook) {
currentCellWidth = (mScreenWidth - if (isSetWSPaddingSideHook) {
sWorkspaceCellSide
} else {
mWorkspaceCellSideDefault
}) / currentCellCountX
}

if (isUnlockGridsHook || isSetWSPaddingTopHook || isSetWSPaddingBottomHook) {
currentCellHeight = (cellWorkspaceHeight + if (isSetWSPaddingTopHook) {
mWorkspaceTopPadding - sWorkspacePaddingTop
currentCellHeight = (mScreenHeight - if (isSetWSPaddingTopHook) {
sWorkspacePaddingTop
} else {
0
} + if (isSetWSPaddingBottomHook) {
mWorkspaceCellPaddingBottom - sWorkspacePaddingBottom
} - if (isSetWSPaddingBottomHook) {
sWorkspacePaddingBottom
} else {
0
}) / currentCellCountY
}

val cellSize = max(currentCellWidth, currentCellHeight)
rules.setIntField("mCellWidth", cellSize)
rules.setIntField("mCellHeight", cellSize)
//val cellSize = max(currentCellWidth, currentCellHeight)
rules.setIntField("mCellWidth", currentCellWidth)
rules.setIntField("mCellHeight", currentCellHeight)

if (isSetWSPaddingTopHook) {
rules.getObjectFieldAs<Any>("mWorkspaceTopPadding")
//rules.setIntField("mWorkspaceTopPadding", sWorkspacePaddingTop)
rules.getObjectFieldAs<Any>(M_WORKSPACE_TOP_PADDING)
.callMethod("setValue", sWorkspacePaddingTop)
}

Expand All @@ -314,22 +317,23 @@ object LayoutRules : HomeBaseHookNew() {
if (isSetWSPaddingSideHook) {
rules.setIntField(
"mWorkspaceCellSide",
(mCellWidth - currentCellWidth * currentCellCountX) / 2
(mScreenWidth - currentCellWidth * currentCellCountX) / 2
)
}

logI(
TAG, lpparam.packageName,
""" |
|Applied layout rules:
|Applied layout rules (new Hook):
| cellCountX => $currentCellCountX
| cellCountY => $currentCellCountY
| paddingTop => $sWorkspacePaddingTop
| paddingBottom => $sWorkspacePaddingBottom
| paddingTop => $sWorkspacePaddingTop (was: $mWorkspaceTopPadding)
| paddingBottom => $sWorkspacePaddingBottom (was: $mWorkspaceCellPaddingBottom)
| cellSide => $sWorkspaceCellSide
| cellSizeO => $mCellWidth
| cellWidth => $currentCellWidth
| cellHeight => $currentCellHeight
| Screen HxW => $mScreenHeight x $mScreenWidth
""".trimMargin()
)
}
Expand All @@ -343,40 +347,30 @@ object LayoutRules : HomeBaseHookNew() {
val mWorkspaceCellSideDefault = rules.getIntField("mWorkspaceCellSideDefault")
val mCellSize = rules.getIntField("mCellSize")
val mCellCountY = rules.getIntField("mCellCountY")
val mWorkspaceTopPadding = rules.callMethodAs<Int>("getWorkspacePaddingTop")
val mWorkspaceTopPadding =
rules.getObjectFieldAs<Any>(M_WORKSPACE_TOP_PADDING)
.callMethodAs<Int>(GET_VALUE)
val mWorkspaceCellPaddingBottom =
rules.getObjectFieldAs<Any>("mWorkspaceCellPaddingBottom")
.callMethodAs<Int>("getValue")
.callMethodAs<Int>(GET_VALUE)

val sWorkspacePaddingTop = if (isSetWSPaddingTopHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_top",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_top", 0))
} else {
-1
}

val sWorkspacePaddingBottom = if (isSetWSPaddingBottomHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_bottom",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_bottom", 0))
} else {
-1
}

val sWorkspaceCellSide = if (isSetWSPaddingSideHook) {
DisplayUtils.dp2px(
mPrefsMap.getInt(
"home_layout_workspace_padding_horizontal",
0
).toFloat()
)
mPrefsMap.getInt("home_layout_workspace_padding_horizontal", 0))
} else {
-1
}
Expand Down Expand Up @@ -420,7 +414,7 @@ object LayoutRules : HomeBaseHookNew() {
rules.setIntField("mCellSize", max(currentCellWidth, currentCellHeight))

if (isSetWSPaddingTopHook) {
rules.getObjectFieldAs<Any>("mWorkspaceTopPadding")
rules.getObjectFieldAs<Any>(M_WORKSPACE_TOP_PADDING)
.callMethod("setValue", sWorkspacePaddingTop)
}

Expand All @@ -442,7 +436,7 @@ object LayoutRules : HomeBaseHookNew() {
|Applied layout rules:
| cellCountX => $currentCellCountX
| cellCountY => $currentCellCountY
| paddingTop => $sWorkspacePaddingTop
| paddingTop => $sWorkspacePaddingTop (was: $mWorkspaceTopPadding)
| paddingBottom => $sWorkspacePaddingBottom
| cellSide => $sWorkspaceCellSide
| cellSizeO => $mCellSize
Expand Down
Loading