diff --git a/.gitignore b/.gitignore index 1f73f98..84870e9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ ios/build/ ios/Stemify.xcodeproj/ ios/Stemify/Info.plist ios/Stemify/Stemify.entitlements +ios/prov \ No newline at end of file diff --git a/ios/scripts/build-ipa.sh b/ios/scripts/build-ipa.sh index 2cc3f8a..b51f1e0 100755 --- a/ios/scripts/build-ipa.sh +++ b/ios/scripts/build-ipa.sh @@ -1,6 +1,7 @@ #!/bin/bash -# Builds build/stemify-.ipa on a Mac. Unsigned by default, for re-signing with Sideloadly/AltStore. -# With prov/Stemify.mobileprovision, prov/key.p12 and P12_PASS set, it signs with them (keeps CarPlay/Siri). +# Builds build/stemify-.ipa on a Mac: unsigned, for re-signing with Sideloadly/AltStore. +# With prov/Stemify.mobileprovision, prov/key.p12 and P12_PASS set, it also writes a signed +# prov/stemify--signed.ipa (keeps CarPlay/Siri) for the owner's own device. # Uses swiftc directly so it works even when xcodebuild/actool need -runFirstLaunch. set -euo pipefail cd "$(dirname "$0")/.." @@ -35,6 +36,10 @@ SRC=Stemify/Resources/Assets.xcassets/AppIcon.appiconset/icon.png sips -z 120 120 $SRC --out $APP/AppIcon60x60@2x.png >/dev/null sips -z 180 180 $SRC --out $APP/AppIcon60x60@3x.png >/dev/null +# Unsigned build, for the releases and AltStore/Sideloadly. +(cd $OUT && zip -qry stemify-$VERSION.ipa Payload) +echo "$OUT/stemify-$VERSION.ipa" + if [ -f prov/Stemify.mobileprovision ] && [ -f prov/key.p12 ] && [ -n "${P12_PASS:-}" ]; then KC=$PWD/$OUT/sign.keychain-db; KP=$(uuidgen) security create-keychain -p "$KP" $KC @@ -51,9 +56,10 @@ if [ -f prov/Stemify.mobileprovision ] && [ -f prov/key.p12 ] && [ -n "${P12_PAS /usr/libexec/PlistBuddy -x -c 'Print :Entitlements' $OUT/prov.plist > $OUT/ent.plist cp prov/Stemify.mobileprovision $APP/embedded.mobileprovision codesign -f -s "$ID" --entitlements $OUT/ent.plist --timestamp=none $APP + security list-keychains -d user -s $(security list-keychains -d user | tr -d "\"" | grep -v sign.keychain) security delete-keychain $KC - echo "signed as $ID" + # Personal build for this device only: stays in prov/ (gitignored), never released. + (cd $OUT && zip -qry ../prov/stemify-$VERSION-signed.ipa Payload) + echo "prov/stemify-$VERSION-signed.ipa (signed as $ID)" fi -(cd $OUT && zip -qry stemify-$VERSION.ipa Payload) -echo "$OUT/stemify-$VERSION.ipa"