Skip to content

Commit

Permalink
change version to 2.3
Browse files Browse the repository at this point in the history
fix alt-tab on non MIUI device on Android 11
  • Loading branch information
Chara White committed Jan 19, 2023
1 parent 37dd3be commit 42f32d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId = "pub.chara.miuipadmeta"
minSdk = 30
targetSdk = 32
versionCode = 5
versionName = "2.2"
versionCode = 6
versionName = "2.3"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ import de.robv.android.xposed.XposedBridge
object MIUIHotkeyHooksAndroid11 : BaseHook() {
override fun init() {
try {
// miui have a whitelist, only app in whitelist can receive meta key, else it is blocked
// force every package to be in whitelist
findField("com.android.server.policy.PhoneWindowManager"){
name == "sDeliveMetaKeyAppList"
}.set(null, MyFakeList())

//disable miui hotkeys
findMethod("com.android.server.policy.MiuiKeyShortcutManager") {
name == "getEnableKsFeature"
}.hookReturnConstant(false)
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid11 success!")


//disable alt-tab
//this works for any android version
findMethod("com.android.server.policy.PhoneWindowManager") {
Expand All @@ -34,6 +21,19 @@ object MIUIHotkeyHooksAndroid11 : BaseHook() {
}
}
}


// miui have a whitelist, only app in whitelist can receive meta key, else it is blocked
// force every package to be in whitelist
findField("com.android.server.policy.PhoneWindowManager"){
name == "sDeliveMetaKeyAppList"
}.set(null, MyFakeList())

//disable miui hotkeys
findMethod("com.android.server.policy.MiuiKeyShortcutManager") {
name == "getEnableKsFeature"
}.hookReturnConstant(false)
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid11 success!")
} catch (e: Throwable) {
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid11 failed!")
XposedBridge.log(e)
Expand Down

0 comments on commit 42f32d3

Please sign in to comment.