2018-05-08 18:15:31 +02:00
|
|
|
#!/bin/zsh -f
|
2018-03-30 17:40:43 +02:00
|
|
|
|
|
|
|
# Name of your app.
|
2018-06-04 15:08:10 +02:00
|
|
|
APP="Whalebird"
|
2018-03-30 17:40:43 +02:00
|
|
|
# The path of your app to sign.
|
2021-03-17 17:12:31 +01:00
|
|
|
APP_PATH="./packages/Whalebird-mas-universal/Whalebird.app"
|
2018-03-30 17:40:43 +02:00
|
|
|
# The path to the location you want to put the signed package.
|
|
|
|
RESULT_PATH="./packages/$APP.pkg"
|
|
|
|
# The name of certificates you requested.
|
|
|
|
APP_KEY="3rd Party Mac Developer Application: Akira Fukushima (HB4N6B2YVM)"
|
|
|
|
INSTALLER_KEY="3rd Party Mac Developer Installer: Akira Fukushima (HB4N6B2YVM)"
|
|
|
|
# The path of your plist files.
|
|
|
|
CHILD_PLIST="./plist/child.plist"
|
|
|
|
PARENT_PLIST="./plist/parent.plist"
|
|
|
|
LOGINHELPER_PLIST="./plist/loginhelper.plist"
|
|
|
|
|
|
|
|
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
|
|
|
|
|
2018-05-08 18:15:31 +02:00
|
|
|
# At first, rename app.asar.unpacked directory.
|
|
|
|
# Because electron-builder does not store app.asar.unpacked directory.
|
|
|
|
# I want to store unpacked files at the same directory as electron-builder.
|
|
|
|
mv $APP_PATH/Contents/Resources/app.asar.unpacked/* $APP_PATH/Contents/Resources/
|
|
|
|
|
2018-03-30 17:40:43 +02:00
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Electron Framework"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libnode.dylib"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/Contents/MacOS/$APP Helper"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/"
|
2019-11-15 16:03:45 +01:00
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (GPU).app/Contents/MacOS/$APP Helper (GPU)"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (GPU).app/"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (Plugin).app/Contents/MacOS/$APP Helper (Plugin)"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (Plugin).app/"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (Renderer).app/Contents/MacOS/$APP Helper (Renderer)"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (Renderer).app/"
|
2018-03-30 17:40:43 +02:00
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP"
|
|
|
|
codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH"
|
|
|
|
|
|
|
|
productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"
|