Hi Apple experts! I could need some help please 🙂
We build our C++ app with Xccode 10.3 on macOS 10.15.1. We let Xcode sign it with Developer ID Application, hardened runtime is set. We build a DMG with "DropDMG" which also signs the DMG file for us. Then we upload it to notarization, staple the DMG, copy it to our web server, download it with Safari, open the DMG, move the app to /Applications, double click and get the error message:
"<app name> cannot be opened because the developer cannot be verified.
macOS cannot verify that this app is free from malware."
Any idea where I could find more information about why Gatekeeper does not like our app?
Here are some details about the app:
$ spctl --assess --verbose=4 --type execute "/Applications/<app name>.app"
/Applications/<app name>.app: accepted
source=Notarized Developer ID
$ spctl -a -t exec -vv "/Applications/<app name>.app"
/Applications/<app name>.app: accepted
source=Notarized Developer ID
origin=Developer ID Application: <company name> (<ID>)
$ codesign -d --entitlements :- "/Applications/<app name>.app"
Executable=/Applications/<app name>.app/Contents/MacOS/<app name>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
$ codesign -vv --deep-verify "/Applications/<app name>.app"
/Applications/<app name>.app: valid on disk
/Applications/<app name>.app: satisfies its Designated Requirement
$ codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' "/Applications/<app name>.app"
/Applications/<app name>.app: valid on disk
/Applications/<app name>.app: satisfies its Designated Requirement
test-requirement: code failed to satisfy specified code requirement(s)
The app bundle contains a folder /Contents which contains:
files:
Info.plist
PkgInfo
CodeResources
folders:
MacOS
Resources
_CodeSignature
data
default_data
data and default_data are sub-folders which contain 2 GB of app data
Any help will be much appreciated. Thanks!
With the help of the Apple tech support, we found the simple reason of the problems: testing on the dev machine gave me wrong results 😟
I'm using a VM now for testing. I download the game from our server to the VM. Gatekeeper accepts the bundle, I install the app and start it, and Gatekeeper accepts the app, too.
Testing same download again on my dev Mac: Gatekeeper warns "macOS cannot verify that this app is free from malware."
Solution: test on a clean system.
Many thanks to the Apple tech support!