All Projects → Netdex → android-usb-script

Netdex / android-usb-script

Licence: MIT License
An Android app that allows you to script USB gadgets (work-in-progress).

Programming Languages

java
68154 projects - #9 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to android-usb-script

Stream Deck Api
API to interact with the Elgato Stream Deck controller
Stars: ✭ 36 (+140%)
Mutual labels:  usb, hid
RaspberryPi-Joystick
A virtual HID USB joystick created using Raspberry Pi
Stars: ✭ 73 (+386.67%)
Mutual labels:  usb, hid
Node Hid
Access USB & Bluetooth HID devices through Node.js
Stars: ✭ 1,064 (+6993.33%)
Mutual labels:  usb, hid
Hidviz
A tool for in-depth analysis of USB HID devices communication
Stars: ✭ 505 (+3266.67%)
Mutual labels:  usb, hid
python-hid-parser
Typed pure Python library to parse HID report descriptors
Stars: ✭ 31 (+106.67%)
Mutual labels:  usb, hid
Vigembus
Windows kernel-mode driver emulating well-known USB game controllers.
Stars: ✭ 721 (+4706.67%)
Mutual labels:  usb, hid
Hidguardian
Windows kernel-mode driver for controlling access to various input devices.
Stars: ✭ 138 (+820%)
Mutual labels:  usb, hid
Device.net
A C# cross platform connected device framework
Stars: ✭ 347 (+2213.33%)
Mutual labels:  usb, hid
EspTinyUSB
ESP32S2 native USB library. Implemented few common classes, like MIDI, CDC, HID or DFU (update).
Stars: ✭ 375 (+2400%)
Mutual labels:  usb, hid
Authorizer
Authorizer is a Password Manager for Android. It emulates an HID keyboard over USB and enters your credentials on your target device. Additionally it supports OTP 🔑📴
Stars: ✭ 172 (+1046.67%)
Mutual labels:  usb, hid
Hidapi
A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.
Stars: ✭ 465 (+3000%)
Mutual labels:  usb, hid
pi400kb
Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard
Stars: ✭ 182 (+1113.33%)
Mutual labels:  usb, hid
Headsetcontrol
Sidetone and Battery status for Logitech G930, G533, G633, G933 SteelSeries Arctis 7/PRO 2019 and Corsair VOID (Pro) in Linux and MacOSX
Stars: ✭ 392 (+2513.33%)
Mutual labels:  usb, hid
Hidpytoy
A GUI app for playing with HID devices, written in Python
Stars: ✭ 25 (+66.67%)
Mutual labels:  usb, hid
Node Elgato Stream Deck
A Node.js library for interfacing with the Elgato Stream Deck.
Stars: ✭ 359 (+2293.33%)
Mutual labels:  usb, hid
Android Usb Gadget
Convert your Android phone to any USB device you like! USB Gadget Tool allows you to create and activate USB device roles, like a mouse or a keyboard. 🛠🛡📱
Stars: ✭ 118 (+686.67%)
Mutual labels:  usb, hid
usb stack
Tiny and portable USB device/host stack for embedded system with USB IP
Stars: ✭ 175 (+1066.67%)
Mutual labels:  usb, hid
Teenyusb
Lightweight USB device and host stack for STM32 and other MCUs.
Stars: ✭ 287 (+1813.33%)
Mutual labels:  usb, hid
Usbdevice
Highly flexible Composite USB Device Library
Stars: ✭ 144 (+860%)
Mutual labels:  usb, hid
ES-Timer
A USB timer powered by Digispark ATtiny85 according to 🍅 pomodoro time management technique
Stars: ✭ 45 (+200%)
Mutual labels:  usb, hid

Android USB Script

Use at your own risk. For educational purposes only.

An Android app that provides a simple Lua interface for enumerating and interfacing with arbitrary composite USB devices.

Root access is required.

Demonstration

The best way to explain what this app does is with a code example. The following script does the following when interpreted by this app:

  1. Configures your phone to become a USB keyboard
  2. Sends a series of key presses to the computer your phone is plugged in to, changing its wallpaper
-- create a USB composite device composed of a single keyboard
usb = luausb.create({ id = 0, type = "keyboard" })
kb = usb.dev[1]

local file = prompt("Wallpaper to download?", "https://i.imgur.com/46wWHZ3.png")

while true do
    print("idle")

    -- wait for the phone to be plugged into a computer
    while usb.state() == "not attached" do
        wait(1000)
    end

    print("running")
    wait(1000)

    kb.chord(MOD_LSUPER, KEY_R)     -- open Windows run dialog
    wait(2000)                      -- wait for it to open
    kb.string("powershell\n")       -- open powershell
    wait(2000)
    -- execute a script that downloads and changes the wallpaper
    kb.string("[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;" ..
            "(new-object System.Net.WebClient).DownloadFile('" .. file .. "',\"$Env:Temp\\b.jpg\");\n" ..
            "Add-Type @\"\n" ..
            "using System;using System.Runtime.InteropServices;using Microsoft.Win32;namespa" ..
            "ce W{public class S{ [DllImport(\"user32.dll\")]static extern int SystemParamet" ..
            "ersInfo(int a,int b,string c,int d);public static void SW(string a){SystemParam" ..
            "etersInfo(20,0,a,3);RegistryKey c=Registry.CurrentUser.OpenSubKey(\"Control Pan" ..
            "el\\\\Desktop\",true);c.SetValue(@\"WallpaperStyle\", \"2\");c.SetValue(@\"Tile" ..
            "Wallpaper\", \"0\");c.Close();}}}\n" ..
            "\"@\n" ..
            "[W.S]::SW(\"$Env:Temp\\b.jpg\")\n" ..
            "exit\n")

    print("done")
    -- wait until the phone is unplugged
    while usb.state() == "configured" do
        wait(1000)
    end
end

Several other sample scripts are included in the repository.

Requirements

This app will not work on every Android device. If your Android OS has Linux Kernel version >= 3.18 and is compiled with configfs and f_hid, then the app can try to create usb gadgets.

New demo applications can be added to assets/scripts. The API is pretty much self-documenting, just look at the existing demos to get a feel for how the API works.

Third-party

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].