diff --git a/app/src/main/java/com/yifeplayte/wommo/activity/pages/MainPage.kt b/app/src/main/java/com/yifeplayte/wommo/activity/pages/MainPage.kt index 71687ab..00bb44c 100644 --- a/app/src/main/java/com/yifeplayte/wommo/activity/pages/MainPage.kt +++ b/app/src/main/java/com/yifeplayte/wommo/activity/pages/MainPage.kt @@ -88,6 +88,11 @@ class MainPage : BasePage() { textId = R.string.hide_mobile_signal_icon ), SwitchV("hide_mobile_signal_icon", false) ) + TextSummaryWithSwitch( + TextSummaryV( + textId = R.string.disable_gesture_recorder + ), SwitchV("disable_gesture_recorder", false) + ) Line() TitleText(textId = R.string.miui_home) TextSummaryWithSwitch( diff --git a/app/src/main/java/com/yifeplayte/wommo/hook/hooks/singlepackage/systemui/DisableGestureRecorder.kt b/app/src/main/java/com/yifeplayte/wommo/hook/hooks/singlepackage/systemui/DisableGestureRecorder.kt new file mode 100644 index 0000000..0f79b81 --- /dev/null +++ b/app/src/main/java/com/yifeplayte/wommo/hook/hooks/singlepackage/systemui/DisableGestureRecorder.kt @@ -0,0 +1,24 @@ +package com.yifeplayte.wommo.hook.hooks.singlepackage.systemui + +import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook +import com.github.kyuubiran.ezxhelper.ObjectUtils.getObjectOrNullUntilSuperclass +import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder +import com.yifeplayte.wommo.hook.hooks.BaseHook +import java.util.LinkedList + +@Suppress("unused") +object DisableGestureRecorder : BaseHook() { + override val key = "disable_gesture_recorder" + override fun hook() { + loadClass("com.android.systemui.statusbar.GestureRecorder").methodFinder() + .filterByName("save").filterNonAbstract().single().createHook { + before { + val mGestures = + getObjectOrNullUntilSuperclass(it.thisObject, "mGestures") as LinkedList<*>? + mGestures?.clear() + it.result = null + } + } + } +} \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 850b3af..57c85cd 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -17,6 +17,7 @@ 修改传送门使用的浏览器 修改小爱同学使用的浏览器 传送门 + 禁用手势记录 禁用高媒体音量安全警告 确定 下载管理程序 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b744b02..9a8ec77 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,6 +19,7 @@ Change browser for Taplus Change browser for Mi Ai Taplus + Disable gesture recorder Disable safe media volume warnings OK Downloads