diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableBottomBar.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableBottomBar.kt index a3f15577c1..015f66c9fe 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableBottomBar.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableBottomBar.kt @@ -21,12 +21,16 @@ package com.sevtinge.hyperceiler.module.hook.systemui import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import com.sevtinge.hyperceiler.module.base.BaseHook +import com.sevtinge.hyperceiler.module.base.* +import com.sevtinge.hyperceiler.utils.devicesdk.* object DisableBottomBar : BaseHook() { override fun init() { - val clazzMiuiBaseWindowDecoration = + val clazzMiuiBaseWindowDecoration = if (isMoreAndroidVersion(35)) { + loadClass("com.android.wm.shell.multitasking.miuimultiwinswitch.miuiwindowdecor.MiuiBottomDecoration", lpparam.classLoader) + } else { loadClass("com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiBaseWindowDecoration", lpparam.classLoader) + } clazzMiuiBaseWindowDecoration.methodFinder().filterByName("createBottomCaption").first() .createHook { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableInfinitymodeGesture.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableInfinitymodeGesture.kt index 147176f700..55bd8be60a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableInfinitymodeGesture.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableInfinitymodeGesture.kt @@ -4,13 +4,16 @@ import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.* +import com.sevtinge.hyperceiler.utils.devicesdk.* object DisableInfinitymodeGesture : BaseHook() { override fun init() { - loadClass( - "com.android.wm.shell.miuifreeform.MiuiInfinityModeSizesPolicy", - ).methodFinder().filterByName("isForbiddenWindow").single().createHook { + if (isMoreAndroidVersion(35)) { + loadClass("com.android.wm.shell.multitasking.miuiinfinitymode.MiuiInfinityModeSizesPolicy", lpparam.classLoader) + } else { + loadClass("com.android.wm.shell.miuifreeform.MiuiInfinityModeSizesPolicy", lpparam.classLoader) + }.methodFinder().filterByName("isForbiddenWindow").single().createHook { returnConstant(true) } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableMiuiMultiWinSwitch.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableMiuiMultiWinSwitch.kt index e0bba8ea51..05d0a75b12 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableMiuiMultiWinSwitch.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/DisableMiuiMultiWinSwitch.kt @@ -21,17 +21,17 @@ package com.sevtinge.hyperceiler.module.hook.systemui import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import com.sevtinge.hyperceiler.module.base.BaseHook +import com.sevtinge.hyperceiler.module.base.* import com.sevtinge.hyperceiler.utils.devicesdk.* // by ljlvink object DisableMiuiMultiWinSwitch : BaseHook() { override fun init() { - loadClass( - if (isMoreAndroidVersion(35)) "com.android.wm.shell.multitasking.miuimultiwinswitch.miuiwindowdecor.MiuiDotView" - else "com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiDotView", - lpparam.classLoader - ).methodFinder() + if (isMoreAndroidVersion(35)) { + loadClass("com.android.wm.shell.multitasking.miuimultiwinswitch.miuiwindowdecor.MiuiDotView", lpparam.classLoader) + } else { + loadClass("com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiDotView", lpparam.classLoader) + }.methodFinder() .filterByName("onDraw") .single().createHook { returnConstant(null) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/RemoveMiuiMultiWinSwitch.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/RemoveMiuiMultiWinSwitch.kt index c3c243f612..3f47cac5f5 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/RemoveMiuiMultiWinSwitch.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/RemoveMiuiMultiWinSwitch.kt @@ -21,12 +21,17 @@ package com.sevtinge.hyperceiler.module.hook.systemui import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import com.sevtinge.hyperceiler.module.base.BaseHook +import com.sevtinge.hyperceiler.module.base.* +import com.sevtinge.hyperceiler.utils.devicesdk.* // by ljlvink object RemoveMiuiMultiWinSwitch : BaseHook() { override fun init() { - loadClass("com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiBaseWindowDecoration", lpparam.classLoader).methodFinder() + if (isMoreAndroidVersion(35)) { + loadClass("com.android.wm.shell.multitasking.miuimultiwinswitch.miuiwindowdecor.MiuiBaseWindowDecoration", lpparam.classLoader) + } else { + loadClass("com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiBaseWindowDecoration", lpparam.classLoader) + }.methodFinder() .filterByName("shouldHideCaption") .single().createHook { returnConstant(true)