How f4dl0/keydroid works
Purpose and Runtime
KeyDroid is an Android application described as an Android keylogger with reverse-shell capability. It targets Android 6.0+ and is built as a Gradle Android project. Its runtime is primarily Android framework services rather than a conventional foreground web or desktop application.
Relevant paths: app/app/build.gradle, app/app/src/main/AndroidManifest.xml, app/settings.gradle
Application Entry and Registration
Android component registration is controlled by the manifest. The project’s visible UI and keyboard/input-method integration are backed by Java components and XML declarations. The input method must be enabled/selected through Android’s system keyboard settings before it can receive text-entry events.
Relevant paths: app/app/src/main/AndroidManifest.xml, app/app/src/main/res/xml/method.xml, app/app/src/main/java/com/keydroid/SimpleIME.java
Input Capture Stage
SimpleIME is the central input-method component. It implements the custom keyboard experience, receives key interactions through Android’s IME lifecycle, and connects input events to the application’s logging/control behavior. Keyboard layouts and key appearance are resource-driven rather than hard-coded entirely in Java.
Relevant paths: app/app/src/main/java/com/keydroid/SimpleIME.java, app/app/src/main/res/layout/keyboard.xml, app/app/src/main/res/xml/qwerty.xml
Background Execution and Command Channel
BackService is the long-running background-service boundary. Based on the repository description, it is responsible for behavior outside the keyboard UI, including the reverse-shell/control capability and likely delivery or handling of captured information. This creates the principal separation between Android UI/IME execution and background network or command processing.
Relevant paths: app/app/src/main/java/com/keydroid/BackService.java, app/app/src/main/AndroidManifest.xml
User Interface and Keyboard Presentation
The application provides an activity layout plus custom keyboard and preview resources. These resources define the user-facing configuration/presentation layer and the IME’s rendered keyboard surfaces. Device-density and large-screen resource variants support Android display adaptation.
Relevant paths: app/app/src/main/res/layout/activity_main.xml, app/app/src/main/res/layout/keyback.xml, app/app/src/main/res/layout/preview.xml
Data/Control Flow
The primary flow is: Android activates the registered input method → SimpleIME renders XML-defined keyboard layouts and receives input → captured input/control events are passed into background behavior → BackService handles non-UI processing and external communication. Android permissions, component declarations, and IME metadata are the critical platform boundaries governing whether each stage can run.
Relevant paths: app/app/src/main/java/com/keydroid/SimpleIME.java, app/app/src/main/java/com/keydroid/BackService.java, app/app/src/main/res/xml/method.xml
Build, Packaging, and External Dependencies
The Android module is under app/app; Gradle wrapper files support reproducible local builds. Bundled JARs include JavaMail and activation libraries, indicating SMTP/email-related capability may be part of external data transfer or notification behavior. A signing keystore is present for APK signing.
Relevant paths: app/app/libs/mail.jar, app/app/libs/activation.jar, app/key.keystore
Main entry points: SimpleIME.java SimpleIME · AndroidManifest.xml Component manifest · build.gradle Android Gradle module · BackService.java BackService
Components 14
Build & packaging
- Android Gradle module
app/app/build.gradle - APK signing key
app/key.keystore - JavaMail library
app/app/libs/mail.jar - Activation library
app/app/libs/activation.jar
Android runtime
- Component manifest · Declares permissions, activity, IME, and background service.
app/app/src/main/AndroidManifest.xml - Android system · Activates registered components subject to system settings and permissions.
- Keyboard settings · The user must enable and select the custom input method.
- IME metadata
app/app/src/main/res/xml/method.xml - SimpleIME · Receives keyboard events and links capture to background behavior.
app/app/src/main/java/com/keydroid/SimpleIME.java - Keyboard layout
app/app/src/main/res/layout/keyboard.xml - QWERTY key map
app/app/src/main/res/xml/qwerty.xml - Application UI · Configuration and keyboard presentation layouts.
app/app/src/main/res/layout/activity_main.xml - BackService · Handles non-UI processing, control, and external communication.
app/app/src/main/java/com/keydroid/BackService.java
External channel
- Remote control / delivery · Receives service communications or commands.
Connections 16
- Android Gradle module → Component manifest: packages
- Android Gradle module → JavaMail library: bundles
- Android Gradle module → Activation library: bundles
- APK signing key → Android Gradle module: signs
- Component manifest → SimpleIME: registers
- Component manifest → BackService: registers
- Component manifest → IME metadata: references
- Android system → Component manifest: reads declarations
- Keyboard settings → Android system: selects IME
- Android system → SimpleIME: activates
- SimpleIME → Keyboard layout: renders
- SimpleIME → QWERTY key map: uses
- SimpleIME → BackService: passes input / control
- Application UI → SimpleIME: presents configuration
- BackService → JavaMail library: may use delivery support
- BackService → Remote control / delivery: communicates