Skip to content

Android app that turns your phone into a keyboard and mouse without requiring any software on the other end. Supports scripting and script files. (Requires root)

License

Notifications You must be signed in to change notification settings

saaiqSAS/android-hid-client_saaiqSAS-Fork

 
 

Repository files navigation

Contributors Forks Stargazers Issues GPL-3.0 License
IzzyOnDroid Repo Version


App Icon

USB HID Client

Android app that allows you to easily use your phone as a keyboard and mouse

Report Bug · Request Feature

Table of Contents
  1. Fork Updates
  2. About The Project
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Acknowledgments

Fork Updates

This project is originally forked from v3.0.1 of the Arian04/android-hid-client.

Latest App Release for this fork: v3.0.1_saaiqsas_8


The following updates have been made in this fork:

  • Scripting Support: Added scripting functionality for enhanced automation and control.

  • Script File Support: Added support for plaintext script files with the extensions .ahc, .duck, and .txt.

  • Additional Script Features: Including the ability to Save, Edit scripts.

  • Special/Modifier Key Support for Manual Input: Introduced {[X]} tag format to allow special or modifier keys to be passed in Manual Input mode.

  • Manual Input Visibility Toggle: Added a toggle to change visibility in Manual Input (Issue #51, by weiluntong).

  • Updated Help Page: Revised the help page to provide details on the newly added features.

  • Updated About Page: Updated the About page to show the developer, contributors, license, and app version.

  • Major UI Improvements: Mainpage layout arrangement changed, multiple pages made scrollable.


Note: Details on scripting and the {[X]} tag format will be provided in the Help page of the app. Furthermore, the screenshots in this fork (under "About The Project") are updated to show the latest app version of this fork


Example 1: To open notepad in Windows using Scripting

// This is a comment
WIN
SEND r
SLEEP 1000
SEND notepad
ENTER
REM This is a comment
META
STRING r
DELAY 1000
STRINGLN notepad

Multiple command/key variations are available for a single function or key. The above scripts can be either executed from a script file or directly from Manual Input with the corresponding Execute button.


Example 2: To open notepad in Windows using {[X]} tag with Manual Input

{[M]}r{[ ]}{[ ]}notepad{[N]}

This string should be send via the Send button in Manual Input.



About The Project

Main screen Main screen Main screen Main screen

This Android app allows you your phone to present itself to a connected device as a keyboard and mouse. Since this happens at a very low level, the connected device sees it exactly as a normal keyboard and mouse, meaning you don't need to install any software on the connected computer! For this reason, it will even work if the connected device is in its BIOS/UEFI. Even multimedia keys are supported, meaning you can send volume up/down keys to the connected computer to control media.

Disclaimers:

  • This app requires your device to be rooted.
  • I strongly recommend using a keyboard such as Unexpected Keyboard to use special keys such as modifier and function keys, but most functionality will work with any standard Android keyboard.

Bonus description for nerds: This app adds (and provides a simple UI for you to communicate with) two character devices (/dev/hidg0 and /dev/hidg1 respectively) by adding HID functions to the default Android USB gadget. If you wanted to, you could just use this app to create the character devices, then communicate solely through some C program, shell script, or whatever else you wanted as long as it had the right permissions to access the character devices and knew how to send proper reports to them. Beware of SELinux policies if you do that though. If anyone is actually doing that, let me know, I'd be glad to help if necessary.

Tested primarily on: Linux (Host computer) and Pixel 5 running Android 14.

(back to top)

Getting Started

Prerequisites

  • Rooted device running Android
    • Only specific root methods are supported, because I need to patch SELinux policy at runtime and am using provided tools to do so. if your root method isn't on this list and provides a method for live-patching SELinux policy, feel free to create an issue.
      • Magisk: magiskpolicy
      • KernelSU: ksud sepolicy patch
    • Android version that I currently test with: 14
  • Soft Keyboard
    • I test the app with Gboard and Unexpected Keyboard, but Unexpected Keyboard is the one with slightly better support, more keys, and fewer issues.

Installation (Binary)

The recommended way to install the app is through the IzzyOnDroid repo via an app that's compatible with F-Droid style repositories, since that'll make updates much easier. However, you can also download the APK file from the Github releases page, then install it on your Android device.

Installation (Source)

Clone the repository.

git clone https://github.com/Arian04/android-hid-client.git

import into Android Studio, build the APK, then install it on your Android device.

(back to top)

Usage

To relay keys in real-time as soon as you press them, click on the keyboard icon in the menu bar. It should pull up your keyboard. Now you can just start typing!

Typing in the "Manual Input" text box will send all the characters that you've typed into the box to the connected device once you hit the "send" button.

Some Use Cases

  • Quickly be able to change BIOS/UEFI settings of a computer when you don't have a keyboard with you
  • Typing a long string (such as a password or IP address) into a console

(back to top)

Roadmap

  • Keyboard support
  • Add some special key buttons to the UI (like multimedia keys)
  • Touchpad support
  • Ability to send string all at once
  • Add full settings page
  • Add prompt to create /dev/hidgX if not present

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU GPLv3 License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

(back to top)

About

Android app that turns your phone into a keyboard and mouse without requiring any software on the other end. Supports scripting and script files. (Requires root)

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Kotlin 94.5%
  • C 2.7%
  • C++ 1.7%
  • Other 1.1%