diff --git a/README.md b/README.md index b44a925..6e8fb7b 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,24 @@ You'll need macOS 11 Big Sur and Xcode 12 in order to build and run Xcodes.app. If you aren't a Robots and Pencils employee you'll need to change the CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT build setting to your Apple Developer team ID in order for code signing validation to succeed between the main app and the privileged helper. +`Unxip` and `aria2` must be compiled as a universal binary +``` +# compile for Intel + swiftc -parse-as-library -O -target x86_64-apple-macos11 unxip.swift +# compile for M1 + swiftc -parse-as-library -O -target arm64-apple-macos11 unxip.swift + +# combine for universal binary + lipo -create -output unxip unxip_intel unxip_m1 +# check it + lipo -archs unxip +``` + Notable design decisions are recorded in [DECISIONS.md](./DECISIONS.md). The Apple authentication flow is described in [Apple.paw](./Apple.paw), which will allow you to play with the API endpoints that are involved using the [Paw](https://paw.cloud) app. [`xcode-install`](https://github.com/xcpretty/xcode-install) and [fastlane/spaceship](https://github.com/fastlane/fastlane/tree/master/spaceship) both deserve credit for figuring out the hard parts of what makes this possible. +
Releasing a new version diff --git a/Scripts/notarize.sh b/Scripts/notarize.sh index b9dd426..a2ab52f 100755 --- a/Scripts/notarize.sh +++ b/Scripts/notarize.sh @@ -17,46 +17,39 @@ # https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow # Adapted from https://github.com/keybase/client/blob/46f5df0aa64ff19198ba7b044bbb7cd907c0be9f/packaging/desktop/package_darwin.sh -username="$1" -password="$2" -asc_provider="$3" -file="$4" +file="$1" +team_id="$2" echo "Uploading to notarization service" -uuid=$(xcrun altool \ - --notarize-app \ - --primary-bundle-id "com.robotsandpencils.XcodesApp.zip" \ - --username "$username" \ - --password "$password" \ - --asc-provider "$asc_provider" \ - --file "$file" 2>&1 | \ - grep 'RequestUUID' | \ - awk '{ print $3 }') +result=$(xcrun notarytool submit "$file" \ + --keychain-profile "AC_PASSWORD" \ + --team-id "$team_id" \ + --wait) +# echo "done1" +echo $result + +# My grep/awk is bad and I can't figure out how to get the UUID out properly +# uuid=$("$result" | \ +# grep 'id:' | tail -n1 | \ +# cut -d":" -f2-) echo "Successfully uploaded to notarization service, polling for result: $uuid" -sleep 15 - while : - do - fullstatus=$(xcrun altool \ - --notarization-info "$uuid" \ - --username "$username" \ - --password "$password" \ - --asc-provider "$asc_provider" 2>&1) - status=$(echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }') - if [ "$status" = "success" ]; then - echo "Notarization success" - exit 0 - elif [ "$status" = "in" ]; then - echo "Notarization still in progress, sleeping for 15 seconds and trying again" - sleep 15 - else - echo "Notarization failed, full status below" - echo "$fullstatus" - exit 1 - fi - done +# we should check here using the info (or notarytool log) to check the results and log +# + +# fullstatus=$(xcrun notarytool info "$uuid" \ +# --keychain-profile "AC_PASSWORD" 2>&1) +# status=$(echo "$fullstatus" | grep 'status\:' | awk '{ print $2 }') +# if [ "$status" = "Accepted" ]; then +# echo "Notarization success" +# exit 0 +# else +# echo "Notarization failed, full status below" +# echo "$fullstatus" +# exit 1 +# fi # Remove .zip rm $file @@ -66,4 +59,4 @@ app_path="$(basename -s ".zip" "$file").app" xcrun stapler staple "$app_path" # Zip the stapled app for distribution -ditto -c -k --sequesterRsrc --keepParent "$file" "$app_path" +ditto -c -k --sequesterRsrc --keepParent "$app_path" "$file" diff --git a/Scripts/package_release.sh b/Scripts/package_release.sh index 3cbd887..a56e14c 100755 --- a/Scripts/package_release.sh +++ b/Scripts/package_release.sh @@ -10,6 +10,9 @@ PROJECT_DIR=$(pwd)/$PROJECT_NAME/Resources SCRIPTS_DIR=$(pwd)/Scripts INFOPLIST_FILE="Info.plist" +# If needed ensure that the unxip binary is signed with a hardened runtime so we can notarize +# codesign --force --options runtime --sign "Developer ID Application: Robots and Pencils Inc." $PROJECT_DIR/unxip + # Ensure a clean build rm -rf Archive/* rm -rf Product/* diff --git a/Xcodes/Frontend/About/AboutView.swift b/Xcodes/Frontend/About/AboutView.swift index b89004b..94993f6 100644 --- a/Xcodes/Frontend/About/AboutView.swift +++ b/Xcodes/Frontend/About/AboutView.swift @@ -29,7 +29,7 @@ struct AboutView: View { } Color.clear .frame(width: 300, height: 0) - Label("Unxip Experiment", systemImage: "testtube.2") + Label("Unxip Experiment", systemImage: "lightbulb") HStack(spacing: 32) { Button(action: { openURL(URL(string: "https://github.com/saagarjha/unxip/")!) diff --git a/Xcodes/Frontend/Preferences/PreferencesView.swift b/Xcodes/Frontend/Preferences/PreferencesView.swift index b4cbc2c..8b773e8 100644 --- a/Xcodes/Frontend/Preferences/PreferencesView.swift +++ b/Xcodes/Frontend/Preferences/PreferencesView.swift @@ -27,7 +27,7 @@ struct PreferencesView: View { .tag(Tabs.advanced) ExperimentsPreferencePane() .tabItem { - Label("Experiments", systemImage: "testtube.2") + Label("Experiments", systemImage: "lightbulb") } .tag(Tabs.experiment) } diff --git a/Xcodes/Resources/Licenses.rtf b/Xcodes/Resources/Licenses.rtf index 0888bd6..4800d6a 100644 --- a/Xcodes/Resources/Licenses.rtf +++ b/Xcodes/Resources/Licenses.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2636 +{\rtf1\ansi\ansicpg1252\cocoartf2638 \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;} {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;;} diff --git a/Xcodes/Resources/unxip b/Xcodes/Resources/unxip index cd304ee..271171c 100755 Binary files a/Xcodes/Resources/unxip and b/Xcodes/Resources/unxip differ