Button Silencer
3.2.0 · GitHub
More about this app
Blocks faulty headset and IEM remote buttons without disabling the phone's own buttons; Shizuku provides the privileged path for screen-off headset input protection.
Button Silencer
Block faulty headset and IEM remote buttons without disabling your phone's own buttons.
Faulty inline remotes can generate phantom volume, media, assistant, or headset-hook presses. In the worst case, a ghost headset click can answer or end a call. Button Silencer blocks those controls while leaving the phone's physical buttons alone.
Protection model
| State | Protection |
|---|---|
| Screen on | Android Accessibility filters headset keys before apps receive them. |
| Screen off | Shizuku provides the privileged path used for headset input protection. |
| Selected headset | Its safe remote-control input nodes can be exclusively guarded before Android handles their button events. |
Call-capable headset keys are treated as safety-critical while protection is enabled. The app only reports full protection when the screen-on path and the selected-headset screen-off guard are both ready.
Getting started
- Install the APK from Releases.
- Enable Button Silencer in Android Accessibility settings.
- Start Shizuku and grant Button Silencer permission.
- Turn on Headset button protection.
- Connect the affected headset or USB DAC, tap Scan headset, and select it.
After a reboot, Shizuku must be started again before screen-off protection can return.
Requirements
- Android 8.0 (API 26) or newer
- Shizuku 13 or newer for screen-off protection
- Accessibility permission for screen-on filtering
Privacy and behavior
Button Silencer has no network permission, analytics, ads, or account system. It does not claim USB interfaces, modify Android key-layout files, use a wake lock, or run a permanent polling loop. Diagnostic logging is off by default and stays in memory for the current app session.
Building
The project uses JDK 17, Android SDK 36, Android Gradle Plugin 8.13.2, and Gradle 8.13.
./gradlew testDebugUnitTest lintDebug lintRelease assembleDebug assembleRelease
The native EVIOCGRAB bridge is committed for four Android ABIs. Verify it with:
bash scripts/verify-native-libs.sh
To rebuild the native libraries, set ANDROID_NDK_HOME and run:
bash scripts/build-native.sh
See docs/architecture.md for the input-routing design and safety boundaries.
Contributing
Focused fixes and device-specific compatibility improvements are welcome. See CONTRIBUTING.md.
Security-sensitive issues should follow SECURITY.md.
Maintained by EithonX. Licensed under the MIT License.
How Shizuku is used
Can block faulty headset buttons and guard selected headset input via `Shizuku UserService`.
This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.
How this app uses Shizuku
Shizuku runs a privileged background guard that blocks faulty headset and earphone remote buttons, including when the screen is off.
- Block headset media keys: faulty headset play, pause, next, previous and call buttons are intercepted and consumed through a privileged media key listener, so they no longer trigger playback or calls.
- Guard selected headset input: the headset input device chosen in the app is grabbed exclusively with
EVIOCGRABand its raw input is drained and discarded, so stuck volume and media signals never reach the phone. - Keep phone buttons working: the guard refuses devices that look like the phone's own buttons and unsafe mixed input nodes, so only the selected external headset is silenced.
- Discover headset devices: the app scans connected input hardware with the
getevent -lpshell command through Shizuku and shows the available external headset controls for selection.
Android APIs or commands used
MediaSessionManager.setOnMediaKeyListenerMediaSessionManager.OnMediaKeyListener.onMediaKeyEVIOCGRABgetevent -lpParcelFileDescriptor.openOs.pollOs.readFileObserver
Notable details
The privileged guard refuses to grab input nodes that look like the phone's own buttons or nodes that mix keyboard and routing functions, so some devices cannot be guarded. Device scanning and exclusive grabbing only work while the Shizuku privileged connection is active.
Changelog
What's new for version 3.2.0
Changed
- Simplified the main screen around protection state, screen-on filtering, screen-off status, and headset selection.
- Moved secondary filtering controls out of the setup path and into Advanced settings.
- Reworked user-facing status text to describe coverage without exposing implementation details.
- Refined project documentation and release notes for the public repository.
Safety
- Full protection still requires the selected-headset exclusive input guard for screen-off call safety.
- Call, hang-up, and headset-hook keys remain safety-critical and do not depend on optional media filters.
Permissions
1 permission requested