Skip to content

Commit bcdaeeb

Browse files
benkaiserclaude
andcommitted
Fix codesigning: use Mach-O detection and add entitlements
- Use `file` command to find actual Mach-O binaries instead of perm flags - Add entitlements for JIT, network, audio, and file access - Add verbose verify output for debugging Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 38c05a2 commit bcdaeeb

1 file changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,42 @@ jobs:
4343
run: |
4444
APP="build/macos/Build/Products/Release/Joey.app"
4545
IDENTITY="Developer ID Application: Benjamin Kaiser (7YUK27P5X7)"
46-
# Sign all executables inside frameworks
47-
find "$APP/Contents/Frameworks" -type f -perm +111 ! -name "*.plist" ! -name "*.json" ! -name "CodeResources" | while read f; do
48-
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$f"
46+
ENTITLEMENTS=$(mktemp)
47+
cat > "$ENTITLEMENTS" << 'PLIST'
48+
<?xml version="1.0" encoding="UTF-8"?>
49+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
50+
<plist version="1.0">
51+
<dict>
52+
<key>com.apple.security.cs.allow-jit</key>
53+
<true/>
54+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
55+
<true/>
56+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
57+
<true/>
58+
<key>com.apple.security.network.client</key>
59+
<true/>
60+
<key>com.apple.security.files.user-selected.read-write</key>
61+
<true/>
62+
<key>com.apple.security.device.audio-input</key>
63+
<true/>
64+
</dict>
65+
</plist>
66+
PLIST
67+
# Sign all Mach-O binaries inside frameworks
68+
find "$APP/Contents/Frameworks" -type f | while read f; do
69+
if file "$f" | grep -q "Mach-O"; then
70+
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$f"
71+
fi
4972
done
5073
# Sign all framework bundles
5174
find "$APP/Contents/Frameworks" -name "*.framework" -maxdepth 1 | while read f; do
5275
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$f"
5376
done
54-
# Sign the main executable
55-
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$APP"
77+
# Sign the main app with entitlements
78+
codesign --force --options runtime --timestamp --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" "$APP"
79+
rm "$ENTITLEMENTS"
5680
# Verify
57-
codesign --verify --deep --strict "$APP"
81+
codesign --verify --deep --strict --verbose=2 "$APP" 2>&1
5882
- name: Notarize macOS app
5983
env:
6084
NOTARY_API_KEY: ${{ secrets.NOTARY_API_KEY }}

0 commit comments

Comments
 (0)