Manually apply ad-hoc signature to macOS (ARM) app to fix "app is damaged" errors#7140
Manually apply ad-hoc signature to macOS (ARM) app to fix "app is damaged" errors#7140kthchew wants to merge 1 commit intoFreeTubeApp:developmentfrom
Conversation
|
It would be better to figure out what the actual issue is and fix it upstream, instead of adding a "temporary" (we all know how temporary workarounds usually become permanent technical debt) workaround here. |
|
The Electron build system seems quite complex and it would probably be a complicated task to see exactly what is incompatible with the signature applied by the linker. The most practical solution would likely still be to manually run codesign after the fact, but passing in an empty identity for an ad-hoc signature rather than an actual identity. Given that Electron seems to have a working code signing system for developers with actual certificates, I'd be willing to bet that if it were modified to accept ad-hoc identities (and automatically use them on ARM) this issue would be resolved. But yes, you're probably right that it would be ideal to fix it over there. |
|
The PR over at |
Pull request was closed
|
Link back to the corresponding PR: electron-userland/electron-builder#9007 |
Pull Request Type
Related issue
Closes #6691
Description
macOS on ARM shows "app is damaged" errors due to an invalid signature. This appears to be an issue with the way
electron-builderhandles the build, breaking the automatic linker-applied ad-hoc signature. To fix this we can re-sign the affected parts of the app bundle using thecodesigncommand afterelectron-builderdoes this work but before it places it into the DMG/ZIP/7z container.Screenshots
The warning now shows as


And System Settings shows an option to bypass the warning
Testing
I tested the build GitHub actions workflow on my fork and verified that the build does not show a damaged warning on my machine. (It still shows a Gatekeeper warning, but this is expected without notarization and can be bypassed without the use of Terminal.)
Desktop
Additional context
Documentation may need updating to move away from the suggestions of
xattrand towards the GUI method of bypassing the warning?