forked from epfl-mobots/vpl-teacher-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignbundle.sh
More file actions
executable file
·51 lines (41 loc) · 1.27 KB
/
signbundle.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#/bin/bash -ex
DEST=$1
IDENTITY="$2"
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
add_to_group() {
defaults write "$1" "com.apple.security.application-groups" -array "P97H86YL8K.VPL3Server"
}
sign() {
if [ -z "$IDENTITY" ]; then
echo "Identity not provided, not signing"
else
codesign --verify --verbose --timestamp --entitlements allow.entitlements -s "$IDENTITY" "$@"
fi
}
#defaults write $(realpath "$DEST/Contents/Info.plist") NSPrincipalClass -string NSApplication
#defaults write $(realpath "$DEST/Contents/Info.plist") NSHighResolutionCapable -string True
add_to_group $(realpath "$DEST/Contents/Info.plist")
chmod 644 $(realpath "$DEST/Contents/Info.plist")
MAIN_DIR="$DEST/Contents/MacOS"
for fw in $(ls "$DEST/Contents/Frameworks")
do
echo "Signing $DEST/Contents/Frameworks/$fw"
sign $(realpath "$DEST/Contents/Frameworks/$fw")
done
for plugin in $(find $DEST/Contents/Frameworks -name '*.dylib')
do
echo "Signing $plugin"
sign $(realpath "$plugin")
done
for so in $(find $DEST/Contents/Resources -name '*.so')
do
echo "Signing $so"
sign $(realpath "$so")
done
for binary in "python" "VPL3Server"
do
echo "Signing $MAIN_DIR/$binary"
sign --options=runtime $(realpath "$MAIN_DIR/$binary")
done