Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 58 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@ jobs:
echo '3cf6cd6892e32e2b4c1c39e0f52f5248a2f5b37646fdfbb79a66b46b618414ed .tools/json.jar' | sha256sum --check
- name: Run deterministic tests
run: |
javac -encoding UTF-8 -cp .tools/json.jar -d test-classes src/dev/aurora/tvpatch/Lyrics.java src/dev/aurora/tvpatch/Provider.java tests/LyricsTest.java tests/ProviderTest.java
java -ea -cp test-classes:.tools/json.jar LyricsTest
java -ea -cp test-classes:.tools/json.jar ProviderTest
javac -d test-classes src/dev/aurora/tvpatch/AdMuteState.java tests/AdMuteStateTest.java
java -ea -cp test-classes AdMuteStateTest
javac -d test-classes src/dev/aurora/tvpatch/AudioSessions.java tests/AudioSessionsTest.java
java -ea -cp test-classes AudioSessionsTest
javac -d test-classes src/dev/aurora/tvpatch/AudioEffectPlan.java tests/AudioEffectPlanTest.java
javac -d test-classes src/dev/aurora/tvpatch/GraphicEq.java src/dev/aurora/tvpatch/AudioEffectPlan.java tests/AudioEffectPlanTest.java tests/GraphicEqTest.java
java -ea -cp test-classes AudioEffectPlanTest
java -ea -cp test-classes GraphicEqTest
javac -d test-classes src/dev/aurora/tvpatch/SleepDeadline.java tests/SleepDeadlineTest.java
java -ea -cp test-classes SleepDeadlineTest
javac -d test-classes src/dev/aurora/tvpatch/SleepDeadline.java src/dev/aurora/tvpatch/HushPolicy.java tests/HushPolicyTest.java
java -ea -cp test-classes HushPolicyTest
- name: Test modular fingerprints
run: bash revanced/gradlew -p revanced testFingerprints
- name: Verify WebView bridge lifecycle
run: python3 -m unittest discover -s tests -p test_settings_bridge.py -v
- name: Check source tools
run: |
python3 -m py_compile patch.py import_lyrics.py
python3 -m py_compile patch.py
node -e "new Function('return ('+require('fs').readFileSync('assets/spotifyplus-tv.js','utf8')+')')"
presentation:
runs-on: ubuntu-latest
Expand All @@ -52,5 +56,54 @@ jobs:
NODE_PATH: ${{ github.workspace }}/.tools/browser/node_modules
run: |
node tests/presentation.test.cjs
node tests/home-blur.test.cjs
node tests/theme-regression.test.cjs
node tests/presentation-performance.test.cjs
node tests/native-settings.test.cjs
node tests/native-menu.test.cjs
node tests/input-fastpath.test.cjs
node tests/settings-scroll.test.cjs
node tests/settings-focus.test.cjs
node tests/upgrade-entry.test.cjs
node tests/upgrade-block.test.cjs
node tests/visible-navigation.test.cjs
node tests/themes.test.cjs
rebuild-apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: android-actions/setup-android@v3
with:
packages: platform-tools
log-accepted-android-sdk-licenses: false
- name: Prepare and test embedded helper sources
run: |
python3 -m unittest discover -s hush/tests -v
python3 hush/prepare.py
sdkmanager 'platforms;android-35' 'build-tools;35.0.0'
- name: Compile single-app runtime
run: |
mkdir -p .tools/extension-classes .tools/extension-dex
javac -encoding UTF-8 -source 8 -target 8 -cp "$ANDROID_HOME/platforms/android-35/android.jar" -d .tools/extension-classes src/dev/aurora/tvpatch/*.java hush/build/generated/dev/aurora/tvpatch/hush/*.java
jar cf .tools/extension.jar -C .tools/extension-classes .
"$ANDROID_HOME/build-tools/35.0.0/d8" --min-api 26 --lib "$ANDROID_HOME/platforms/android-35/android.jar" --output .tools/extension-dex .tools/extension.jar
- name: Fetch verified prior release and build tools
run: |
curl --fail --location --output .tools/current.apks https://github.com/AlphadogRSA/spotifyplus-tv-patch/releases/download/v0.5.0/SpotifyPlus-TV-1.134.2-v0.5.apks
curl --fail --location --output .tools/apktool.jar https://github.com/iBotPeaches/Apktool/releases/download/v3.0.3/apktool_3.0.3.jar
curl --fail --location --output .tools/apkeditor.jar https://github.com/REAndroid/APKEditor/releases/download/V1.4.9/APKEditor-1.4.9.jar
- name: Rebuild one unsigned APK
run: python3 rebuild_release.py --input .tools/current.apks --dex .tools/extension-dex/classes.dex --apktool .tools/apktool.jar --apkeditor .tools/apkeditor.jar --output build/release-1.3.0.9
- uses: actions/upload-artifact@v4
with:
name: SpotifyPlus-TV-1.3.0.9-unsigned
path: |
build/release-1.3.0.9/SpotifyPlus-TV-1.3.0.9-unsigned.apk
build/release-1.3.0.9/SHA256.txt
if-no-files-found: error
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ __pycache__/
.jvm-temp/
.gradle/
!revanced/gradle/wrapper/gradle-wrapper.jar

!hush/upstream/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "hush/upstream"]
path = hush/upstream
url = https://github.com/coldMEW/Hush.git
37 changes: 19 additions & 18 deletions HANDOFF.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# Handoff
# Current update: 1.3.0.9

## Current release: 0.5
Spotify+ menu now inherits native Spotify list styles (10 rows). Experimental unstable lyrics integration retired, including polling/provider/import code; existing user files left untouched. Search/text keys bypass async routing and long-OK interception with paired release handling. Hidden settings skip refresh and unrelated Home mutations skip rescans. TV keyboard opened in three focused-input trials (3.12/2.53/2.23 seconds including ADB overhead); some Android startup delay remains. See VERIFICATION.md for scope and tests.

The 0.5 follow-up fixes themes against verified TV class selectors, expands promotion/Upgrade hiding and optimizes DOM scanning, playback callbacks, dialog cleanup and DSP writes. See VERIFICATION.md for the measured checks. It keeps all 0.4 functions and persisted settings. The remote theme cycle and Spotify-only audio activation were observed after installing 0.5.
Keep verified app fixes documented and publish matching source, APK and Windows installer to GitHub, per maintainer workflow. Preserve installed data and unrelated apps. Do not claim performance improvements without measurements; retain attribution and licenses.

The default build now uses modular Kotlin ReVanced patches and a precompiled MIT extension DEX. It adds default-on recognized-ad muting, Upgrade-button hiding, Spotify-style accents and background blur, polished TV labels, and per-process/session EQ plus 0–6 dB boost. There is no shared-output/session-0 effect path. See AUDIO.md for one-time ADB diagnostic permission setup. `install.ps1` installs all four APKs, grants that permission and launches the client. The same retained private key was used for updates; no uninstall was used for 0.4. The user paired Spotify again during testing.
# Previous update: 1.3.0.8

The final four-APK build is specific to the inspected Spotify TV 1.134.2 ARMv7/English/TV-density installation. Source archives and the private GitHub release exclude the local signing key, original-install backup, account data, fetched lyrics and user screenshots. The release installation archive necessarily includes the patched proprietary app and required splits for this installation; the MIT license does not relicense those binaries.
Home blur now adds an isolated halo behind native artwork and never uses page-level/native Home wrappers as a clipped fallback. Loading/fade-in, toggle cleanup and native geometry verified. PanelUi provides the EQ-style navy/blue native frame, buttons and dialogs; settings cards match. Final native panels and QR visually/device tested.

This repository contains only the original TV extension and build/test tools. The proprietary original APKs, patched APK set, account data, signing key and fetched lyrics are intentionally excluded.
# Previous update: 1.3.0.7

## Completed
Home navigation now includes only visible eligible controls, clamps at visible endpoints, disables Upgrade for focus/accessibility, and repairs a remembered Upgrade position on menu entry. Verified actual remote traversal and Home activation on the Xiaomi TV.

- Version-pinned injection into the inspected Spotify TV 1.134.2 client.
- Native D-pad menu, three themes, cinematic motion toggle, own-session sleep timer and private local LRC import.
- Lyrics update 0.2: manual public LRCLIB lookup, timed and plain results, per-track in-memory cache, local-file precedence, font sizes and timing offset.
- Background lookup, bounded response size, request cooldown, connect/read timeouts and an overall watchdog.
- Reproducible four-APK build/signing script, original input hashes, deterministic tests and CI workflow.
- Independent source/attribution notices; no Eevee implementation or assets copied.
# Previous update: 1.3.0.6

## Next device checks
Shared key routing fixes stale Spotify+ selection and missed Home OK. Native dialogs no longer leave a release state that swallows the next press. Verified three About/Home cycles plus remote top-menu handoff; current source/build remains on feat/hush-tv.

The new **Lyrics · local / LRCLIB** panel was observed fetching and displaying timed lyrics for a real signed-in track. Continue testing provider coverage, track changes while fetching, local precedence, pause/seek/resume, timing offsets, long-running drift and D-pad scrolling of plain lyrics. See VERIFICATION.md for exactly which checks ran.
# Previous update: 1.3.0.5

## Building and updating
Upgrade UI activation is blocked at click, native remote navigation and SPA upsell-route levels. About includes Tumelo Rathebe / AlphadogRSA with an offline GitHub QR. Theme cycling now includes Ocean, Rose and Solar, preserving existing theme indices. The installed same-key build and QR screenshot were verified on the TV.

Use the original four installation APKs from your own TV and the private signing key retained locally. `build.ps1` verifies their hashes and produces a fully signed four-APK set. Updating with the same key preserves the current app's data; a different key normally requires reinstalling and signing in again. Do not install just the base APK or mix certificates across splits.
# Handoff · Spotify+ TV 1.3.0.1

The extension's added network request is only the explicit LRCLIB lookup; no Spotify login credentials or entitlement values are processed by it. The runtime and its tests remain MIT licensed; the ReVanced host module is GPL-3.0-only under revanced/COPYING. See README.md, LYRICS.md and assets/INSPIRATION.md for scope and notices.
User requirements: one Spotify APK, integrated Hush functionality, reference-style graphic EQ, and all custom controls inside Spotify’s existing settings panel.

Implemented: native `/profile` settings host integration using observed `profile-menu`/`profile-menu-item` and `top-menu--settings` selectors; restricted JavaScript settings bridge; native graphic EQ and migration; embedded pinned Hush helper/provider with fixed restart command; persisted sleep/recovery state; single unsigned APK rebuild and retained-key signing/install scripts.

The rebuilt file still targets the inspected ARMv7/English/TV-density installation, with versionName `1.3.0.1` and original versionCode `2340200`. The source repo excludes private signing material. An unsigned build is not an installable same-key update. No installation or live-TV verification for this version is claimed. Earlier 0.5 observations remain historical in VERIFICATION.md.

Read HUSH.md for setup and recovery limitations, README.md for build/install scope, and the current plan/spec under docs/superpowers. The native Settings selectors were verified against Spotify’s delivered Android TV web UI `ad3ec52`; future remotely delivered UI changes may need selector updates.
22 changes: 22 additions & 0 deletions HUSH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Integrated Hush · one Spotify app

Hush’s helper ships inside Spotify+ TV 1.3.0.1. There is no companion APK, extra launcher icon, notification-listener permission or Shizuku dependency. The shell-owned helper survives the Spotify process being stopped; Spotify’s next process resumes its own session. This adapts the restart strategy from coldMEW/Hush to the TV app’s native `is_ad_playing` signal.

## Setup

1. Build/sign with the same retained private key as the existing TV installation, then update without uninstalling. The generated unsigned APK cannot be installed until signed.
2. Launch Spotify once. The app writes a private, token-bound startup script for its embedded helper.
3. Run `start-hush.ps1 -Serial TV_IP:5555` over your authorized ADB connection. The command stays private; the script does not print its token. Repeat after a TV reboot or APK update. The app remains debuggable as in the existing build so the installer can read this app-private startup command through `run-as`.
4. Open Spotify’s own Settings/profile screen. Under Spotify+ TV, check **Hush helper setup**, then turn **Hush ad-break skipping** on. Keep **Mute detected ads** on for the fallback.

The helper provider accepts only Android’s shell UID, requires the privileged cross-user permission and validates a random token from private app storage. Its adapted command builder accepts only the fixed restart action for `com.spotify.tv.android/.SpotifyTVActivity`; it rejects arbitrary actions/components. It does not install or control another application.

## Recovery and limits

Before requesting a restart, Spotify commits its recovery state. The helper executes the whole stop/allowlist/start sequence outside the dying app process. The new process waits for its own media session, retries play for at most 20 seconds, honors the sleep deadline even if the visible timer has already cleared, and falls back after failure. Attempts have a 30-second minimum interval; failed recovery imposes a two-minute cooldown. Paused ads are left alone.

Whether restarting actually drops an ad break or preserves the queue depends on Spotify TV. Upstream phone timings do not establish TV behavior. This release needs real-device tests for ad-return behavior, queue context, helper loss, screen/background behavior, sleep expiry during restart, EQ reattachment and same-key updating. No calibrated audio or guaranteed ad-removal claim is made.

## Reproducible source

`hush/upstream` is an unchanged pinned submodule. `hush/prepare.py` verifies its commit and clean tracked source, then extracts/adapts eight helper classes under `dev.aurora.tvpatch.hush` into a new generated source directory. The command restriction, TV target, provider authority and protocol version changes are visible in that script. These helper portions are GPL-3.0; their full license and source notice are included in the APK. No phone UI, VPN/DNS filtering, notification watcher, global-volume mute or account handling is imported.
30 changes: 3 additions & 27 deletions LYRICS.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
# Lyrics update 0.2 — implementation handoff
# Experimental lyrics retired in 1.3.0.9

The Eevee-inspired additions are independent Android implementations: manual LRCLIB lookup, timed/plain fallback, lyric-size controls and timing correction. No GPL-licensed Eevee implementation was copied. No subscription/authentication changes are included.
The unstable experimental Spotify+ lyrics feature was removed to simplify setup and maintenance. The custom menu entry, local LRC parser/import tool, LRCLIB client, dialogs and playback-metadata polling are no longer shipped or run. No lyrics-provider requests are made by the extension.

## Flow

1. The injected media-session hook captures only Spotify's own native token.
2. `Hooks.updateLyrics()` reads that session's metadata and interpolates its playback clock.
3. A valid local `files/sptv-lyrics/NAME.lrc` takes priority.
4. **Fetch from LRCLIB** snapshots current title, artist, album and duration and runs `Provider.fetch()` on a background executor. The overlay states what metadata is shared.
5. `GET https://lrclib.net/api/get` uses the public metadata contract. No Spotify token/client ID is used. Redirects are disabled, response size is capped at 512 KiB, connect/read timeouts are set, and a 30-second overall watchdog disconnects slow responses. A monotonic deadline is also checked between reads.
6. Results are returned to the UI thread and stored under the captured track identity in a 12-entry memory map. Rendering always resolves the currently playing identity, so a late response for an old track does not replace the new track's lyrics. Requests have a 30-second cooldown.
7. Timed LRC uses the parser and current native playback position. Plain results display a preview and can be opened in a separate D-pad-scrollable dialog. Instrumental/no-result/error responses are explained without inventing timings.

## Main files

- `src/dev/aurora/tvpatch/Hooks.java`: injected lifecycle/session hooks, dialogs and provider integration.
- `src/dev/aurora/tvpatch/Provider.java`: public LRCLIB client and response parser.
- `src/dev/aurora/tvpatch/Lyrics.java`: LRC parser and clock interpolation.
- `assets/spotifyplus-tv.js`: theme presentation only.
- `patch.py`: exact-version bytecode injection; rejects an unrecognized original base APK.
- `build.ps1`: reproducible Windows build/signature verification from the user's four original APKs.
- `tests/`: original lyric fixtures, query/response tests, optional live lookup smoke test.

## Continue development

The 0.2 update was observed fetching and rendering timed lyrics for a real signed-in Spotify track at its native playback position. Continue checking track changes during a fetch, local-file precedence, seek/pause/resume, long-running drift and plain-dialog scrolling. Do not treat that single lookup/render check as complete device coverage. LRCLIB coverage and timing can vary.

Fetched lyrics are not saved to disk. If adding persistence later, define retention and deletion and preserve provider/rightsholder attribution. Never commit proprietary APKs, signing keys, account tokens or fetched lyric catalogs. GitHub contains the extension source and build/test instructions only.
The update does not clear app data or delete previously imported files. Those files and old preferences are unused. Earlier release tags preserve the historical source and notices. This removal concerns the extension feature; Spotify controls any lyrics in its original client.
Loading
Loading