Skip to content

Commit

Permalink
exit early when spctl fails
Browse files Browse the repository at this point in the history
also remove reference to Autoupdate.app
and use brute force: unquarantine macOS nightly.app
  • Loading branch information
Jojo-Schmitz committed Jan 8, 2025
1 parent 97df88c commit 790ad00
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build/package_mac
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,18 @@ ln -s /Applications/ ${VOLUME}/Applications
set_bundle_display_options ${VOLUME}
mv ${VOLUME}/Pictures ${VOLUME}/.Pictures

# Most nested locations should go first
CODE_PATHS=(
"${VOLUME}/${LONGER_NAME}.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app"
"${VOLUME}/${LONGER_NAME}.app"
)

#codesign
echo "Codesign"
# `codesign --deep` doesn't seem to search for code in Contents/Resources directory so sign libraries in it manually
find "${VOLUME}/${LONGER_NAME}.app/Contents/Resources" -name '*.dylib' -exec codesign --force --options runtime --deep -s "Developer ID Application: ${DEVELOPER_NAME}" '{}' ';'
# Sign code in other (more conventional) locations
codesign --force --options runtime --entitlements "${WORKING_DIRECTORY}/../build/macosx_entitlements.plist" --deep -s "Developer ID Application: ${DEVELOPER_NAME}" "${CODE_PATHS[@]}"
codesign --force --options runtime --entitlements "${WORKING_DIRECTORY}/../build/macosx_entitlements.plist" --deep -s "Developer ID Application: ${DEVELOPER_NAME}" "${VOLUME}/${LONGER_NAME}.app"
# unquarantine...
xattr -r -d com.apple.quarantine "${VOLUME}/${LONGER_NAME}.app"
echo "spctl"
spctl --assess --type execute "${VOLUME}/${LONGER_NAME}.app"
if [ $? -eq 3 ]; then; exit 1; fi
spctl --assess --type execute "${VOLUME}/${LONGEddR_NAME}.app"
echo "Codesign verify"
codesign --verify --deep --strict --verbose=2 "${CODE_PATHS[@]}"

Expand Down

0 comments on commit 790ad00

Please sign in to comment.