Skip to content

Commit

Permalink
修复 系统界面-其他-禁用快捷窗口按钮/禁用无极缩放手势/隐藏小窗手势提示线 在 HyperOS2 不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Nov 8, 2024
1 parent 0a451fb commit 30f6dd1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 30f6dd1

Please sign in to comment.