Skip to content

Commit

Permalink
Bundle Safari App Extension
Browse files Browse the repository at this point in the history
Currently enabled only for beta builds
  • Loading branch information
dstillman committed Nov 27, 2019
1 parent ced8a0f commit 1f1c948
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,19 @@ if [ $BUILD_MAC == 1 ]; then
fi
# Clear extended attributes, which can cause codesign to fail
/usr/bin/xattr -cr "$APPDIR"

# Bundle and sign Safari App Extension
#
# Even though it's signed by Xcode, we sign it again to make sure it matches the parent app signature
if [[ -n "$SAFARI_APPEX" ]] && [[ -d "$SAFARI_APPEX" ]]; then
# Extract entitlements, which differ from parent app
/usr/bin/codesign -d --entitlements :"$BUILD_DIR/safari-entitlements.plist" $SAFARI_APPEX
mkdir "$APPDIR/Contents/PlugIns"
cp -R $SAFARI_APPEX "$APPDIR/Contents/PlugIns/ZoteroSafariExtension.appex"
/usr/bin/codesign --force --options runtime --entitlements "$BUILD_DIR/safari-entitlements.plist" --sign "$DEVELOPER_ID" "$APPDIR/Contents/PlugIns/ZoteroSafariExtension.appex"
fi

# Sign app
entitlements_file="$CALLDIR/mac/entitlements.xml"
/usr/bin/codesign --force --options runtime --entitlements "$entitlements_file" --sign "$DEVELOPER_ID" \
"$APPDIR/Contents/MacOS/pdftotext" \
Expand Down
1 change: 1 addition & 0 deletions scripts/5.0_beta_build_and_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ROOT_DIR="$(dirname "$SCRIPT_DIR")"
. "$ROOT_DIR/config.sh"

CHANNEL="beta"
export SAFARI_APPEX="$ROOT_DIR/../safari-app-extension-builds/beta/ZoteroSafariExtension.appex"

cd "$SCRIPT_DIR"
./check_requirements
Expand Down

0 comments on commit 1f1c948

Please sign in to comment.