An LSPosed module built with libxposed API 102 that enables the HyperOS keyboard bottom bar for third-party input methods, including Gboard and WeChat Keyboard. It provides keyboard switching and access to the system clipboard, removes duplicate bottom spacing, and matches the bar color to the keyboard.
The module requires Android 14 or later, a Chinese HyperOS ROM with Xiaomi's keyboard bottom bar implementation, and an LSPosed framework supporting API 102. It operates in the selected keyboard processes, uses com.miui.phrase for clipboard access, and uses system server for keyboard list visibility. It has no standalone UI.
Install JDK 17 or later, Android SDK Platform 35, and Android SDK Build Tools 35.0.0. Set JAVA_HOME to your JDK and configure the SDK path through ANDROID_HOME or sdk.dir in local.properties.
From the repository root, build a debug APK on Windows:
./gradlew.bat :app:assembleDebugOn Linux or macOS:
./gradlew :app:assembleDebugThe debug APK is written to app/build/outputs/apk/debug/app-debug.apk.
To run unit tests and Android Lint:
./gradlew.bat :app:testDebugUnitTest :app:lintDebugTo build a release APK:
./gradlew.bat :app:assembleReleaseUse ./gradlew instead of ./gradlew.bat on Linux or macOS. The release APK is written to app/build/outputs/apk/release/app-release-unsigned.apk. Sign it with your own key using the Android SDK's apksigner before installation. Reuse the same signing key for subsequent updates.
- Bottom bar support: Hooks
InputMethodServiceInjectorin selected third-party keyboard processes to allow HyperOS keyboard support checks. AfterInputMethodModuleManager.loadDex(), it also hooks the dynamically loadedInputMethodBottomManager. System checks for gesture navigation, the optimization setting, orientation, floating mode, and device posture remain in effect. - Bar overlay and window insets: While the system bottom bar is visible, it is laid over the bottom of the keyboard with a negative top margin, and the keyboard's bottom navigation bar inset is replaced with the bar height. The keyboard pads its keys above the bar and draws its own background underneath it. Other insets and the bottom bar's own inset reads are preserved. The margin and normal insets are restored when the bar is hidden.
- Keyboard switching and buttons: Uses Android's enabled input method list instead of Xiaomi's filtered list. In system server, the current keyboard may see and switch to other enabled keyboards that package visibility would otherwise hide, such as Gboard from WeChat Keyboard; this requires the
system(System Framework) scope and a reboot. Unsupported vendor-specific button actions fall back to keyboard switching on the left and the clipboard on the right, without changing global settings. Stock Xiaomi keyboards only receive the switching-list adjustment. - Color matching: The bar background is transparent, so the keyboard's own background, gradients, and panels show through without color guessing. Icon contrast is chosen by sampling a one-pixel-high row just inside the bar at the icon columns, reduced to 24 pixels in memory. Sampling is limited to once every 750 ms; no images are saved, and the keyboard window's navigation bar appearance is left unchanged.
- Clipboard access: Registers each selected keyboard process with
com.miui.phraseusing a Binder token. Read checks forqueryandgetTyperequire a registered caller whose UID, package, and input method service match the current default keyboard. Registrations expire when the process dies. Write and signature checks remain unchanged, and the module does not log typed text or clipboard contents. - Hot reload: Uses API 102 lifecycle callbacks to remove old listeners, replace hooks, and transfer active keyboard sessions and clipboard registrations when the framework supports module updates without restarting target processes. Unsafe state handoffs are rejected.