nextcloud-desktop/admin/osx/sign_app.sh
Jocelyn Turcotte 18efc5eb65 shell_i: Add a way to fail the build if the signing key doesn't match
This tries to catch error at build time instead of having
to check the OS X console for errors afterward.
2015-06-22 13:55:19 +02:00

18 lines
No EOL
538 B
Bash
Executable file

#!/bin/sh -xe
[ "$#" -lt 2 ] && echo "Usage: sign_app.sh <app> <identity> <team_identifier>" && exit
src_app="$1"
identity="$2"
team_identifier="$3"
codesign -s "$identity" --force --preserve-metadata=entitlements --verbose=4 --deep "$src_app"
# Verify the signature
spctl -a -t exec -vv $src_app
codesign -dv $src_app
# Validate that the key used for signing the binary matches the expected TeamIdentifier
# needed to pass the SocketApi through the sandbox
codesign -dv $src_app 2>&1 | grep "TeamIdentifier=$team_identifier"
exit $?