2015-04-16 17:33:36 +03:00
|
|
|
#!/bin/sh -xe
|
2014-09-02 18:13:37 +04:00
|
|
|
|
2015-06-22 14:53:56 +03:00
|
|
|
[ "$#" -lt 2 ] && echo "Usage: sign_app.sh <app> <identity> <team_identifier>" && exit
|
2014-09-02 18:13:37 +04:00
|
|
|
|
|
|
|
src_app="$1"
|
|
|
|
identity="$2"
|
2015-06-22 14:53:56 +03:00
|
|
|
team_identifier="$3"
|
2014-09-02 18:13:37 +04:00
|
|
|
|
2015-06-22 14:53:56 +03:00
|
|
|
codesign -s "$identity" --force --preserve-metadata=entitlements --verbose=4 --deep "$src_app"
|
2014-09-02 18:13:37 +04:00
|
|
|
|
2015-04-16 17:33:36 +03:00
|
|
|
# Verify the signature
|
2014-10-01 17:33:20 +04:00
|
|
|
codesign -dv $src_app
|
2016-01-22 20:13:25 +03:00
|
|
|
codesign --verify -v $src_app
|
2016-01-22 18:54:04 +03:00
|
|
|
spctl -a -t exec -vv $src_app
|
2015-06-22 14:53:56 +03:00
|
|
|
|
|
|
|
# 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 $?
|