Skip to content

Commit b6365ec

Browse files
committed
fix: sign plugin binaries inside-out after stripping
1 parent 2e313f5 commit b6365ec

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

scripts/build-release.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -495,18 +495,20 @@ build_for_arch() {
495495
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp "$dylib"
496496
done
497497

498-
# Sign plugin bundles (stripped binaries need re-signing, preserve entitlements)
498+
# Sign plugin bundles (stripped binaries need re-signing)
499+
# Sign binary first, then bundle — inside-out order required for valid signatures
499500
if [ -d "$PLUGINS_DIR" ]; then
500501
for plugin in "$PLUGINS_DIR"/*.tableplugin; do
501502
[ -d "$plugin" ] || continue
502-
local ent_file="/tmp/plugin_entitlements_$$.plist"
503-
codesign -d --entitlements - "$plugin" > "$ent_file" 2>/dev/null || true
504-
if [ -s "$ent_file" ]; then
505-
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp --entitlements "$ent_file" "$plugin"
506-
else
507-
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp "$plugin"
503+
local plugin_name
504+
plugin_name=$(basename "$plugin" .tableplugin)
505+
local plugin_binary="$plugin/Contents/MacOS/$plugin_name"
506+
# Sign the binary inside the bundle first
507+
if [ -f "$plugin_binary" ]; then
508+
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp "$plugin_binary"
508509
fi
509-
rm -f "$ent_file"
510+
# Then sign the bundle
511+
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp "$plugin"
510512
done
511513
fi
512514

0 commit comments

Comments
 (0)