I have a Flutter app that should be sandboxed for Appstore and this app should run a binary that I build with make
.
I sign that binary with Developer ID certificate:
codesign -v -f --options=runtime --entitlements "./macos/Runner/binary_sandboxed.entitlements" --sign "Developer ID Application: ..." ./path/to/binary
here is binary_sandboxed.entitlements:
<?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.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>$(TEAM_ID).$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
and the main app runned with entitlements:
<?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.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>Q7Q43CUMWT.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</plist>
When I run app I get an error ProcessException: Operation not permitted
In console log I see this message:
denied since it was quarantined by Main app and created without user consent, qtn-flags was 0x00000086
if delete quarantine flag binary in Containers
xattr -d com.apple.quarantine /Users/appuser/Library/Containers/com.bin/Data/Library/Application Support/com.bin/binary
I got an error when run binary
zsh: illegal hardware instruction
failed: Unable to get bundle identifier because code signature information has no Info.Plist.
What did I do wrong? And what should I do?