Skip to content

fix(release): ad-hoc codesign macOS .app to stop "damaged" Gatekeeper error#20

Open
wct097 wants to merge 1 commit into
mainfrom
fix/macos-adhoc-codesign
Open

fix(release): ad-hoc codesign macOS .app to stop "damaged" Gatekeeper error#20
wct097 wants to merge 1 commit into
mainfrom
fix/macos-adhoc-codesign

Conversation

@wct097

@wct097 wct097 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Problem

Downloading the v0.2.0 macOS build from the GitHub release and trying to open it produces:

"EftViewer" is damaged and can't be opened. You should move it to the Trash.

The build is not actually corrupt. The .app bundle ships unsigned, and the release pipeline has no codesign/notarization step. On Apple Silicon, every executable must carry a valid signature; once a browser download applies the com.apple.quarantine flag, Gatekeeper interprets "no signature" as "damaged" and blocks even the right-click → Open bypass.

Fix

Ad-hoc sign the full bundle before packaging:

codesign --force --deep --sign - "$app"
codesign --verify --strict --verbose=2 "$app"

An ad-hoc signature satisfies the Apple Silicon "must be signed" requirement, so Gatekeeper downgrades the failure from the unrecoverable "damaged → move to Trash" to the standard "unidentified developer" prompt — which users clear with right-click → Open.

What this does not do

It does not eliminate the warning entirely. Removing it requires full notarization (a paid Apple Developer ID + notarytool + staple), which remains deferred and tracked separately. This change is the free, zero-dependency step that makes the release usable.

After merge

Re-cut the v0.2.0 release so the macOS artifact is rebuilt and signed (delete the tag + release, re-tag, let the Release workflow regenerate all three binaries).

🤖 Generated with Claude Code

… error

Apple Silicon requires every executable to carry a valid code signature.
The macOS bundle shipped unsigned, so once a browser download applied the
com.apple.quarantine flag, Gatekeeper reported the app as "damaged — move
to Trash" and blocked the normal right-click -> Open bypass.

Ad-hoc sign the full bundle (codesign --force --deep --sign -) before
packaging, and verify the signature. This downgrades the failure to the
standard "unidentified developer" prompt, which users clear via
right-click -> Open. Full notarization (removes the prompt entirely,
requires a paid Apple Developer ID) remains deferred and tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant