GithubHelp home page GithubHelp logo

cwithw / miuipadmeta Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 1.0 1.3 MB

为小米平板5系列恢复键盘Meta/Win键功能,同时禁用Alt-Tab快捷键

License: GNU General Public License v3.0

Kotlin 73.23% Java 26.77%

miuipadmeta's Introduction

MiuiPadMeta

为MIUI设备恢复键盘Meta/Win键功能(禁用掉小米的快捷键),同时禁用Alt-Tab快捷键。这样就可以在远程桌面里用Meta键和Alt-Tab了。适配小米平板5系列以及Android12+的MIUI手机。

Restore Meta/Win key function on MIUI devices(disable Xiaomi hotkeys), and disable Alt-Tab hotkey. Allows you to use Meta and Alt-Tab key in Remote Desktop。Adapted for Xiaomi Pad 5 Series and MIUI phones with Android12+.

系统版本支持情况 OS version support

系统版本 恢复Meta键 禁用Alt-Tab
MIUI12.5 Android11 ? * ?
MIUI13 Android11 √ **
MIUI13 Android12
MIUI14 Android13
MIUI15 HyperOS ? **** ? ***
非MIUI系统 N/A ? ***

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

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

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

*Android11上仅支持小米平板5系列,不支持MIUI手机

**MIUI for Pad Android11: PC模式下的快捷键依旧可用,PC模式的快捷键是另一套逻辑实现,请退出PC模式

***禁用Alt-Tab理论上在所有Android系统上支持。

**** 小米在HyperOS加强了对Bootloader权限的管控,我暂未将我的Xiaomi Pad 5 Pro设备更新到HyperOS,所以无法测试。

DisableAltTab 模块为独立出来的禁用Alt-Tab功能,适配所有Android设备。

在以下系统版本实机测试可以使用:

小米平板5Pro MIUI稳定版13.0.8.0 Android11

小米平板5Pro MIUI稳定版13.0.10 Android11

小米平板5Pro MIUI稳定版13.1.4.0 Android12

小米平板5Pro MIUI开发版14.0.23.1.9 Android13

红米K50 MIUI稳定版13.0.24 Android12

红米K50 MIUI稳定版14.0.4 Android13

鸣谢 Special thanks

本模块借鉴了 MiuiPadESC 的框架代码。

MiuiPadESC 配合此模块可以恢复ESC和禁用Win-D快捷键,实现远程桌面下全部键位可用

MaxMiPadInput MIUI14 下 MiuiPadESC失效 需要用这个模块恢复ESC

实现方法 Implementation detail

Android11

  1. com.android.server.policy.MiuiKeyShortcutManager.getEnableKsFeature固定返回false,MIUI的快捷键就不会使能 (或: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

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

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

Android12

  1. 同Android11 (但是这个类不在services.jar里在miui-services.jar里)

    (内部实现从setprop变成了settings put system is_custom_shortcut_effective 0)

  2. 存在com.android.server.policy.PhoneWindowManagerStubImpl.DELIVE_META_APPScom.android.server.policy.PhoneWindowManagerStubImpl.interceptKeyWithMeta()使用 但是这个函数P用没有

    所以和alt-tab的实现方法一样:直接hook com.android.server.policy.PhoneWindowManager.interceptKeyBeforeDispatching 如果有按下meta键就直接返回0不拦截 简单粗暴

  3. 同Android11

Android13

​ 同Android12 不需要单独适配

截图 Screenshot

Screenshot_2023-01-18-03-08-54-671_com.microsoft.rdc.androidx Screenshot_2023-01-18-03-09-31-674_com.microsoft.rdc.androidx

第三方开源引用 Open Source License

Apache License 2.0

KyuubiRan/EzXHelper

miuipadmeta's People

Stargazers

 avatar hipudding avatar  avatar  avatar  avatar  avatar  avatar LazuliKao avatar 耗子 avatar lichx avatar azazo1 avatar 黑域Blackyu avatar  avatar Xingjian Du avatar Moeta Chen avatar Xudong Chen avatar  avatar AuTsing avatar orange233 avatar  avatar  avatar Chisato22 avatar Srikant avatar 浩劫者12345 avatar kaysil avatar mayef avatar  avatar

Watchers

Chara White avatar

Forkers

cwx1568

miuipadmeta's Issues

Compatibility for mi pad 6 & android 13 & miui 14

I'm testing this module on the device, and it seems like the meta key is still functioning. I can still see the helper with shortcuts, and the shortcuts themselves work with meta+[key]. However, alt-tab no longer works, and that's great. Is there any need for adaptation on the Mi Pad 6 to disable the meta key as well?

请求恢复键盘F4功能,以使用Alt+F4

感谢作者提供的模块,该模块在联想平板国际版安卓13系统下很有效,但在使用远程过程中使用Alt+F4会回到安卓桌面,体验较差,望作者能够添加恢复键盘F4功能,谢谢。

组合键无法使用

Ctrl+c+v+x无法正常使用,烦请大佬修复一下,小米平板5PRO,
MIUI14.0.3

小米平板6S PRO兼容性反馈

环境:澎湃OS 1.0.7 KSU 11807 LSP 1.9.2(7058)

禁用Alt-Tab正常
恢复WIN键不生效

LSP 日志输出:

[ 2024-05-18T03:04:08.073     1000:  2808:  2808 I/LSPosed-Bridge  ] MiuiPadMeta: Using Android 12+ hooks.
[ 2024-05-18T03:04:08.075     1000:  2808:  2808 I/LSPosed-Bridge  ] MiuiPadMeta: MIUIHotkeyHooksAndroid12 failed!
[ 2024-05-18T03:04:08.075     1000:  2808:  2808 E/LSPosed-Bridge  ] java.lang.ClassNotFoundException: Didn't find class "com.android.server.policy.MiuiKeyShortcutManager" on path: DexPathList[[zip file "/system/framework/com.android.location.provider.jar", zip file "/system/framework/services.jar", zip file "/system_ext/framework/miui-services.jar", zip file "/system_ext/framework/apprecovery.proinstaller.jar", zip file "/apex/com.android.adservices/javalib/service-adservices.jar", zip file "/apex/com.android.adservices/javalib/service-sdksandbox.jar", zip file "/apex/com.android.appsearch/javalib/service-appsearch.jar", zip file "/apex/com.android.art/javalib/service-art.jar", zip file "/apex/com.android.configinfrastructure/javalib/service-configinfrastructure.jar", zip file "/apex/com.android.healthfitness/javalib/service-healthfitness.jar", zip file "/apex/com.android.media/javalib/service-media-s.jar", zip file "/apex/com.android.ondevicepersonalization/javalib/service-ondevicepersonalization.jar", zip file "/apex/com.android.permission/javalib/service-permission.jar", zip file "/apex/com.android.rkpd/javalib/service-rkp.jar", zip file "/system_ext/framework/miui-services.autoui.jar", zip file "/system_ext/framework/miui-services-pointer-pad.jar", zip file "/system_ext/framework/miuix.jar", zip file "/system_ext/framework/miui-embedding-window.jar"],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64, /system/lib64, /system_ext/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	at b.b.e(:5)
	at k.d.a(:2)
	at pub.chara.miuipadmeta.MainHook.a(Unknown Source:15)
	at pub.chara.miuipadmeta.MainHook.handleLoadPackage(:5)
	at Ae.n.h.XL.ybtHp.WnDuHU.IXposedHookLoadPackage$Wrapper.handleLoadPackage(Unknown Source:2)
	at Ae.n.h.XL.ybtHp.WnDuHU.callbacks.XC_LoadPackage.call(Unknown Source:6)
	at Ae.n.h.XL.ybtHp.WnDuHU.callbacks.XCallback.callAll(Unknown Source:26)
	at H0.a(Unknown Source:30)
	at java.lang.reflect.Method.invoke(Native Method)
	at J.callback(Unknown Source:123)
	at LSPHooker_.startBootstrapServices(Unknown Source:11)
	at com.android.server.SystemServer.run(SystemServer.java:1006)
	at com.android.server.SystemServer.main(SystemServer.java:724)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:991)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.