A standalone ReVanced patch that prevents the first 100–300 ms of audio from being cut off when an app starts playing through Bluetooth headphones.
Many Bluetooth headphones—and the audio HAL on the Android side—drop the active A2DP stream to a low-power state after a short period of silence. When the next clip starts, the link has to wake up, and the first fraction of a second is lost.
This patch injects a ContentProvider into the target app whose onCreate
starts an inaudible looping PCM AudioTrack (44.1 kHz, 16-bit mono,
all-zero samples). The provider is registered in the host manifest, so
Android creates it during process startup—before Application.onCreate
—and the silent track plays for the entire process lifetime, keeping the
A2DP link continuously active.
The patch is universal: it doesn't fingerprint any host-app code, so it applies cleanly to any APK.
Add the bundle to ReVanced Manager by URL. Manager will then track this repository's releases and offer updates whenever a new tag is published.
-
Open ReVanced Manager and go to the Patches tab.
-
Tap the ✏️ button in the bottom-right, then the + button.
-
Choose Enter URL and paste:
https://github.com/LeeeeT/bt-keepalive-patch/releases/latest/download/revanced-asset.json -
Save. The bundle now appears as a patch source in Manager and can be selected when patching any APK. The patch is enabled by default.
Manager re-fetches that JSON on its update check; when a new tag is pushed
here, the workflow rebuilds the bundle, refreshes the JSON's version, and
Manager picks it up automatically.
- JDK 21
- Android SDK with
build-tools;34.0.0and a recent platform (the build will download what it needs automatically if not present) - A GitHub Personal Access Token with the
read:packagesscope, to pull the ReVanced gradle plugin from GitHub Packages
Put the token credentials in ~/.gradle/gradle.properties:
githubPackagesUsername=<your GitHub username>
githubPackagesPassword=<your token>Then:
./gradlew :patches:buildAndroidThe bundle lands at patches/build/libs/patches-<version>.rvp.
A shell.nix is provided that pins JDK, Android SDK and works around a NixOS
quirk where AGP's downloaded aapt2 binary can't run under the stub dynamic
linker. Just:
nix-shell --run './gradlew :patches:buildAndroid'patches/ ReVanced patch (Kotlin) -- edits the manifest
extensions/ Android library compiled into a .dex bundled with the patch
(contains BluetoothKeepAliveProvider)
GPLv3, same as ReVanced patches. See LICENSE.