| | |
| | | fail "main executable is not readable/executable by non-root users: $EXECUTABLE" |
| | | fi |
| | | |
| | | SIGNED_ENTITLEMENTS="$(mktemp -t taglauncher-signed-entitlements.XXXXXX)" |
| | | PROFILE_PLIST="$(mktemp -t taglauncher-profile.XXXXXX)" |
| | | cleanup() { |
| | | rm -f "$SIGNED_ENTITLEMENTS" "$PROFILE_PLIST" |
| | | } |
| | | trap cleanup EXIT |
| | | |
| | | codesign -d --entitlements :- "$APP_BUNDLE" > "$SIGNED_ENTITLEMENTS" 2>/dev/null || fail "unable to read signed entitlements from $APP_BUNDLE" |
| | | if [[ -f "$APP_BUNDLE/Contents/embedded.provisionprofile" ]]; then |
| | | security cms -D -i "$APP_BUNDLE/Contents/embedded.provisionprofile" > "$PROFILE_PLIST" |
| | | profile_application_identifier="$(/usr/libexec/PlistBuddy -c 'Print :Entitlements:com.apple.application-identifier' "$PROFILE_PLIST" 2>/dev/null || true)" |
| | | if [[ -n "$profile_application_identifier" ]]; then |
| | | signed_application_identifier="$(/usr/libexec/PlistBuddy -c 'Print :com.apple.application-identifier' "$SIGNED_ENTITLEMENTS" 2>/dev/null || true)" |
| | | [[ "$signed_application_identifier" == "$profile_application_identifier" ]] || fail "signed application identifier '$signed_application_identifier' does not match provisioning profile '$profile_application_identifier'" |
| | | fi |
| | | fi |
| | | |
| | | actual_minimum_system="$(/usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' "$INFO_PLIST")" |
| | | if [[ "$actual_minimum_system" != "$EXPECTED_MINIMUM_SYSTEM" ]]; then |
| | | fail "LSMinimumSystemVersion expected $EXPECTED_MINIMUM_SYSTEM, got $actual_minimum_system" |