1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-11-14 16:42:47 +01:00
Nextcloud-Desktop/admin/osx/sign_app.sh
2016-01-22 18:13:25 +01:00

19 lines
568 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
codesign -dv $src_app
codesign --verify -v $src_app
spctl -a -t exec -vv $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 $?