Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
BIG-RAT committed Dec 11, 2023
1 parent a3b4cf9 commit 7f49568
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Important:
Thanks @fauxserve for coming up with the idea and initial bash version.

## History

- 2023-12-10: Fix authentication issue with Jamf Pro 11.

- 2023-04-20: Remove check for SSL verification. Require a trusted server certificate. Better notification if package install fails.

- 2022-11-07: Add ability to suppress notifications about a background process ReEnroller installs.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
revealArchiveInOrganizer = "NO">
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# notarytool credentials.&#10;# AC_PASSWORD is the name of the keychain item created with `notarytool store-credentials`.&#10;# Grant keychain access to Xcode if prompted by Xcode.&#10;AC_PASSWORD=&quot;nt_password&quot;&#10;&#10;# Do all of the work in a subdirectory of /tmp, and use a&#10;# unique ID so that there&apos;s no collision with previous builds.&#10;##EXPORT_UUID=`uuidgen`&#10;##EXPORT_PATH=&quot;/tmp/$PRODUCT_NAME-$EXPORT_UUID/&quot;&#10;&#10;## create folder to hold exported app&#10;newMajor=&quot;$(date -u +%Y%m%d)&quot;&#10;date24H=$(date -u +%H%M)&#10;tmpMinor=$(printf &quot;%x\n&quot; $(echo $date24H | sed &apos;s/^0*//&apos;))&#10;newMinor=$(echo $tmpMinor | tr &apos;[:lower:]&apos; &apos;[:upper:]&apos;)&#10;newBuildNumber=&quot;$newMajor-$newMinor&quot;&#10;&#10;shortVer=&quot;v${MARKETING_VERSION}&quot;&#10;exeName=&quot;${EXECUTABLE_NAME}&quot;&#10;EXPORT_PATH=&quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/$newBuildNumber&quot;&#10;APP_PATH=&quot;$EXPORT_PATH/$PRODUCT_NAME.app&quot;&#10;DMG_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;ZIP_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.zip&quot;&#10;&#10;if [ ! -d &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/previous&quot; ];then&#10; mkdir -p &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/previous&quot;&#10;fi&#10;VER_PATH=&quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer&quot;&#10;while read item; do&#10; echo &quot;move $item to &apos;previous&apos; folder&quot;&#10; mv &quot;$VER_PATH/$item&quot; &quot;$VER_PATH/previous/&quot;&#10;done &lt;&lt; EOL &#10;$(ls &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer&quot; | grep -v previous)&#10;EOL&#10;&#10;if [ ! -d &quot;$EXPORT_PATH&quot; ];then&#10; mkdir -p &quot;$EXPORT_PATH&quot;&#10;fi&#10;&#10;&#10;# Xcode doesn&apos;t show run script errors in build log.&#10;exec &gt; &quot;$EXPORT_PATH/Xcode run script.log&quot; 2&gt;&amp;1&#10;# open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;&#10;# Use osascript(1) to present notification banners; otherwise&#10;# there&apos;s no progress indication until the script finishes.&#10;/usr/bin/osascript -e &apos;display notification &quot;Exporting application archive&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Ask xcodebuild(1) to export the app. Use the export options&#10;# from a previous manual export that used a Developer ID.&#10;##/usr/bin/xcodebuild -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;$SRCROOT/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH&quot;&#10;/usr/bin/xcodebuild -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;/Users/lesliehelou/Documents/GitHub/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH/&quot;&#10;&#10;osascript -e &apos;display notification &quot;Creating UDIF Disk Image&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Create a UDIF bzip2-compressed disk image.&#10;cd &quot;$EXPORT_PATH/&quot;&#10;mkdir &quot;$PRODUCT_NAME&quot;&#10;mv -v &quot;$APP_PATH&quot; &quot;$PRODUCT_NAME&quot;&#10;&#10;/usr/bin/hdiutil create -srcfolder &quot;$PRODUCT_NAME&quot; -format UDBZ &quot;$DMG_PATH&quot;&#10;&#10;osascript -e &apos;display notification &quot;Submitting UDIF Disk Image for notarization&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Submit the finished deliverables for notarization.&#10;# Wait up to 2 hours for a response.&#10;# Use verbose logging in order to file feedback if an error occurs.&#10;## &quot;$DEVELOPER_BIN_DIR/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&#10;return_code=$?&#10;&#10;if [ $return_code -eq 0 ]; then&#10; message=`/usr/libexec/PlistBuddy -c &quot;Print :message&quot; &quot;NotarizationResponse.plist&quot;`&#10; status=`/usr/libexec/PlistBuddy -c &quot;Print :status&quot; &quot;NotarizationResponse.plist&quot;`&#10;else&#10; message=&quot;An Error Occurred.&quot;&#10; status=&quot;Check Xcode log.&quot;&#10;## open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;fi&#10;&#10;# Show and speak the final status.&#10;osascript -e &quot;on run(argv)&quot; \&#10;-e &apos;display notification item 1 of argv &amp; &quot; : &quot; &amp; item 2 of argv with title &quot;Submitting app for notarization&quot; sound name &quot;Crystal&quot;&apos; \&#10;-e &apos;set text item delimiters to &quot;, &quot;&apos; \&#10;-e &quot;set args to argv as text&quot; \&#10;-e &quot;say args&quot; \&#10;-e &quot;delay 5&quot; \&#10;-e &quot;end&quot; \&#10;-- &quot;$message&quot; &quot;$status&quot;&#10;&#10;wait 5&#10;xcrun stapler staple &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot;&#10;xcrun stapler staple &quot;${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;&#10;if [ -e &quot;$ZIP_PATH&quot; ];then&#10; rm -f &quot;$ZIP_PATH&quot;&#10;fi&#10;/usr/bin/ditto -c -k --keepParent &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot; &quot;$ZIP_PATH&quot;&#10;&#10;# Open the folder that was created, which also signals completion.&#10;open &quot;$EXPORT_PATH&quot;&#10;&#10;&#10;&#10;&#10;">
scriptText = "# notarytool credentials.&#10;# AC_PASSWORD is the name of the keychain item created with `notarytool store-credentials`.&#10;# Grant keychain access to Xcode if prompted by Xcode.&#10;AC_PASSWORD=&quot;nt_password&quot;&#10;&#10;# Do all of the work in a subdirectory of /tmp, and use a&#10;# unique ID so that there&apos;s no collision with previous builds.&#10;##EXPORT_UUID=`uuidgen`&#10;##EXPORT_PATH=&quot;/tmp/$PRODUCT_NAME-$EXPORT_UUID/&quot;&#10;&#10;## create folder to hold exported app&#10;newMajor=&quot;$(date -u +%Y%m%d)&quot;&#10;date24H=$(date -u +%H%M)&#10;tmpMinor=$(printf &quot;%x\n&quot; $(echo $date24H | sed &apos;s/^0*//&apos;))&#10;newMinor=$(echo $tmpMinor | tr &apos;[:lower:]&apos; &apos;[:upper:]&apos;)&#10;newBuildNumber=&quot;$newMajor-$newMinor&quot;&#10;&#10;shortVer=&quot;v${MARKETING_VERSION}&quot;&#10;exeName=&quot;${EXECUTABLE_NAME}&quot;&#10;EXPORT_PATH=&quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/$newBuildNumber&quot;&#10;APP_PATH=&quot;$EXPORT_PATH/$PRODUCT_NAME.app&quot;&#10;DMG_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;ZIP_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.zip&quot;&#10;&#10;if [ ! -d &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/previous&quot; ];then&#10; mkdir -p &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/previous&quot;&#10;fi&#10;VER_PATH=&quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer&quot;&#10;while read item; do&#10; echo &quot;move $item to &apos;previous&apos; folder&quot;&#10; mv &quot;$VER_PATH/$item&quot; &quot;$VER_PATH/previous/&quot;&#10;done &lt;&lt; EOL &#10;$(ls &quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer&quot; | grep -v previous)&#10;EOL&#10;&#10;if [ ! -d &quot;$EXPORT_PATH&quot; ];then&#10; mkdir -p &quot;$EXPORT_PATH&quot;&#10;fi&#10;&#10;&#10;# Xcode doesn&apos;t show run script errors in build log.&#10;exec &gt; &quot;$EXPORT_PATH/Xcode run script.log&quot; 2&gt;&amp;1&#10;open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;&#10;# Use osascript(1) to present notification banners; otherwise&#10;# there&apos;s no progress indication until the script finishes.&#10;/usr/bin/osascript -e &apos;display notification &quot;Exporting application archive&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Ask xcodebuild(1) to export the app. Use the export options&#10;# from a previous manual export that used a Developer ID.&#10;##/usr/bin/xcodebuild -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;$SRCROOT/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH&quot;&#10;/usr/bin/xcodebuild -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;/Users/lesliehelou/Documents/GitHub/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH/&quot;&#10;&#10;osascript -e &apos;display notification &quot;Creating UDIF Disk Image&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Create a UDIF bzip2-compressed disk image.&#10;cd &quot;$EXPORT_PATH/&quot;&#10;mkdir &quot;$PRODUCT_NAME&quot;&#10;mv -v &quot;$APP_PATH&quot; &quot;$PRODUCT_NAME&quot;&#10;&#10;/usr/bin/hdiutil create -srcfolder &quot;$PRODUCT_NAME&quot; -format UDBZ &quot;$DMG_PATH&quot;&#10;&#10;osascript -e &apos;display notification &quot;Submitting UDIF Disk Image for notarization&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Submit the finished deliverables for notarization.&#10;# Wait up to 2 hours for a response.&#10;# Use verbose logging in order to file feedback if an error occurs.&#10;## &quot;$DEVELOPER_BIN_DIR/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&#10;return_code=$?&#10;&#10;if [ $return_code -eq 0 ]; then&#10; message=`/usr/libexec/PlistBuddy -c &quot;Print :message&quot; &quot;NotarizationResponse.plist&quot;`&#10; status=`/usr/libexec/PlistBuddy -c &quot;Print :status&quot; &quot;NotarizationResponse.plist&quot;`&#10;else&#10; message=&quot;An Error Occurred.&quot;&#10; status=&quot;Check Xcode log.&quot;&#10;## open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;fi&#10;&#10;# Show and speak the final status.&#10;osascript -e &quot;on run(argv)&quot; \&#10;-e &apos;display notification item 1 of argv &amp; &quot; : &quot; &amp; item 2 of argv with title &quot;Submitting app for notarization&quot; sound name &quot;Crystal&quot;&apos; \&#10;-e &apos;set text item delimiters to &quot;, &quot;&apos; \&#10;-e &quot;set args to argv as text&quot; \&#10;-e &quot;say args&quot; \&#10;-e &quot;delay 5&quot; \&#10;-e &quot;end&quot; \&#10;-- &quot;$message&quot; &quot;$status&quot;&#10;&#10;wait 5&#10;xcrun stapler staple &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot;&#10;xcrun stapler staple &quot;${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;&#10;if [ -e &quot;$ZIP_PATH&quot; ];then&#10; rm -f &quot;$ZIP_PATH&quot;&#10;fi&#10;/usr/bin/ditto -c -k --keepParent &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot; &quot;$ZIP_PATH&quot;&#10;&#10;# Open the folder that was created, which also signals completion.&#10;open &quot;$EXPORT_PATH&quot;&#10;&#10;&#10;&#10;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down
2 changes: 1 addition & 1 deletion ReEnroller/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>20231211.042834</string>
<string>20231211.043113</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 7f49568

Please sign in to comment.