Skip to content

Commit 65a5401

Browse files
authored
Merge pull request #2514 from crazyserver/MOBILE-3534
MOBILE-3534 mac: Adapt sign script to electron 4
2 parents ded6779 + b27190d commit 65a5401

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
</dict>
8+
</plist>

desktop/assets/mac/sign.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
#!/bin/bash
2+
#
3+
# Script to sign macOSX pkg.
4+
# https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide
5+
#
26

37
# Name of your app.
48
APP="Moodle Desktop"
5-
# The path of your app to sign.
6-
APP_PATH="desktop/dist/mas/Moodle Desktop.app"
7-
# The path to the location you want to put the signed package.
8-
RESULT_PATH="desktop/dist/mas/$APP.pkg"
99
# The name of certificates you requested.
1010
APP_KEY="3rd Party Mac Developer Application: Moodle Pty Ltd (2NU57U5PAW)"
1111
INSTALLER_KEY="3rd Party Mac Developer Installer: Moodle Pty Ltd (2NU57U5PAW)"
12+
13+
14+
BASEPATH="desktop/dist/mas"
15+
# The path of your app to sign.
16+
APP_PATH="${BASEPATH}/${APP}.app"
17+
# The path to the location you want to put the signed package.
18+
RESULT_PATH="${BASEPATH}/${APP}.pkg"
19+
1220
# The path of your plist files.
1321
CHILD_PLIST="desktop/assets/mac/child.plist"
1422
PARENT_PLIST="desktop/assets/mac/parent.plist"
23+
LOGINHELPER_PLIST="desktop/assets/mac/loginhelper.plist"
1524

1625
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
1726

@@ -21,11 +30,9 @@ codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electr
2130
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework"
2231
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/Contents/MacOS/$APP Helper"
2332
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/"
24-
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper EH.app/Contents/MacOS/$APP Helper EH"
25-
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper EH.app/"
26-
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper NP.app/Contents/MacOS/$APP Helper NP"
27-
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper NP.app/"
33+
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper"
34+
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/"
2835
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP"
2936
codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH"
3037

31-
productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"
38+
productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"

0 commit comments

Comments
 (0)