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 alongside the stock app

Vojtěch Škopekdd72e150b3fe
diff --git a/.gitignore b/.gitignore
index 002eb409..61a61395 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,12 @@
!trees/screens.txt
*.ipa
+*.mobileprovision
+*.p12
.DS_Store
.signing.env
+Developer/
+Distribution/
+Password*.txt
__pycache__/
out/
trees/*.txt
diff --git a/README.md b/README.md
index b959bc3b..9d5134ae 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,8 @@ signed and installed from the Mac.
Needs Theos in `~/theos` with an iPhoneOS SDK, Homebrew `make ldid dpkg zsign ideviceinstaller
libimobiledevice`, and cyan (`uv tool install "cyan @ git+https://github.com/asdfzxcvbn/pyzule-rw"`).
-Signing reads `SIGN_P12`, `SIGN_PROFILE` and `SIGN_P12_PASSWORD` from `.signing.env`.
+Signing reads `SIGN_P12`, `SIGN_PROFILE` and `SIGN_P12_PASSWORD` from `.signing.env`. The app is
+re-identified as `com.spotify.client2` so it installs next to the real Spotify (`BUNDLE_ID=` overrides).
## Adding a tweak
diff --git a/scripts/install.sh b/scripts/install.sh
index 390e735c..033eeec3 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -12,6 +12,7 @@ set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
[ -f "$ROOT/.signing.env" ] && . "$ROOT/.signing.env"
+cd "$ROOT"
: "${SIGN_P12:?set SIGN_P12 in .signing.env}" "${SIGN_PROFILE:?set SIGN_PROFILE in .signing.env}" "${SIGN_P12_PASSWORD:?set SIGN_P12_PASSWORD in .signing.env}"
IN="${1:?usage: $0 <ipa>}"
@@ -20,7 +21,30 @@ SIGNED="${IN%.ipa}-signed.ipa"
command -v zsign >/dev/null || { echo "missing zsign -> brew install zsign" >&2; exit 1; }
command -v ideviceinstaller >/dev/null || { echo "missing ideviceinstaller -> brew install ideviceinstaller" >&2; exit 1; }
-echo "==> signing"
-zsign -k "$SIGN_P12" -p "$SIGN_P12_PASSWORD" -m "$SIGN_PROFILE" -z 1 -o "$SIGNED" "$IN" >/dev/null
+# A profile with a fixed App ID (signing services) may only install when the bundle id equals that
+# App ID. Try the IPA's own bundle id first; fall back to the App ID if iOS rejects the signature.
+PROFILE_PLIST="$(mktemp)"
+security cms -D -i "$SIGN_PROFILE" > "$PROFILE_PLIST" 2>/dev/null
+APP_ID="$(plutil -extract Entitlements.application-identifier raw -o - "$PROFILE_PLIST" 2>/dev/null || true)"
+rm -f "$PROFILE_PLIST"
+APP_ID="${APP_ID#*.}"
+
+sign() { # sign [bundle id]
+ echo "==> signing${1:+ as $1}"
+ zsign -k "$SIGN_P12" -p "$SIGN_P12_PASSWORD" -m "$SIGN_PROFILE" ${1:+-b "$1"} -z 1 -o "$SIGNED" "$IN" >/dev/null
+}
+
+sign
echo "==> installing $SIGNED"
-ideviceinstaller ${WIFI:+-n} -i "$SIGNED"
+set +e
+OUTPUT="$(ideviceinstaller ${WIFI:+-n} install "$SIGNED" 2>&1)"
+STATUS=$?
+set -e
+echo "$OUTPUT" | tail -3
+if [ $STATUS -ne 0 ] && [ -n "$APP_ID" ] && [ "$APP_ID" != "*" ] && echo "$OUTPUT" | grep -qiE "entitlement|application-identifier|signature|ApplicationVerificationFailed"; then
+ echo "==> iOS rejected that bundle id with this profile, retrying as $APP_ID"
+ sign "$APP_ID"
+ ideviceinstaller ${WIFI:+-n} install "$SIGNED" 2>&1 | tail -3
+elif [ $STATUS -ne 0 ]; then
+ exit $STATUS
+fi
diff --git a/scripts/pipeline.sh b/scripts/pipeline.sh
index f80116da..094c0953 100755
--- a/scripts/pipeline.sh
+++ b/scripts/pipeline.sh
@@ -12,6 +12,8 @@ set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
THEOS="${THEOS:-$HOME/theos}"
FLEX_DEB="$ROOT/vendor/com.hopeless.autoflex_0.0.1_iphoneos-arm.deb"
+# Installs next to the real Spotify instead of replacing it. Override: BUNDLE_ID=com.spotify.client make build
+BUNDLE_ID="${BUNDLE_ID:-com.spotify.client2}"
IN="" OUT="" WITH_FLEX=1 INSTALL=0
while [ $# -gt 0 ]; do
@@ -51,7 +53,8 @@ FILES=("$TWEAK_DEB")
[ "$WITH_FLEX" = 1 ] && FILES+=("$FLEX_DEB")
echo "==> injecting"
-cyan -i "$IN" -o "$OUT" -f "${FILES[@]}" -l "$ROOT/plist/liquid-glass.plist" -s --overwrite
+# -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" -b "$BUNDLE_ID" -w -s --overwrite
echo "==> done: $OUT"
[ "$INSTALL" = 1 ] && exec "$ROOT/scripts/install.sh" "$OUT"