Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

feat: releases cut by Release Please with the .deb attached, and the Updates row asks GitHub for the latest one

Vojtěch Škopek349c5cf2c338
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..50a5ca77
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,61 @@
+# Every push to main updates one release PR (version.txt and CHANGELOG.md from the feat:/fix:
+# commits since the last release). Merging it tags vX.Y.Z and makes the GitHub Release, and the
+# second job builds the tweak's .deb and attaches it. No IPA is built or published here.
+name: Release
+
+on:
+ push:
+ branches: [main]
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ release-please:
+ runs-on: ubuntu-latest
+ outputs:
+ created: ${{ steps.release.outputs.release_created }}
+ tag: ${{ steps.release.outputs.tag_name }}
+ steps:
+ - uses: googleapis/release-please-action@v4
+ id: release
+
+ deb:
+ needs: release-please
+ if: needs.release-please.outputs.created == 'true'
+ runs-on: macos-latest
+ env:
+ THEOS: ${{ github.workspace }}/theos
+ steps:
+ - uses: actions/checkout@v5
+
+ - uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: latest-stable
+
+ - uses: actions/checkout@v5
+ with:
+ repository: theos/theos
+ path: theos
+ submodules: recursive
+
+ - name: Install tools
+ run: brew install make dpkg ldid
+
+ # The flag table is read out of Spotify's binary (make flags), so it comes from a secret
+ # instead of an IPA: gzip -9c tweak/Sources/Shared/Flags/SGFlagList.m | base64 | gh secret set SG_FLAG_LIST
+ - name: Flag table
+ env:
+ SG_FLAG_LIST: ${{ secrets.SG_FLAG_LIST }}
+ run: |
+ [ -n "$SG_FLAG_LIST" ] || { echo "::error::the SG_FLAG_LIST secret is not set"; exit 1; }
+ echo "$SG_FLAG_LIST" | base64 -d | gunzip > tweak/Sources/Shared/Flags/SGFlagList.m
+
+ - name: Build
+ run: env -u MAKELEVEL gmake -C tweak clean package
+
+ - name: Attach to the release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: gh release upload "${{ needs.release-please.outputs.tag }}" tweak/packages/*.deb --clobber
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 00000000..7b51ca08
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ ".": "0.17.0"
+}
diff --git a/AGENTS.md b/AGENTS.md
index de9b2010..d2b433dd 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -51,6 +51,9 @@ Rules:
- Look at Spotify's views through recorded trees (`make session` records clean ones into
`trees/clean/`) before hooking anything. Prove every class and selector against the tree or the binary.
- Device log: `make log` (`[spotifyglass]` lines).
+- Releases: Release Please (`.github/workflows/release.yml`). Commit as `feat:` / `fix:` (they bump
+ `version.txt` and fill `CHANGELOG.md`; `chore:`, `refactor:` and `docs:` stay out). Merging its
+ release PR tags `vX.Y.Z` and attaches the `.deb`. Never edit `version.txt` by hand.
- Known traps: anything pushed onto Spotify's nav stack must conform to `SPTPageController`
(`Settings/SGPage.m`). Setting `hidden` on views inside Spotify's `OverflowStackView` or its Encore
stacks crashes, so use alpha. A `CADisplayLink` capped at 60 Hz drags the player's 120 Hz
diff --git a/Makefile b/Makefile
index de250524..0d9b23c5 100644
--- a/Makefile
+++ b/Makefile
@@ -12,17 +12,13 @@ FLEX_ARG := $(if $(filter 0,$(FLEX)),--no-flex,)
DEV_NAME ?= spoti.dev
DEV_ICON ?= docs/icon.png
-.PHONY: build release install publish push trees session log flags
+.PHONY: build release install trees session log flags
build: ## FLEX + glass IPA into out/
./scripts/pipeline.sh $(IPA)
release: ## glass only, no FLEX
./scripts/pipeline.sh $(IPA) --no-flex
install: ## build, sign with your certificate, push to the phone on USB (FLEX=1 to take FLEX too)
./scripts/pipeline.sh $(IPA) --install $(FLEX_ARG) --name "$(DEV_NAME)" --icon "$(DEV_ICON)" -o out/spoti.dev.ipa
-publish: ## VERSION=0.15.0 NOTES="..." : bump control, write the site's release.json
- ./scripts/publish.sh stage "$(IPA)" "$(VERSION)" "$(NOTES)"
-push: ## commit and push the staged release in both repos
- ./scripts/publish.sh push
trees: ## record per-screen view trees into trees/ (needs a FLEX build on the phone)
./scripts/record-trees.py
session: ## record clean trees screen by screen into trees/clean/, Enter per snapshot, n for the next screen (SCREENS="playlist artist" for some)
diff --git a/README.md b/README.md
index 68dfa4eb..49f9f9ce 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,8 @@ own look with its tweaks.
No IPA is distributed, here or on [spoti.pw](https://spoti.pw). Fork the repo and
[build it yourself](#build-it-yourself) from your own decrypted Spotify IPA; the GitHub workflow
-needs no Mac. The Mod page tells you when a newer version is out.
+needs no Mac. Each [release](https://github.com/skopevoj/spoti.pw/releases) carries the tweak's
+`.deb` and its changelog, and the Mod page tells you when a newer one is out.
The app keeps Spotify's bundle id, so it installs over the real Spotify.
diff --git a/docs/tweaks.md b/docs/tweaks.md
index c5e641b3..1b9ba0b1 100644
--- a/docs/tweaks.md
+++ b/docs/tweaks.md
@@ -18,7 +18,7 @@
extension/LiveActivity/ the redesign's Live Activity widget, a WidgetKit extension of its own
scripts/ pipeline.sh (build + inject), build-extension.sh (the widget extension, without an
Xcode project), merge-appintents.py (the widget's intents into Spotify's), install.sh (sign + install), record-trees.py, record-session.py,
- dump-log.sh, extract-flags.py, publish.sh (release: version bump, site release.json)
+ dump-log.sh, extract-flags.py
trees/ recorded view trees, one per screen; the input for every new hook. trees/clean/ holds
the numbered snapshots per screen of record-session.py, taken of Spotify as it came
plist/ Info.plist overrides merged into the app (turns UIDesignRequiresCompatibility off)
diff --git a/release-please-config.json b/release-please-config.json
new file mode 100644
index 00000000..adc2e6cd
--- /dev/null
+++ b/release-please-config.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
+ "bootstrap-sha": "640f800",
+ "packages": {
+ ".": {
+ "release-type": "simple",
+ "package-name": "spoti.pw",
+ "include-component-in-tag": false,
+ "bump-minor-pre-major": true,
+ "changelog-sections": [
+ { "type": "feat", "section": "Features" },
+ { "type": "fix", "section": "Fixes" },
+ { "type": "perf", "section": "Performance" },
+ { "type": "revert", "section": "Reverts" },
+ { "type": "refactor", "section": "Refactors", "hidden": true },
+ { "type": "chore", "section": "Chores", "hidden": true },
+ { "type": "docs", "section": "Docs", "hidden": true }
+ ]
+ }
+ }
+}
diff --git a/scripts/publish.sh b/scripts/publish.sh
deleted file mode 100755
index baee3f75..00000000
--- a/scripts/publish.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-# Cuts a release in two steps. No IPA is hosted anywhere: people fork the repo and build their own,
-# so a release is only the version bump and the line the site and the Updates row show.
-#
-# make publish VERSION=0.15.0 NOTES="..." bump control, write the site's content/release.json with
-# the Spotify version read off ipa/. Nothing is committed.
-# make push commit and push both repos; Coolify rebuilds spoti.pw.
-#
-# WEB points at the site checkout, default ../custom_spotify_web.
-set -euo pipefail
-
-ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
-WEB="${WEB:-$ROOT/../custom_spotify_web}"
-RELEASE="$WEB/content/release.json"
-CONTROL="$ROOT/tweak/control"
-
-die() { echo "$*" >&2; exit 1; }
-control_version() { sed -n 's/^Version: //p' "$CONTROL"; }
-release_field() { python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))[sys.argv[2]])' "$RELEASE" "$1"; }
-
-stage() {
- local ipa="$1" version="$2" notes="$3"
- [ -f "$ipa" ] || die "no IPA: put the decrypted Spotify .ipa you tested on in ipa/, or pass one (make publish IPA=path.ipa ...)"
- [[ "$version" =~ ^[0-9]+(\.[0-9]+)+$ ]] || die "VERSION must look like 0.15.0, got '${version:-nothing}'"
- [ -n "$notes" ] || die "NOTES is empty: say what changed, it is the changelog on the site and in the app"
- [ -d "$WEB/content" ] || die "no site checkout at $WEB (set WEB=...)"
- [ "$version" = "$(control_version)" ] && echo "note: control already says $version" >&2
-
- sed -i '' "s/^Version: .*/Version: $version/" "$CONTROL"
-
- local app_dir plist spotify
- app_dir="$(unzip -Z1 "$ipa" | grep -oE '^Payload/[^/]+\.app/' | sort -u | head -1)"
- plist="$(mktemp)"
- unzip -p "$ipa" "${app_dir}Info.plist" > "$plist"
- spotify="$(plutil -extract CFBundleShortVersionString raw -o - "$plist")"
- rm -f "$plist"
-
- python3 - "$RELEASE" "$version" "$spotify" "$notes" <<'PY'
-import json, sys
-from datetime import date
-path, mod, spotify, notes = sys.argv[1:]
-json.dump({"mod": mod, "version": spotify, "date": date.today().isoformat(), "notes": notes}, open(path, "w"), indent=2)
-open(path, "a").write("\n")
-PY
-
- echo "==> staged $version on Spotify $spotify in $RELEASE, then: make push"
-}
-
-commit_if_changed() {
- local repo="$1" file="$2" mod="$3"
- [ -n "$(git -C "$repo" status --porcelain -- "$file")" ] || return 0
- git -C "$repo" add "$file"
- git -C "$repo" commit -m "release: $mod"
-}
-
-push() {
- local mod
- mod="$(release_field mod)"
- [ "$mod" = "$(control_version)" ] || die "release.json says $mod but control says $(control_version); run make publish"
- # Either file may already be committed by hand; then only the push is left.
- commit_if_changed "$WEB" content/release.json "$mod"
- git -C "$WEB" push
- commit_if_changed "$ROOT" tweak/control "$mod"
- git -C "$ROOT" push
- echo "==> $mod is live once Coolify finishes"
-}
-
-case "${1:-}" in
- stage) stage "$2" "$3" "$4" ;;
- push) push ;;
- *) sed -n '2,9p' "$0"; exit 1 ;;
-esac
diff --git a/tweak/Makefile b/tweak/Makefile
index 3e27c340..169289f1 100644
--- a/tweak/Makefile
+++ b/tweak/Makefile
@@ -2,12 +2,16 @@ TARGET := iphone:clang:latest:16.0
ARCHS := arm64
FINALPACKAGE := 1
+# version.txt at the repo root is the one version, bumped by Release Please's release PR. Theos
+# stamps PACKAGE_VERSION into the .deb (control has no Version line) and reads it while common.mk
+# loads, so it is set above the include.
+SG_VERSION := $(or $(shell cat ../version.txt 2>/dev/null),0.0.0)
+PACKAGE_VERSION := $(SG_VERSION)
+
include $(THEOS)/makefiles/common.mk
TWEAK_NAME := spotifyglass
-SG_VERSION := $(shell sed -n 's/^Version: //p' control)
-
# Every source under Sources/, so a new feature needs no Makefile edit. Shared/Flags/SGFlagList.m
# is generated from the IPA by scripts/extract-flags.py.
spotifyglass_FILES := $(shell find Sources -name '*.m' -o -name '*.x' -o -name '*.swift' | sort)
diff --git a/tweak/Sources/App/About/About.h b/tweak/Sources/App/About/About.h
index 2576962b..204a2280 100644
--- a/tweak/Sources/App/About/About.h
+++ b/tweak/Sources/App/About/About.h
@@ -1,11 +1,11 @@
-// About: where the build points its user, and whether the site has a newer one (Update.m). The
+// About: where the build points its user, and whether GitHub has a newer release (Update.m). The
// status is a string for the Updates row; the page's ticker reads it, so the check needs no
// callback. SGCheckForUpdate(NO) respects a six hour cache, SGCheckForUpdate(YES) always asks.
#import <UIKit/UIKit.h>
#import "Settings/SGModPage.h"
extern NSString *const SGUpdateURL; // the site and the repo are in Settings/SGPageStyle.h
-NSString *SGUpdateVersion(void); // nil unless the site has one newer than this build
+NSString *SGUpdateVersion(void); // nil unless GitHub has a release newer than this build
NSString *SGUpdateNotes(void);
NSString *SGUpdateStatus(void);
void SGCheckForUpdate(BOOL force);
diff --git a/tweak/Sources/App/About/AboutSettings.m b/tweak/Sources/App/About/AboutSettings.m
index 0920d0ef..a72dc033 100644
--- a/tweak/Sources/App/About/AboutSettings.m
+++ b/tweak/Sources/App/About/AboutSettings.m
@@ -32,7 +32,7 @@ static SGModRow *withSymbol(SGModRow *row, NSString *symbol) {
return row;
}
-// Which build this is, whether the site has a newer one, and where to reach the mod: without these
+// Which build this is, whether GitHub has a newer release, and where to reach the mod: without these
// rows a build that is already installed has no way of telling its user that anything moved on.
UIViewController *SGAboutPage(void) {
SGModRow *reset = withSymbol(SGActionRow(@"Reset all settings", @"Every switch off, Spotify as it came, then a restart", ^{ confirmReset(); }), @"trash");
@@ -40,7 +40,7 @@ UIViewController *SGAboutPage(void) {
NSString *spotify = [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: @"unknown";
return [[SGModPage alloc] initWithTitle:@"Mod" intro:nil sections:@[
SGSection(nil, @[
- SGStatActionRow(@"Updates", @"Asks the site for the newest build; tap to check now", ^NSString *{
+ SGStatActionRow(@"Updates", @"Asks GitHub for the newest release; tap to check now", ^NSString *{
return SGUpdateStatus();
}, ^{ SGCheckForUpdate(YES); }),
SGStatRow(@"Version", ^NSString *{ return @(SG_VERSION); }),
diff --git a/tweak/Sources/App/About/Update.m b/tweak/Sources/App/About/Update.m
index e440cdff..37ff59e3 100644
--- a/tweak/Sources/App/About/Update.m
+++ b/tweak/Sources/App/About/Update.m
@@ -1,10 +1,11 @@
-// The site's version.json, so a build that is already on someone's phone can tell them a newer one
-// exists. Fetched when the Mod Settings page opens, at most once every six hours, and on demand
-// from the Updates row; the reply is a static file and nothing but the request itself leaves.
+// The repo's latest GitHub Release, so a build that is already on someone's phone can tell them a
+// newer one exists. Fetched when the Mod Settings page opens, at most once every six hours, and on
+// demand from the Updates row; nothing but the request itself leaves. Builds from before 0.18 ask
+// spoti.pw/version.json instead, which the site still writes from the same release.
#import "Core/SGCore.h"
#import "About.h"
-NSString *const SGUpdateURL = @"https://spoti.pw/version.json";
+NSString *const SGUpdateURL = @"https://api.github.com/repos/skopevoj/spoti.pw/releases/latest";
static NSString *const kChecked = @"spotifyglass.update.checked";
static NSString *const kLatest = @"spotifyglass.update.latest";
@@ -56,16 +57,19 @@ void SGCheckForUpdate(BOOL force) {
sg_failure = nil;
NSURLSessionConfiguration *configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration;
configuration.timeoutIntervalForRequest = 10;
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:SGUpdateURL]
- cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
- timeoutInterval:10];
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:SGUpdateURL]
+ cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
+ timeoutInterval:10];
+ [request setValue:@"application/vnd.github+json" forHTTPHeaderField:@"Accept"];
NSURLSessionDataTask *task = [[NSURLSession sessionWithConfiguration:configuration]
dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSDictionary *json = data ? [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL] : nil;
if (![json isKindOfClass:NSDictionary.class]) json = nil;
- NSString *version = [json[@"version"] isKindOfClass:NSString.class] ? json[@"version"] : nil;
- NSString *notes = [json[@"notes"] isKindOfClass:NSString.class] ? json[@"notes"] : @"";
+ // Release Please tags v0.18.0; the body is the release's changelog.
+ NSString *tag = [json[@"tag_name"] isKindOfClass:NSString.class] ? json[@"tag_name"] : nil;
+ NSString *version = [tag hasPrefix:@"v"] ? [tag substringFromIndex:1] : tag;
+ NSString *notes = [json[@"body"] isKindOfClass:NSString.class] ? json[@"body"] : @"";
dispatch_async(dispatch_get_main_queue(), ^{
sg_running = NO;
if (!version) {
@@ -76,7 +80,7 @@ void SGCheckForUpdate(BOOL force) {
[store setObject:version forKey:kLatest];
[store setObject:notes forKey:kNotes];
[store setDouble:NSDate.date.timeIntervalSince1970 forKey:kChecked];
- SGLog(@"update check: the site has %@, this build is %s", version, SG_VERSION);
+ SGLog(@"update check: GitHub has %@, this build is %s", version, SG_VERSION);
});
}];
[task resume];
diff --git a/tweak/control b/tweak/control
index c028a043..06fc6190 100644
--- a/tweak/control
+++ b/tweak/control
@@ -1,6 +1,5 @@
Package: com.vojta.spotifyglass
Name: spotifyglass
-Version: 0.17.0
Architecture: iphoneos-arm
Description: Liquid Glass for the Spotify iOS app
Maintainer: vojta
diff --git a/version.txt b/version.txt
new file mode 100644
index 00000000..c5523bd0
--- /dev/null
+++ b/version.txt
@@ -0,0 +1 @@
+0.17.0