-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
should support android 12 and android 13
- Loading branch information
Chara White
committed
Jan 19, 2023
1 parent
9412bda
commit ea5ba69
Showing
6 changed files
with
117 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/pub/chara/miuipadmeta/hook/MIUIHotkeyHooksAndroid12.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package pub.chara.miuipadmeta.hook | ||
|
||
import com.github.kyuubiran.ezxhelper.utils.* | ||
import pub.chara.miuipadmeta.MyFakeList | ||
import de.robv.android.xposed.XposedBridge | ||
|
||
object MIUIHotkeyHooksAndroid12 : 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 | ||
findMethod("com.android.server.policy.PhoneWindowManagerStubImpl") { | ||
name == "interceptKeyWithMeta" | ||
}.hookReturnConstant(false) | ||
|
||
//disable miui hotkeys | ||
findMethod("com.android.server.policy.MiuiKeyShortcutManager") { | ||
name == "getEnableKsFeature" | ||
}.hookReturnConstant(false) | ||
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid12 success!") | ||
} catch (e: Throwable) { | ||
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid12 failed!") | ||
XposedBridge.log(e) | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
app/src/main/java/pub/chara/miuipadmeta/hook/MIUIHotkeyHooksAndroid13.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package pub.chara.miuipadmeta.hook | ||
|
||
import com.github.kyuubiran.ezxhelper.utils.* | ||
import pub.chara.miuipadmeta.MyFakeList | ||
import de.robv.android.xposed.XposedBridge | ||
|
||
// currently we are same as Android 12 | ||
object MIUIHotkeyHooksAndroid13 : 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 | ||
findMethod("com.android.server.policy.PhoneWindowManagerStubImpl") { | ||
name == "interceptKeyWithMeta" | ||
}.hookReturnConstant(false) | ||
|
||
//disable miui hotkeys | ||
findMethod("com.android.server.policy.MiuiKeyShortcutManager") { | ||
name == "getEnableKsFeature" | ||
}.hookReturnConstant(false) | ||
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid13 success!") | ||
} catch (e: Throwable) { | ||
XposedBridge.log("MiuiPadMeta: MIUIHotkeyHooksAndroid13 failed!") | ||
XposedBridge.log(e) | ||
} | ||
} | ||
} |