Quick answer: Godot 4 macOS export codesign failing because some Godot system binaries were modified by anti-virus? Restore from clean Godot install.
Codesign error: 'binary modified after signing'. Anti-virus scanned and patched.
Re-download Godot
Fresh Godot install; copy templates; codesign succeeds.
Or whitelist Godot
Anti-virus exception for Godot directory. Subsequent builds clean.
Verify pre-codesign hashes
Compare binary hashes against known-good. Drift = AV interference.
“Antivirus modifies binaries silently. Codesigning needs unmodified.”
If you ship Mac and have antivirus, the whitelist is a one-time setup. The bug class disappears.