Skip to content

Commit

Permalink
update info
Browse files Browse the repository at this point in the history
  • Loading branch information
Chara White committed Jan 19, 2023
1 parent f3013ee commit 9412bda
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
local.properties
/app/release
/key
/gitrepo
*.jar.cache
*.apk.cache
/developmentData
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
# MiuiPadMeta

为小米平板5系列恢复键盘Meta/Win键功能,同时禁用Alt-Tab快捷键,仅测试基于Android11的MIUI,不保证Android12可以运行
为小米平板5系列恢复键盘Meta/Win键功能,同时禁用Alt-Tab快捷键,目前支持Android11 MIUI,其他 Android 版本仅支持禁用Alt-Tab

Restore Meta/Win key function on Mi Pad 5 series, and disable Alt-Tab hotkey, only tested Android11 MIUI, no promise Android12 will work
Restore Meta/Win key function on Mi Pad 5 series, and disable Alt-Tab hotkey, currently supported Android11 MIUI, only disable Alt-Tab hotkey is supported on other Android versions



PC模式下的快捷键依旧可用,PC模式的快捷键是另一套逻辑实现

![Screenshot_2023-01-18-03-08-54-671_com.microsoft.rdc.androidx](README.assets/Screenshot_2023-01-18-03-08-54-671_com.microsoft.rdc.androidx.jpg)

![Screenshot_2023-01-18-03-09-31-674_com.microsoft.rdc.androidx](README.assets/Screenshot_2023-01-18-03-09-31-674_com.microsoft.rdc.androidx.jpg)

### 系统版本支持情况 OS version support

| 系统版本 | 恢复Meta键 | 禁用Alt-Tab |
| ---------------- | ---------- | ----------- |
| MIUI12 Android11 | ? | ? |
| MIUI13 Android11 |||
| MIUI13 Android12 | ? | ? |
| MIUI14 Android13 | × ||
| 非MIUI系统 | N/A | ? * |

√ 表示经过测试,目前支持

?表示没有经过测试,可能支持

×表示经过测试,目前不支持

> *禁用Alt-Tab理论上在所有Android系统上支持。
### 鸣谢 Special thanks

[MiuiPadESC](https://github.com/YifePlayte/MiuiPadESC) 配合此模块可以恢复ESC和禁用Win-D快捷键,实现远程桌面下全部键位可用



### 实现方法 Implementation detail

#### Android11

1.`com.android.server.policy.MiuiKeyShortcutManager.getEnableKsFeature`固定返回false,MIUI的快捷键就不会使能
(或:`setprop persist.sys.enable_custom_shortcut_user 0`
(或:`setprop persist.sys.enable_custom_shortcut_user 0`

实现方法:hook `com.android.server.policy.MiuiKeyShortcutManager.getEnableKsFeature` 固定返回false

2.`com.android.server.policy.PhoneWindowManager.interceptKeyBeforeDispatching` 不拦截meta key 就是包名为com.ss.android.lark.kami时的效果(MIUI给自家app开后门,只有自家app运行时不拦截meta key 其他app都拦截)

实现方法:自定义类重写List的contains方法 替换掉`static List<String> sDeliveMetaKeyAppList`
实现方法:自定义类重写List的contains方法 替换掉`static List<String> sDeliveMetaKeyAppList`

3. 修改逻辑禁用安卓自带的alt-tab

实现方法:hook `com.android.server.policy.PhoneWindowManager.interceptKeyBeforeDispatching` 如果是Alt-Tab则不继续运行
实现方法:hook `com.android.server.policy.PhoneWindowManager.interceptKeyBeforeDispatching` 如果是Alt-Tab则不继续运行



### 鸣谢 Special thanks
### 截图 Screenshot

[MiuiPadESC](https://github.com/YifePlayte/MiuiPadESC) 配合此模块可以恢复ESC和禁用Win-D快捷键,实现远程桌面下全部键位可用
![Screenshot_2023-01-18-03-08-54-671_com.microsoft.rdc.androidx](README.assets/Screenshot_2023-01-18-03-08-54-671_com.microsoft.rdc.androidx-16741303149715-16741304903162.jpg)
![Screenshot_2023-01-18-03-09-31-674_com.microsoft.rdc.androidx](README.assets/Screenshot_2023-01-18-03-09-31-674_com.microsoft.rdc.androidx.jpg)

0 comments on commit 9412bda

Please sign in to comment.