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: an untested option keeps Spotify's Apple Watch app in the build

My-Name-Is-Jeff9becfa31f43d
diff --git a/README.md b/README.md
index c4e5852c..e49adaf8 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,11 @@ Put the decrypted `.ipa` in `ipa/`, then:
make release # out/vitrine-<version>.ipa, ready to sign
make install # the same, signed with your certificate and installed over USB or Wi-Fi
+`scripts/pipeline.sh <ipa> --no-flex --keep-watch` keeps Spotify's Apple Watch app (**untested**). Only its
+arm64 build survives decryption on an iPhone, so it can run only on an Apple Watch Series 9, Ultra 2 or newer, and
+it needs a signer that renames the Watch app to your App ID and signs it with a profile of its own that includes the
+Watch. `make install` does not do that yet.
+
`make install` reads `SIGN_P12`, `SIGN_PROFILE` and `SIGN_P12_PASSWORD` from `.signing.env`; copy
`.signing.env.example` and fill it in.
diff --git a/scripts/pipeline.sh b/scripts/pipeline.sh
index fee132f6..48fedb9f 100755
--- a/scripts/pipeline.sh
+++ b/scripts/pipeline.sh
@@ -1,7 +1,14 @@
#!/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] [--name N] [--icon P.png] (or: make build / make install)
+# scripts/pipeline.sh <decrypted.ipa> [-o out.ipa] [--no-flex] [--install] [--name N] [--icon P.png] [--keep-watch]
+# (or: make build / make install)
+#
+# --keep-watch keeps Spotify's Apple Watch app, untested. Only its arm64 build is decrypted in an IPA dumped on an
+# iPhone (the arm64_32 one older Watches run stays encrypted and is taken out), so it can only run on a Watch from
+# Series 9 and Ultra 2 on. Its companion key names com.spotify.client until it is signed: the signer has to rename
+# it and the Watch app's ids to the signing App ID, and sign the Watch app with a profile of its own that covers
+# the Watch.
#
# Every icons/NAME.png becomes an alternate icon (icons/README.md).
#
@@ -26,7 +33,7 @@ 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 NAME="" ICON=""
+IN="" OUT="" WITH_FLEX=1 INSTALL=0 NAME="" ICON="" KEEP_WATCH=""
while [ $# -gt 0 ]; do
case "$1" in
-o) OUT="$2"; shift 2 ;;
@@ -34,6 +41,7 @@ while [ $# -gt 0 ]; do
--icon) ICON="$2"; shift 2 ;;
--no-flex) WITH_FLEX=0; shift ;;
--install) INSTALL=1; shift ;;
+ --keep-watch) KEEP_WATCH=1; shift ;;
-h|--help) sed -n '2,11p' "$0"; exit 0 ;;
*) IN="$1"; shift ;;
esac
@@ -129,9 +137,25 @@ rm -f "$ROOT/out/.info.plist"
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 "$OVERLAY" ${BUNDLE_ID:+-b "$BUNDLE_ID"} ${NAME:+-n "$NAME"} ${ICON:+-k "$ICON"} -w -s --overwrite
+WATCH=(-w)
+[ -n "$KEEP_WATCH" ] && WATCH=()
+cyan -i "$IN" -o "$OUT" -f "${FILES[@]}" -l "$OVERLAY" ${BUNDLE_ID:+-b "$BUNDLE_ID"} ${NAME:+-n "$NAME"} ${ICON:+-k "$ICON"} ${WATCH[@]+"${WATCH[@]}"} -s --overwrite
rm -f "$OVERLAY"
+if [ -n "$KEEP_WATCH" ]; then
+ echo "==> keeping the Watch app, its arm64 build only (untested)"
+ PATCH="$(mktemp -d)"
+ OUT_ABS="$(cd "$(dirname "$OUT")" && pwd)/$(basename "$OUT")"
+ (cd "$PATCH" && unzip -q "$OUT_ABS" "${APP_DIR}Watch/*")
+ # The arm64_32 build is still encrypted with the App Store's DRM and could never run; the DRM records go too.
+ find "$PATCH/${APP_DIR}Watch" -type f -perm -u+x | while read -r bin; do
+ if lipo -archs "$bin" 2>/dev/null | grep -qw arm64_32; then lipo -remove arm64_32 "$bin" -output "$bin"; fi
+ done
+ find "$PATCH/${APP_DIR}Watch" -type d -name SC_Info -prune -exec rm -rf {} +
+ zip -q -d "$OUT_ABS" "${APP_DIR}Watch/*" >/dev/null
+ (cd "$PATCH" && zip -q -r "$OUT_ABS" "${APP_DIR}Watch")
+ rm -rf "$PATCH"
+fi
echo "==> loading the App Group shim in the home screen widget"
WIDGET_BIN="${APP_DIR}PlugIns/WidgetExtension.appex/WidgetExtension"
if unzip -l "$OUT" "$WIDGET_BIN" >/dev/null 2>&1; then