Skip to content

Commit

Permalink
[CP-stable]Add xcprivacy privacy manifest to macOS framework (#55366)
Browse files Browse the repository at this point in the history
### Issue Link:

flutter/flutter#154915

### Changelog Description:

Comply with the new Apple privacy manifest policy for the macOS Flutter engine framework and prevent the "Missing privacy manifest" warning when submitting a macOS app to the App Store.

### Impact Description:

The macOS App Store will start enforcing privacy manifests for third-party SDKs starting November 12, 2024.  This change adds an empty privacy manifest to the Flutter engine FlutterMacOS.framework to comply with this new policy and prevents the warning.

### Workaround:
Add an empty PrivacyInfo.xcprivacy plist to FlutterMacOS.framework and re-codesign it manually.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

A test was added to the framework, which should also be cherry-picked flutter/flutter#155556.
While we can confirm the expected file is present, only a TestFlight/App Store submission will confirm the warning is gone.

### Validation Steps:
Submit a Flutter macOS app to TestFlight or the App Store.  Confirm there is no submission warning email sent.
  • Loading branch information
flutteractionsbot authored Oct 23, 2024
1 parent b19d438 commit db49896
Show file tree
Hide file tree
Showing 3 changed files with 23 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
10 changes: 10 additions & 0 deletions shell/platform/darwin/macos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ 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/Versions/A/Resources/PrivacyInfo.xcprivacy" ]
}

action("copy_framework_headers") {
script = "//flutter/sky/tools/install_framework_headers.py"
visibility = [ ":*" ]
Expand Down Expand Up @@ -304,6 +313,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 db49896

Please sign in to comment.