$ show senzhk/ADBKeyBoard
ADBKeyBoard is an Android virtual keyboard (InputMethodService) designed to receive text input and key events via system broadcast intents sent from ADB. It overcomes the limitation of `adb shell input text` which cannot handle Unicode characters. The app listens for intents like ADB_INPUT_TEXT, ADB_INPUT_B64 (base64-encoded text), ADB_INPUT_CODE (keyevent), ADB_EDITOR_CODE (editor actions), ADB_INPUT_CHARS (Unicode codepoints), ADB_CLEAR_TEXT, and direct IME actions (SEARCH, GO, DONE, NEXT, SEND). The single Java source file (AdbIME.java) implements the entire logic: registering a BroadcastReceiver, parsing intent extras, and using InputConnection to inject text or keys into the current input field. The code is straightforward and minimal, with no external libraries beyond the Android SDK. It has been widely used for device automation and testing (nearly 2000 stars). However, the codebase is monolithic, lacks tests, and shows signs of gradual maintenance (e.g., Android 13 compatibility fixes, but still targets older API levels). It is not designed for reuse outside of Android, but the broadcast-receiver-command pattern is clean and could serve as a reference for similar automation keyboards.
The LLM identified 1 files worth highlighting for reuse:
This is the sole Java source file implementing the entire ADBKeyboard app. It extends InputMethodService and registers a BroadcastReceiver that handles multiple intent actions (ADB_INPUT_TEXT, ADB_INPUT_B64, ADB_INPUT_CHARS, ADB_INPUT_CODE, ADB_EDITOR_CODE, ADB_CLEAR_TEXT, and IME action shortcuts). Each action is processed independently, extracting relevant data (text, base64, key codes, editor codes, Unicode char arrays, or meta key combinations) and using InputConnection to commit text or send key events. The code also handles Android 13+ broadcast receiver export flags. While the component is tightly coupled to the Android framework and not directly reusable outside Android, it demonstrates a clean, self-contained pattern for building a remote-controllable input method service. The meta key handling (plus-delimited multi-meta) and clear text fallback logic show some non-trivial engineering.