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: install local builds as spoti.dev with their own icon

Vojtěch Škopek8c2f73aeb16d
diff --git a/Makefile b/Makefile
index 34d4690e..9f1b4729 100644
--- a/Makefile
+++ b/Makefile
@@ -7,13 +7,18 @@ IPA ?= $(firstword $(wildcard ipa/*.ipa))
FLEX ?= 0
FLEX_ARG := $(if $(filter 0,$(FLEX)),--no-flex,)
+# A local install is renamed and re-iconed so it is told apart from the released app on the home
+# screen. It writes its own file, so publish's SKIP_BUILD=1 (newest *-glass.ipa) never picks it up.
+DEV_NAME ?= spoti.dev
+DEV_ICON ?= docs/icon.png
+
.PHONY: build release install publish push trees 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)
+ ./scripts/pipeline.sh $(IPA) --install $(FLEX_ARG) --name "$(DEV_NAME)" --icon "$(DEV_ICON)" -o out/spoti.dev.ipa
publish: ## VERSION=0.15.0 NOTES="..." : build, upload to catbox, write the site's release.json, print the link
./scripts/publish.sh stage "$(IPA)" "$(VERSION)" "$(NOTES)"
push: ## commit and push the staged release in both repos (after testing the link)
diff --git a/scripts/pipeline.sh b/scripts/pipeline.sh
index 65605382..1bc91149 100755
--- a/scripts/pipeline.sh
+++ b/scripts/pipeline.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Builds the spotifyglass tweak and injects it (plus FLEX) into a decrypted Spotify IPA.
#
-# scripts/pipeline.sh <decrypted.ipa> [-o out.ipa] [--no-flex] [--install] (or: make build / make install)
+# scripts/pipeline.sh <decrypted.ipa> [-o out.ipa] [--no-flex] [--install] [--name N] [--icon P.png] (or: make build / make install)
#
# --install hands the result to install.sh (sign with your certificate, push to the plugged-in iPhone).
#
@@ -24,10 +24,12 @@ FLEX_DEB="$ROOT/vendor/com.hopeless.autoflex_0.0.1_iphoneos-arm.deb"
BUNDLE_ID="${BUNDLE_ID:-}"
mkdir -p "$ROOT/out"
-IN="" OUT="" WITH_FLEX=1 INSTALL=0
+IN="" OUT="" WITH_FLEX=1 INSTALL=0 NAME="" ICON=""
while [ $# -gt 0 ]; do
case "$1" in
-o) OUT="$2"; shift 2 ;;
+ --name) NAME="$2"; shift 2 ;;
+ --icon) ICON="$2"; shift 2 ;;
--no-flex) WITH_FLEX=0; shift ;;
--install) INSTALL=1; shift ;;
-h|--help) sed -n '2,11p' "$0"; exit 0 ;;
@@ -43,6 +45,12 @@ need ldid "brew install ldid"
need dpkg-deb "brew install dpkg"
need cyan "uv tool install 'cyan @ git+https://github.com/asdfzxcvbn/pyzule-rw'"
ls "$THEOS"/sdks/iPhoneOS*.sdk >/dev/null 2>&1 || { echo "no iPhoneOS SDK in $THEOS/sdks" >&2; exit 1; }
+# cyan skips -k with only a warning when its environment has no Pillow.
+if [ -n "$ICON" ]; then
+ [ -f "$ICON" ] || { echo "no such icon: $ICON" >&2; exit 1; }
+ "$(dirname "$(readlink -f "$(command -v cyan)")")/python" -c 'import PIL' 2>/dev/null \
+ || { echo "cyan has no Pillow for --icon -> uv tool install --force --with pillow 'cyan @ git+https://github.com/asdfzxcvbn/pyzule-rw'" >&2; exit 1; }
+fi
APP_DIR="$(unzip -Z1 "$IN" | grep -oE '^Payload/[^/]+\.app/' | sort -u | head -1)"
[ -n "$APP_DIR" ] || { echo "no Payload/*.app in $IN" >&2; exit 1; }
@@ -74,7 +82,7 @@ FILES=("$TWEAK_DEB")
echo "==> injecting"
# -w drops the Watch app: its companion-app key would still name com.spotify.client and block the install.
-cyan -i "$IN" -o "$OUT" -f "${FILES[@]}" -l "$ROOT/plist/liquid-glass.plist" ${BUNDLE_ID:+-b "$BUNDLE_ID"} -w -s --overwrite
+cyan -i "$IN" -o "$OUT" -f "${FILES[@]}" -l "$ROOT/plist/liquid-glass.plist" ${BUNDLE_ID:+-b "$BUNDLE_ID"} ${NAME:+-n "$NAME"} ${ICON:+-k "$ICON"} -w -s --overwrite
echo "==> done: $OUT"
[ "$INSTALL" = 1 ] && exec "$ROOT/scripts/install.sh" "$OUT"