Spatch runs a Rust-driven Android UI over Spotify's existing playback, cache and Connect services. This branch supports Spotify 9.2.0.2053 (version code 148387875) and supports Spotify’s native sign-in flow on fresh installs. APKM and split hashes are pinned in crates/patcher/src/input.rs.
See the core README for UI features and the standalone preview, Development notes for the source map, lifecycle rules and validation commands, and External control intents for automation via Tasker, MacroDroid, KWGT or ADB.
The earlier redesign lives on the legacy branch.
An optional official Spotify playback fallback keeps Spatch's interface while the installed official app handles audio. Enable it in Settings → Playback; it requires Android notification access and retains normal account restrictions and ads.
- Rust with 2024 edition support, a JDK, apktool, Android SDK platform 35 or later, and Android SDK build tools
- The matching Spotify APKM
- The ARM64 Rust library build for signed patches and bundles
- Your signing key for signed patches
cargo build --releaseCheck an APKM:
./target/release/spatch inspect <input.apkm>Verify the APKM and rebuild the DEX with the JDK, apktool, Android platform JAR, d8 and
dexdump:
./target/release/spatch patch <input.apkm> --out <new-dir> --dry-runBuild a signed set. The password is read by apksigner from the environment variable you name, and
spatch never reads or prints it:
./target/release/spatch patch <input.apkm> --out <new-dir> --keystore <file> --alias <name> --ks-pass-env SPATCH_KS_PASSWrite a patch bundle for Spatch Manager. Bundle creation also uses aapt2:
./target/release/spatch bundle <input.apkm> --out <new-file.zip>Prepare a private source for invited phones. This command only needs
aapt2 from the Android SDK:
./target/release/spatch source <input.apkm> --out <dir>Install every split together. Update in place: uninstalling loses the app's data, and the signer must match any Spatch build already on the phone.
adb install-multiple -r base.apk split_config.*.apkThe patcher checks the input hashes, applies guarded smali edits, then builds the Java helper DEX. Signed patches and Manager bundles also include the ARM64 Rust library. See the hook map, porting notes and external control intents.
| Path | Role |
|---|---|
crates/patcher/src/input.rs |
Supported input and split hashes |
crates/patcher/src/edits.rs |
Smali edits and their required anchors |
crates/patcher/src/dex.rs |
DEX reassembly, relocation and helper compilation |
crates/patcher/src/bundle.rs |
Manager bundle creation and clone metadata |
crates/patcher/src/source.rs |
APKM and index staging for private sources |
crates/core/src/ |
Rust core, Spotify protobuf clients, DSP and JNI bridge |
android/ui/ |
Android UI, audio effects, widgets and Spotify bridge (audio/, bridge/, lyrics/, screens/, views/, widget/) |
android/stubs/ |
Compile-only Spotify Transport and RxJava stubs |
The diagnostics were removed and live in the tag integrity-diagnostics-2026-11-26.
cargo test --locked
cargo clippy --all-targets --locked -- -D warnings
cargo test --manifest-path crates/core/Cargo.toml --features preview --locked
python3 android/tests/nightly-inputs.py
JAVA_HOME=/path/to/jdk ANDROID_HOME=/path/to/android-sdk python3 android/tests/java-contracts.py
preview/mac.sh --checkRun the real-APKM smoke test with the pinned archive and Android tools installed:
SPATCH_APKM=/path/to/spotify.apkm cargo test --locked dry_run_on_supplied_apkm -- --ignoredFor a local nightly bundle without publishing, use the ARM64 build prerequisites.
The script builds the library from the selected Git commit. Set SPATCH_APP_SO to use a prebuilt library.
SPATCH_APKM=/path/to/spotify.apkm NIGHTLY_BUILD=normal NIGHTLY_OUT=/absolute/output/dir tools/nightly.shMIT. Spatch is unofficial and unaffiliated with Spotify AB.