Skip to content

Commit f665054

Browse files
committed
Updates unxip to be universal. Updates experiment icon to support OS11
1 parent 9fc2c7a commit f665054

File tree

7 files changed

+48
-38
lines changed

7 files changed

+48
-38
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,24 @@ You'll need macOS 11 Big Sur and Xcode 12 in order to build and run Xcodes.app.
4848

4949
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.
5050

51+
`Unxip` and `aria2` must be compiled as a universal binary
52+
```
53+
# compile for Intel
54+
swiftc -parse-as-library -O -target x86_64-apple-macos11 unxip.swift
55+
# compile for M1
56+
swiftc -parse-as-library -O -target arm64-apple-macos11 unxip.swift
57+
58+
# combine for universal binary
59+
lipo -create -output unxip unxip_intel unxip_m1
60+
# check it
61+
lipo -archs unxip
62+
```
63+
5164
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.
5265

5366
[`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.
5467

68+
5569
<details>
5670
<summary>Releasing a new version</summary>
5771

Scripts/notarize.sh

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,39 @@
1717
# https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow
1818
# Adapted from https://github.com/keybase/client/blob/46f5df0aa64ff19198ba7b044bbb7cd907c0be9f/packaging/desktop/package_darwin.sh
1919

20-
username="$1"
21-
password="$2"
22-
asc_provider="$3"
23-
file="$4"
20+
file="$1"
21+
team_id="$2"
2422

2523
echo "Uploading to notarization service"
2624

27-
uuid=$(xcrun altool \
28-
--notarize-app \
29-
--primary-bundle-id "com.robotsandpencils.XcodesApp.zip" \
30-
--username "$username" \
31-
--password "$password" \
32-
--asc-provider "$asc_provider" \
33-
--file "$file" 2>&1 | \
34-
grep 'RequestUUID' | \
35-
awk '{ print $3 }')
25+
result=$(xcrun notarytool submit "$file" \
26+
--keychain-profile "AC_PASSWORD" \
27+
--team-id "$team_id" \
28+
--wait)
29+
# echo "done1"
30+
echo $result
31+
32+
# My grep/awk is bad and I can't figure out how to get the UUID out properly
33+
# uuid=$("$result" | \
34+
# grep 'id:' | tail -n1 | \
35+
# cut -d":" -f2-)
3636

3737
echo "Successfully uploaded to notarization service, polling for result: $uuid"
3838

39-
sleep 15
40-
while :
41-
do
42-
fullstatus=$(xcrun altool \
43-
--notarization-info "$uuid" \
44-
--username "$username" \
45-
--password "$password" \
46-
--asc-provider "$asc_provider" 2>&1)
47-
status=$(echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }')
48-
if [ "$status" = "success" ]; then
49-
echo "Notarization success"
50-
exit 0
51-
elif [ "$status" = "in" ]; then
52-
echo "Notarization still in progress, sleeping for 15 seconds and trying again"
53-
sleep 15
54-
else
55-
echo "Notarization failed, full status below"
56-
echo "$fullstatus"
57-
exit 1
58-
fi
59-
done
39+
# we should check here using the info (or notarytool log) to check the results and log
40+
#
41+
42+
# fullstatus=$(xcrun notarytool info "$uuid" \
43+
# --keychain-profile "AC_PASSWORD" 2>&1)
44+
# status=$(echo "$fullstatus" | grep 'status\:' | awk '{ print $2 }')
45+
# if [ "$status" = "Accepted" ]; then
46+
# echo "Notarization success"
47+
# exit 0
48+
# else
49+
# echo "Notarization failed, full status below"
50+
# echo "$fullstatus"
51+
# exit 1
52+
# fi
6053

6154
# Remove .zip
6255
rm $file
@@ -66,4 +59,4 @@ app_path="$(basename -s ".zip" "$file").app"
6659
xcrun stapler staple "$app_path"
6760

6861
# Zip the stapled app for distribution
69-
ditto -c -k --sequesterRsrc --keepParent "$file" "$app_path"
62+
ditto -c -k --sequesterRsrc --keepParent "$app_path" "$file"

Scripts/package_release.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ PROJECT_DIR=$(pwd)/$PROJECT_NAME/Resources
1010
SCRIPTS_DIR=$(pwd)/Scripts
1111
INFOPLIST_FILE="Info.plist"
1212

13+
# If needed ensure that the unxip binary is signed with a hardened runtime so we can notarize
14+
# codesign --force --options runtime --sign "Developer ID Application: Robots and Pencils Inc." $PROJECT_DIR/unxip
15+
1316
# Ensure a clean build
1417
rm -rf Archive/*
1518
rm -rf Product/*

Xcodes/Frontend/About/AboutView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct AboutView: View {
2929
}
3030
Color.clear
3131
.frame(width: 300, height: 0)
32-
Label("Unxip Experiment", systemImage: "testtube.2")
32+
Label("Unxip Experiment", systemImage: "lightbulb")
3333
HStack(spacing: 32) {
3434
Button(action: {
3535
openURL(URL(string: "https://github.com/saagarjha/unxip/")!)

Xcodes/Frontend/Preferences/PreferencesView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct PreferencesView: View {
2727
.tag(Tabs.advanced)
2828
ExperimentsPreferencePane()
2929
.tabItem {
30-
Label("Experiments", systemImage: "testtube.2")
30+
Label("Experiments", systemImage: "lightbulb")
3131
}
3232
.tag(Tabs.experiment)
3333
}

Xcodes/Resources/Licenses.rtf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2636
1+
{\rtf1\ansi\ansicpg1252\cocoartf2638
22
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;}
33
{\colortbl;\red255\green255\blue255;}
44
{\*\expandedcolortbl;;}

Xcodes/Resources/unxip

272 KB
Binary file not shown.

0 commit comments

Comments
 (0)