Skip to content

Commit

Permalink
Add xcprivacy privacy manifest to macOS framework (flutter#55078)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jmagman authored and GitHub Actions Bot committed Sep 23, 2024
1 parent 3633501 commit 69d02c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -46536,6 +46536,7 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Headers/FlutterPlug
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Headers/FlutterPluginRegistrarMacOS.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Info.plist
FILE: ../../../flutter/shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMac.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMac.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMacTest.mm
Expand Down
9 changes: 9 additions & 0 deletions shell/platform/darwin/macos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ copy("copy_framework_module_map") {
outputs = [ "$_flutter_framework_dir/Versions/A/Modules/module.modulemap" ]
}

# Copy privacy manifest. This file is required by Apple for third-party SDKs.
# See https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
copy("copy_framework_privacy_manifest") {
visibility = [ ":*" ]
sources = [ "framework/PrivacyInfo.xcprivacy" ]
outputs = [ "$_flutter_framework_dir/PrivacyInfo.xcprivacy" ]
}

action("copy_framework_headers") {
script = "//flutter/sky/tools/install_framework_headers.py"
visibility = [ ":*" ]
Expand Down Expand Up @@ -304,6 +312,7 @@ action("_generate_symlinks") {
":copy_framework_icu",
":copy_framework_info_plist",
":copy_framework_module_map",
":copy_framework_privacy_manifest",
":copy_license",
]
metadata = {
Expand Down
12 changes: 12 additions & 0 deletions shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
</dict>
</plist>

0 comments on commit 69d02c5

Please sign in to comment.