Xcode is doing something strange with our app's entitlements when we have Data Protection set to anything other than Complete Protection. The App ID in the developer portal is set properly to "Protected Until First Authentication", however the entitlement we get in Xcode lists "Complete". When I manually change the value of the entitlement to the desired value, we get a warning symbol under Capabilities. Clicking on "Fix Issue" reverts it back to NSFileProtectionComplete, which isn't what we want. Is there any way to make NSFileProtectionCompleteUntilFirstUserAuthentication work properly?
Is this just a problem with the Xcode warning? Or is the resulting app built incorrectly? That is, if you dump the entitlements and embedded provisioning profile of the built app, does it have the
com.apple.developer.default-data-protection entitlement set correctly in both places?
To can dump these as follows:
$ codesign -d --entitlements :- TestDF95757.app
…
<plist version="1.0">
<dict>
…
<key>com.apple.developer.default-data-protection</key>
<string>NSFileProtectionComplete</string>
…
</dict>
</plist>
$ security cms -D -i TestDF95757.app/embedded.mobileprovision
…
<plist version="1.0">
<dict>
…
<key>Entitlements</key>
<dict>
…
<key>com.apple.developer.default-data-protection</key>
<string>NSFileProtectionComplete</string>
</dict>
…
</dict>
</plist>Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"