-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find Required Reason API usage in Flutter Engine and create Privacy Manifest #131494
Find Required Reason API usage in Flutter Engine and create Privacy Manifest #131494
Comments
For the
I still need to evaluate all the third-party code we link statically. |
The |
I'm still finishing the audit, but the new 0A2A.1 handles the large open question here about how to handle Dart's |
I've completed the audit of the engine and all of the third-party code it uses. For iOS release builds, we are covered by:
|
Thank you so much @stuartmorgan! I'll start on the |
Well flutter/engine#48951 didn't totally work: I misread the |
Never mind I did include It probably wants an empty array, not an array with an empty dictionary. <key>NSPrivacyCollectedDataTypes</key>
- <array>
- <dict/>
- </array>
+ <array/> And the error goes away, but the Privacy Report PDF is totally blank so... |
Blank in both Xcode 15.1 beta 3 and Xcode 15.2 beta. I'm going to close this since we aren't getting errors and the blank report seems like an Xcode bug. I'll play around with it more and file more issues if there's anything we can do about that. As far as I know the xcprivacy file is correct based on Stuart's audit. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
This is available in 3.18.0-13.0.pre |
Create a `PrivacyInfo.xcprivacy` (this name is required) plist and move it to the top-level of the iOS framework bundle. `NSPrivacyTracking*` and `NSPrivacyCollectedDataTypes` keys are required, but the values are blank. Apple [now requires](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files) that third-party frameworks must include this manifest to document usage of particular APIs and [how they are used](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api). > Starting in fall 2023, when you upload a new app or app update to App Store Connect that uses an API (including from third-party SDKs) that requires a reason, you�ll receive a notice if you haven�t provided an approved reason in your app�s privacy manifest. And starting in spring 2024, in order to upload your new app or app update to App Store Connect, you�ll be required to include an approved reason in the app�s privacy manifest which accurately reflects how your app uses the API. https://developer.apple.com/news/?id=z6fu1dcu @stuartmorgan [audited](flutter/flutter#131494 (comment)) the engine and third_party: > * File timestamps: > > * `C617.1` for app state restoration in `FlutterAppDelegate.mm`. > * `0A2A.1` for implementation of the relevant `File` wrappers. > * System boot time: > > * `35F9.1` for various event timing and elapsed time calculations. Note macOS frameworks do not need to declare `NSPrivacyAccessedAPITypes`. I don't think this will require recipe or conductor codesign changes since this is a file copied as a resource into the framework, just as the modulemap and Info.plist aren't referenced anywhere. I'm not quite sure how to test this other than letting it build and generate a `Generate Privacy Report` in a Flutter app in Xcode. There's no where we check that, say, the Info.plist is copied to the right place in Flutter.framework (even in flutter/flutter). When this rolls into the framework I will add a check to [ios_content_validation_test.dart](https://github.com/flutter/flutter/blob/3da9bc169837d223496439b6d5f6b7e1a82d4318/dev/devicelab/bin/tasks/ios_content_validation_test.dart) On this PR the `PrivacyInfo.xcprivacy` was written to the expected location in the Flutter.framework: https://cas-viewer.appspot.com/projects/chromium-swarm/instances/default_instance/blobs/d45cd0809420f08145c7b78ea96cba6e7ea48d8ecfdc8fd2411f82fa65444714/516/tree Fixes flutter/flutter#131494 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Create a `PrivacyInfo.xcprivacy` (this name is required) plist and move it to the top-level of the iOS framework bundle. `NSPrivacyTracking*` and `NSPrivacyCollectedDataTypes` keys are required, but the values are blank. Apple [now requires](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files) that third-party frameworks must include this manifest to document usage of particular APIs and [how they are used](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api). > Starting in fall 2023, when you upload a new app or app update to App Store Connect that uses an API (including from third-party SDKs) that requires a reason, you�ll receive a notice if you haven�t provided an approved reason in your app�s privacy manifest. And starting in spring 2024, in order to upload your new app or app update to App Store Connect, you�ll be required to include an approved reason in the app�s privacy manifest which accurately reflects how your app uses the API. https://developer.apple.com/news/?id=z6fu1dcu @stuartmorgan [audited](flutter/flutter#131494 (comment)) the engine and third_party: > * File timestamps: > > * `C617.1` for app state restoration in `FlutterAppDelegate.mm`. > * `0A2A.1` for implementation of the relevant `File` wrappers. > * System boot time: > > * `35F9.1` for various event timing and elapsed time calculations. Note macOS frameworks do not need to declare `NSPrivacyAccessedAPITypes`. I don't think this will require recipe or conductor codesign changes since this is a file copied as a resource into the framework, just as the modulemap and Info.plist aren't referenced anywhere. I'm not quite sure how to test this other than letting it build and generate a `Generate Privacy Report` in a Flutter app in Xcode. There's no where we check that, say, the Info.plist is copied to the right place in Flutter.framework (even in flutter/flutter). When this rolls into the framework I will add a check to [ios_content_validation_test.dart](https://github.com/flutter/flutter/blob/3da9bc169837d223496439b6d5f6b7e1a82d4318/dev/devicelab/bin/tasks/ios_content_validation_test.dart) On this PR the `PrivacyInfo.xcprivacy` was written to the expected location in the Flutter.framework: https://cas-viewer.appspot.com/projects/chromium-swarm/instances/default_instance/blobs/d45cd0809420f08145c7b78ea96cba6e7ea48d8ecfdc8fd2411f82fa65444714/516/tree Fixes flutter/flutter#131494 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style (cherry picked from commit cf7c260)
Create a `PrivacyInfo.xcprivacy` (this name is required) plist and move it to the top-level of the macOS framework bundle. `NSPrivacyTracking*` and `NSPrivacyCollectedDataTypes` keys are required, but the values are blank. macOS explicitly does not need the `NSPrivacyAccessedAPITypes` (see more info in flutter/flutter#143381) You can see on this PR it's copied to the correct path in the framework https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8737163270670636097/+/u/Global_generators/Release-FlutterMacOS.framework/stdout: ``` adding: FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/PrivacyInfo.xcprivacy (deflated 35%) ``` There's no way to test this except to submit a macOS app with this framework to TestFlight. I can't find a good spot in the engine to validate the structure of the framework output. I hereby pledge to add a macOS test to the framework post-roll flutter/flutter#155189 � iOS framework variant of this PR #48951 Fixes flutter/flutter#131494 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Create a `PrivacyInfo.xcprivacy` (this name is required) plist and move it to the top-level of the macOS framework bundle. `NSPrivacyTracking*` and `NSPrivacyCollectedDataTypes` keys are required, but the values are blank. macOS explicitly does not need the `NSPrivacyAccessedAPITypes` (see more info in flutter/flutter#143381) You can see on this PR it's copied to the correct path in the framework https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8737163270670636097/+/u/Global_generators/Release-FlutterMacOS.framework/stdout: ``` adding: FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/PrivacyInfo.xcprivacy (deflated 35%) ``` There's no way to test this except to submit a macOS app with this framework to TestFlight. I can't find a good spot in the engine to validate the structure of the framework output. I hereby pledge to add a macOS test to the framework post-roll flutter/flutter#155189 � iOS framework variant of this PR flutter#48951 Fixes flutter/flutter#131494 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Introduced in Xcode 15, Apple is now flagging specific APIs as needed a “Required Reason” to use. All usages of “Required Reason” APIs MUST be outlined in a Privacy manifest. A Privacy manifest is a document outlining how your app/SDK collects and uses a user’s data.
This is also time sensitive (https://developer.apple.com/news/?id=z6fu1dcu).
https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api?language=objc
https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests?language=objc
https://developer.apple.com/videos/play/wwdc2023/10060/
We'll probably want to also add testing to scan for Required Reason APIs, so they get caught when added.
The text was updated successfully, but these errors were encountered: