I'm trying to codesign/notarize an existing app on macOS 10.15 / XCode 12.4.
This is my workflow:
- as my app is Qt-based, I'm using this Recipe OSX Code-Signing Qt to fix the app-bundle;
- sign with
codesign -vvv --force --options runtime --deep --sign "Developer ID Application: ..." --entitlements myApp.entitlements myApp.app
- package the .app with
zip -rqy
- upload it to notarization with
xcrun altool --notarize-app ...
This is the notarization log:
{
"logFormatVersion": 1,
"jobId": "b864c16d-d8dc-464e-aa4f-c2eea5ff6ac4",
"status": "Invalid",
"statusSummary": "Archive contains critical validation errors",
"statusCode": 4000,
"archiveFilename": "myApp-signed.zip",
"uploadDate": "2022-07-18T12:25:04Z",
"sha256": "c324a9ba88dbbaf0e5c325b48c2c22744886d68d450835b0724c7c70258784c2",
"ticketContents": null,
"issues": [
{
"severity": "error",
"code": null,
"path": "myApp-signed.zip/myApp.app/Contents/MacOS/myApp",
"message": "The signature of the binary is invalid.",
"docUrl": null,
"architecture": "x86_64"
}
]
}
but if I look at the signature of that file which is still in the status as when it was uploaded to notarization:
$ codesign -dvv myApp.app/Contents/MacOS/myApp
Executable=/path/to/myApp.app/Contents/MacOS/myApp
Identifier=com.myapp
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20500 size=1580 flags=0x10000(runtime) hashes=40+5 location=embedded
Signature size=8977
Authority=Developer ID Application: My Name (ID)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=18 Jul 2022 at 15:09:09
Info.plist entries=10
TeamIdentifier=6RVQYWZ74B
Runtime Version=11.1.0
Sealed Resources version=2 rules=13 files=4529
Internal requirements count=1 size=192
(additionally, after codesign/altool the app won't start anymore, but this is a different issue)
What is the problem with the main executable of my app?