How is this done on an already-compiled (re-signed) app though? There
is no entitlements file in the app bundle to delete/edit.
The .entitlements
file is an input to the code signing machinery. It doesn’t actually ship with the resulting code. Rather, the entitlements end up getting baked into the code signature.
I'm getting an empty response from codesign -d --entitlements :- PATHTOAPP
. Is that sufficient to know that it's out of the sandbox … ?
Yes. A sandboxed app will show something like this:
| % codesign -d --entitlements - /Applications/PCalc.app |
| Executable=/Applications/PCalc.app/Contents/MacOS/PCalc |
| [Dict] |
| [Key] com.apple.security.app-sandbox |
| [Value] |
| [Bool] true |
| … |
Note that modern versions of codesign
don’t render the entitlements as XML. To do that, add the --xml
flag. And then run the result through a pretty printer:
| % codesign -d --entitlements - --xml /Applications/PCalc.app | plutil -convert xml1 -o - - |
| … |
| <dict> |
| … |
| <key>com.apple.security.app-sandbox</key> |
| <true/> |
| … |
| </dict> |
| </plist> |
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"