Skip to content
Foxnet-LabPublic

About

Rootless virtual Xbox Wireless Controller for Android via /dev/uhid and Shizuku (PowerA USB GIP, Bluetooth HID, Steam Controller)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

๐ŸŽฎ GhostPad

Your controller, seen as an official Xbox Wireless Controller.

Android Min SDK Shizuku Required License GitHub

Never buy a second controller just because a game is picky. GhostPad intercepts the gamepad you already own โ€” a wired PowerA / Xbox Series X|S controller, a generic Bluetooth HID pad, a Valve Steam Controller โ€” and re-presents it to Android as an official Xbox Wireless Controller (BUS_BLUETOOTH, 0x045E:0x02FD) through Shizuku โ€” rootless.

Games that refuse uinput's BUS_VIRTUAL devices (notably Call of Duty: Mobile) accept the real thing: a /dev/uhid device with the authentic Xbox Wireless HID report descriptor. Native button prompts, native aiming, no mapping hacks.


About

GhostPad is an open-source Android app maintained by Foxnet-Lab. It sits between a physical gamepad and Android, translating that controller's inputs into the exact HID reports an official Xbox Wireless Controller sends through /dev/uhid. The result is a real BUS_BLUETOOTH device with VID/PID 0x045E:0x02FD, so picky games see a genuine console controller instead of a virtual uinput pad.

  • Rootless: uses Shizuku for shell-UID access โ€” no root, custom ROM, or second controller required.
  • Supported inputs: wired PowerA / Xbox GIP controllers, generic Bluetooth HID pads, and Valve Steam Controllers.
  • Current release: v3.2 (versionCode 5), signed with the XNet key and 16 KB aligned.
  • Source & releases: Foxnet-Lab/GhostPad ยท Releases
  • License: MIT โ€” see LICENSE.

Why it exists, how the translation works, and what's supported are covered below.


Why GhostPad Exists

Android's gamepad support is uneven: many flagship mobile games ship official controller support, yet only recognize bona fide console controllers. A perfectly good 20โ€“30 โ‚ฌ Bluetooth pad โ€” or the wired PowerA you already use on your Xbox โ€” gets ignored, or worse, half-mapped through a vendor's proprietary overlay.

GhostPad stands between your physical controller and Android, translating its inputs into the exact HID reports an official Xbox Wireless Controller sends. To the OS and to the game, your controller is one.

Games this unlocks or improves include:

Call of Duty: Mobile Apex Legends Mobile Alien: Isolation GRID Autosport
GTA: The Trilogy โ€“ DE Dead Cells Castlevania: SoTN Pascal's Wager
Bloodstained: RotN Minecraft Genshin Impact Arknights: Endfield

โ€ฆand essentially any title that gates controller support on a recognized VID/PID or on BUS_BLUETOOTH devices.


How It Works

Physical controller (USB GIP / Bluetooth HID / Steam Controller)
        โ”‚
        โ–ผ
Exclusive grab โ€” USB interrupt endpoint (claimInterface) or EVIOCGRAB
        โ”‚         (physical inputs never leak to Android twice)
        โ–ผ
ControllerService โ€” GIP/XInput/HID report parsing โ†’ SteamControllerState
        โ”‚
        โ–ผ
Shizuku UserService (shell UID, no root) โ€” input translation & mapping
        โ”‚
        โ–ผ
/dev/uhid  โ”€โ”€UHID_CREATE2โ”€โ”€โ–ถ  Xbox Wireless Controller
                              bus = BUS_BLUETOOTH (0x05)
                              vid = 0x045E ยท pid = 0x02FD ยท ver = 0x0903
                              โ””โ”€โ”€โ”€โ”€ UHID_INPUT2 โ–ถ 17/21-byte Xbox HID reports
  1. Intercept โ€“ Wired PowerA controllers are claimed at the USB level (GIP protocol: power-on, button/trigger/stick reports, guide-button ACK, rumble). Bluetooth pad input is grabbed exclusively via EVIOCGRAB on its /dev/input/event* node.
  2. Translate โ€“ Raw reports become a normalized controller state (sticks, triggers, hat switch, buttons โ€” with a 3-frame debounce for Steam's capacitive sensors).
  3. Re-present โ€“ A /dev/uhid device registers an Xbox Wireless Controller โ€” the same HID report descriptor, axes and button usages as the real 1708 pad, plus Rx/Ry duplicates so Android exposes AXIS_RX/AXIS_RY (games use those to detect the right stick; without them the camera can "snap back to center").
  4. Play โ€“ Games see an official wireless Xbox pad. The 50 Hz rumble thread forwards UHID_OUTPUT force-feedback back to the physical controller.

Why /dev/uhid instead of /dev/uinput?

uinput devices register as BUS_VIRTUAL, which many games (CODM included) ignore by design. /dev/uhid delivers the raw HID report descriptor to the kernel โ€” Android classifies the device exactly like a physical Bluetooth pad: bus=0x0005, vendor=0x045e, product=0x02fd, with the stock Vendor_045e_Product_02fd.kl key layout.


Features

Supported controllers

  • PowerA / Xbox Series X|S wired (GIP over USB, VID 0x20D6) โ€” e.g. PowerA Advantage Wired; no PID hardcoding, any PowerA GIP pad matches. Exclusive interface claim, GIP power-on, rumble, Guide-button handling.
  • Generic Bluetooth HID gamepads โ€” iPega, 8BitDo, MOGA, any paired pad; grab-and-route with EVIOCGRAB.
  • Valve Steam Controller โ€” USB OTG (Puck) and Bluetooth LE, full Valve GATT/Steam HID protocol, lizard-mode management, battery status.

Emulation & routing

  • Virtual Xbox Wireless Controller (0x045E:0x02FD) for every gamepad profile.
  • Desktop mode โ€” controller drives a real mouse cursor + keyboard keys (Android TV friendly, with an IME-hard-keyboard fix).
  • Foreground-app profile auto-switch โ€” a game bound to a profile loads automatically.
  • Notification quick-switch โ€” cycle profiles without opening the app.

Tuning & diagnostics

  • Stick calibration โ€” dead zone, center offset, Y inversion, 2-D visualizer.
  • Button remapping โ€” face/shoulder/system buttons to Xbox targets, keyboard keys, or system actions (screenshot).
  • Rumble โ€” adjustable intensity, forwarded to the physical pad.
  • Live Indicators โ€” 2-D stick pads, raw/normalized readouts, trigger/button rows and a per-frame session log (pause / mark / copy / stream to logcat).
  • Guided capture โ€” an 8-direction scripted sweep (3 s each) that dumps per-axis min/max/final values to a copyable list โ€” invaluable when a game misbehaves on a new pad.

Requirements

  • Android 8.0+ (API 26) โ€” phone, tablet, or Android TV
  • Shizuku running (Wireless ADB or one-time PC ADB)
  • A compatible controller:
    • wired PowerA / Xbox GIP pad over USB OTG, or
    • any paired Bluetooth gamepad, or
    • a Valve Steam Controller (USB OTG / Puck / BT LE)

Setup & Quick Start

  1. Install and start Shizuku (Wireless ADB is enough).
  2. USB: plug in your PowerA pad, grant the USB-access prompt, pick the USB transport and (optionally) the emulated profile, tap Start Service. Bluetooth: pair the pad in Android Settings, pick it (or Any Connected Bluetooth Controller) under the Bluetooth transport, tap Start Service.
  3. Grant Shizuku and notification permissions when prompted.
  4. Launch your game. GhostPad's "Xbox Wireless Controller" is already registered โ€” with hardware button prompts and full L/R stick aiming.

Verify it registered

adb shell dumpsys input | grep -A 12 "Xbox Wireless Controller"

Expect:

Identifier: bus=0x0005, vendor=0x045e, product=0x02fd, version=0x0903
KeyLayoutFile: /system/usr/keylayout/Vendor_045e_Product_02fd.kl
Classes: KEYBOARD | GAMEPAD | JOYSTICK | VIBRATOR | EXTERNAL

Building

git clone https://github.com/Foxnet-Lab/GhostPad.git
cd GhostPad

# Requires JDK 17, Android SDK with platform 35 + NDK (CMake builds the JNI layer)
./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apk

Key build facts:

  • compileSdk 35, minSdk 26, targetSdk 35, Java/Kotlin 17.
  • The native layer (app/src/main/cpp/uinput_jni.cpp) is compiled with CMake and linked at 16 KB page alignment for Android 15+ devices.
  • Shizuku binds UInputService as an untrusted user service โ€” the app itself needs no privileged permissions.
  • The debug build installs as com.virtualcontroller.android.debug alongside a release install; the package id is stable because Shizuku/USB permission grants are keyed to it.

Debugging a new controller

  1. Open Settings โ†’ Live position indicators.
  2. Wiggle each control and watch the pads/values; enable Log to logcat if needed.
  3. Run Guided capture for a normalized baseline, then Copy results.
  4. Pull the frame log: adb logcat -s ControllerLive uinput_jni PowerAReportReader

Roadmap

  • Bluetooth + generic-HID routing to a virtual Xbox pad
  • Wired PowerA / Xbox GIP support (/dev/uhid, bus=5, 0x045E:0x02FD)
  • Live indicators + guided capture diagnostics
  • Game-detection fix: AXIS_RX/AXIS_RY for the right stick
  • In-app axis and button remapping for non-standard pads
  • Bluetooth paired-device filtering (gamepad-class only)
  • Gyro aiming to DualShock 4 / DualSense motion controls

Credits

GhostPad stands on the shoulders of previous projects and open-source research โ€” thank you to every maintainer below.

Upstream & forks

  • misakidebugged/Virtual-Xbox-Controller-Android โ€” the direct upstream this fork grew from; its maintainers built the original generic-Bluetooth-to-virtual-Xbox routing and app UI.
  • SonicDX12/SteamController-Android โ€” the original Steam Controller project GhostPad (previously this fork chain) was forked from; foundational Steam Controller driver, mapping pipeline and uinput architecture from SonicDX12 and contributors.

Protocol & research

  • lukas-schier/android-virtual-xbox-controller โ€” reference for the Xbox Wireless HID report descriptor and /dev/uhid initialisation approach.
  • ddeverill/SteamlessController & the Linux hid-steam driver โ€” Steam Controller HID report parsing reference.
  • Microsoftโ€™s MS-GIPUSB specification and the Linux xpad/xone drivers โ€” the basis for PowerA wired GIP handling.

Tooling

  • Shizuku by RikkaApps โ€” rootless access to /dev/uhid and /dev/uinput via the shell UID. The keystone of this app.
  • Android Studio + AI-assisted development (JNI/evdev architecture) for earlier iterations.

License

MIT โ€” see LICENSE.

About

Rootless virtual Xbox Wireless Controller for Android via /dev/uhid and Shizuku (PowerA USB GIP, Bluetooth HID, Steam Controller)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages