From 30f6dd126ec5cc833be4352558f7ebbc34130967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=83=E6=9F=92=E6=9F=92?= Date: Sat, 9 Nov 2024 00:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=95=8C=E9=9D=A2-=E5=85=B6=E4=BB=96-=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E7=AA=97=E5=8F=A3=E6=8C=89=E9=92=AE/?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=97=A0=E6=9E=81=E7=BC=A9=E6=94=BE=E6=89=8B?= =?UTF-8?q?=E5=8A=BF/=E9=9A=90=E8=97=8F=E5=B0=8F=E7=AA=97=E6=89=8B?= =?UTF-8?q?=E5=8A=BF=E6=8F=90=E7=A4=BA=E7=BA=BF=20=E5=9C=A8=20HyperOS2=20?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/hook/systemui/DisableBottomBar.kt | 8 ++++++-- .../hook/systemui/DisableInfinitymodeGesture.kt | 9 ++++++--- .../hook/systemui/DisableMiuiMultiWinSwitch.kt | 12 ++++++------ .../module/hook/systemui/RemoveMiuiMultiWinSwitch.kt | 9 +++++++-- 4 files changed, 25 insertions(+), 13 deletions(-) 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)