From db49896cf25ceabc44096d5f088d86414e05a7aa Mon Sep 17 00:00:00 2001 From: flutteractionsbot <154381524+flutteractionsbot@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:58:04 -0700 Subject: [PATCH] [CP-stable]Add xcprivacy privacy manifest to macOS framework (#55366) ### Issue Link: https://github.com/flutter/flutter/issues/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 https://github.com/flutter/flutter/pull/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. --- ci/licenses_golden/licenses_flutter | 1 + shell/platform/darwin/macos/BUILD.gn | 10 ++++++++++ .../darwin/macos/framework/PrivacyInfo.xcprivacy | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index aa5e92a36b8b4..a63d942aeb5da 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -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 diff --git a/shell/platform/darwin/macos/BUILD.gn b/shell/platform/darwin/macos/BUILD.gn index 401b63bc0b8b6..3ce4bfc1f0a77 100644 --- a/shell/platform/darwin/macos/BUILD.gn +++ b/shell/platform/darwin/macos/BUILD.gn @@ -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 = [ ":*" ] @@ -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 = { diff --git a/shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy b/shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000000..4187dabc0f4c8 --- /dev/null +++ b/shell/platform/darwin/macos/framework/PrivacyInfo.xcprivacy @@ -0,0 +1,12 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + +