Every button on your TV remote, working.
remapd makes every button on a Bluetooth remote work on Android TV and Google TV. A small program and an app. No root, no other app needed.
Android 11 or newer · open source · MIT license
Some remote buttons do nothing.
A Bluetooth remote can send buttons that Android TV has no name for. Two things get in the way.
One name for many buttons
The kernel reports any HID usage it doesn't know as KEY_UNKNOWN. Remapping apps see all of those buttons as the same button, so they can't tell them apart.
A key layout for another remote
The Chromecast already has a key layout file for the ACE666BT's ID, 0508:0110. It was made for a different remote, and it turns the colour buttons and Play/Pause into UNKNOWN.
Two small parts.
remapd changes the kernel's keymap for each button, from the one user on your TV that's allowed to: the ADB shell user.
remapd
The program
One C file with no dependencies. It runs as the ADB shell user and keeps going until the TV restarts. It notices when a remote reconnects, applies your buttons again, and puts the original keymap back when it stops.
remapd app
The app
Sets everything up once, lets you pick what each button does, and starts remapd again after every restart. It has its own adb client, so no computer or other app is needed after setup.
Four actions, one per button.
Give it its own key
Sets the kernel's keymap entry for the button, so Android sees a real key instead of UNKNOWN.
Press any Android key
Presses it on a virtual remote, so it works even when the remote's key layout file doesn't have that key.
Run a command
Runs any command with the TV's shell when the button is pressed.
Open an app
Finds the app's TV launcher and starts it.
It changes how your remote is read, so it stays out of the way.
- No root
- remapd runs as the ADB shell user, which Android already lets change keymaps.
- Easy to undo
- Whenever remapd stops, it puts the original keymap back.
- Checked before it's saved
- The app has remapd check a new config first, and keeps the old one as a backup.
- Debugging off when idle
- Wireless debugging is on only while the app needs it, then off again.
Set up once, then forget it.
You need a computer with adb for one command. After that, the app does the rest, including starting remapd again after every restart.
-
Install the app
Download the APK from the latest release and install it on the TV. Needs Android 11 or newer, for wireless debugging.
-
Allow it from a computer, once
With the TV connected over adb, run:
$ adb tcpip 5555 -
Open remapd and tap Set up
The TV asks “Allow USB debugging?”. Choose “Always allow”. The app takes it from there and closes the port when it's done.
-
Pick your buttons
On the Buttons screen, press a button on the remote, choose what it does, and save.
Wireless debugging only works on Wi-Fi, and Android asks once for each access point. A mesh or dual-band router can have several.
Get the latest release.
Check what you downloaded
Releases are signed with a key the owner keeps. Check the file and the certificate:
$ sha256sum -c SHA256SUMS
$ apksigner verify --print-certs remapd-2.1.apk
The certificate SHA-256 digest should be:
e3ca2530f93a91b09c27889d52413d5eb5e48234c4514a45c2bcd7422576fd7f
Tested on one setup.
It works on the one TV and remote below. Other setups should work, but nobody has tried yet. If you try one, say how it went. Other remotes' button codes and other TVs' key layout files help most.
Open an issue- TV
- Chromecast with Google TV (4K)
- Remote
- ACE666BT 0508:0110
- Needs
- Android 11 or newer