Skip to content

Commit

Permalink
Disable gesture recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
YifePlayte committed Dec 23, 2024
1 parent e59e244 commit 2c84dfd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<string name="change_browser_for_content_extension">修改传送门使用的浏览器</string>
<string name="change_browser_for_mi_ai">修改小爱同学使用的浏览器</string>
<string name="content_extension">传送门</string>
<string name="disable_gesture_recorder">禁用手势记录</string>
<string name="disable_safe_media_volume">禁用高媒体音量安全警告</string>
<string name="done">确定</string>
<string name="download_provider">下载管理程序</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<string name="change_browser_for_content_extension">Change browser for Taplus</string>
<string name="change_browser_for_mi_ai">Change browser for Mi Ai</string>
<string name="content_extension">Taplus</string>
<string name="disable_gesture_recorder">Disable gesture recorder</string>
<string name="disable_safe_media_volume">Disable safe media volume warnings</string>
<string name="done">OK</string>
<string name="download_provider">Downloads</string>
Expand Down

0 comments on commit 2c84dfd

Please sign in to comment.