Skip to content

Commit 21d99dc

Browse files
[various] Adds macOS privacy manifests (#7687)
macOS privacy manifest enforcement is rolling out soon, so this brings all macOS plugins into alignment with our iOS policy of always having a manifest, including updating the repo tooling to enforce that. Very few plugins are affected because most share the implementation package with iOS, and we didn't do any target platform switching when adding the manifests for iOS, automatically covering macOS as well. Fixes flutter/flutter#155564
1 parent 24594a0 commit 21d99dc

File tree

12 files changed

+82
-6
lines changed

12 files changed

+82
-6
lines changed

packages/file_selector/file_selector_macos/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 0.9.4+1
22

3+
* Adds privacy manifest.
34
* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
45

56
## 0.9.4

packages/file_selector/file_selector_macos/macos/file_selector_macos.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Displays native macOS open and save panels.
1313
s.author = { 'Flutter Dev Team' => '[email protected]' }
1414
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos' }
1515
s.source_files = 'file_selector_macos/Sources/file_selector_macos/**/*.swift'
16+
s.resource_bundles = {'file_selector_macos_privacy' => ['file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy']}
1617
s.dependency 'FlutterMacOS'
1718

1819
s.platform = :osx, '10.14'

packages/file_selector/file_selector_macos/macos/file_selector_macos/Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ let package = Package(
1919
targets: [
2020
.target(
2121
name: "file_selector_macos",
22-
dependencies: []
22+
dependencies: [],
23+
resources: [
24+
.process("Resources")
25+
]
2326
)
2427
]
2528
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTrackingDomains</key>
6+
<array/>
7+
<key>NSPrivacyCollectedDataTypes</key>
8+
<array/>
9+
<key>NSPrivacyTracking</key>
10+
<false/>
11+
</dict>
12+
</plist>

packages/file_selector/file_selector_macos/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: file_selector_macos
22
description: macOS implementation of the file_selector plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
5-
version: 0.9.4
5+
version: 0.9.4+1
66

77
environment:
88
sdk: ^3.3.0

packages/url_launcher/url_launcher_macos/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 3.2.1
22

3+
* Adds privacy manifest.
34
* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
45

56
## 3.2.0

packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Pod::Spec.new do |s|
1313
s.author = { 'Flutter Team' => '[email protected]' }
1414
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos' }
1515
s.source_files = 'url_launcher_macos/Sources/url_launcher_macos/**/*.swift'
16+
s.resource_bundles = {'url_launcher_macos_privacy' => ['url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy']}
1617
s.dependency 'FlutterMacOS'
1718

1819
s.platform = :osx, '10.14'

packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTrackingDomains</key>
6+
<array/>
7+
<key>NSPrivacyCollectedDataTypes</key>
8+
<array/>
9+
<key>NSPrivacyTracking</key>
10+
<false/>
11+
</dict>
12+
</plist>

packages/url_launcher/url_launcher_macos/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: url_launcher_macos
22
description: macOS implementation of the url_launcher plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
5-
version: 3.2.0
5+
version: 3.2.1
66

77
environment:
88
sdk: ^3.3.0

script/tool/lib/src/podspec_check_command.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class PodspecCheckCommand extends PackageLoopingCommand {
9595
}
9696
}
9797

98-
if (pluginSupportsPlatform(platformIOS, package) &&
98+
if ((pluginSupportsPlatform(platformIOS, package) ||
99+
pluginSupportsPlatform(platformMacOS, package)) &&
99100
!podspecs.any(_hasPrivacyManifest)) {
100101
printError('No PrivacyInfo.xcprivacy file specified. Please ensure that '
101102
'a privacy manifest is included in the build using '

script/tool/test/podspec_check_command_test.dart

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,5 +605,49 @@ void main() {
605605
<Matcher>[contains('Ran for 1 package(s)')],
606606
));
607607
});
608+
609+
test('fails when a macOS plugin is missing a privacy manifest', () async {
610+
final RepositoryPackage plugin = createFakePlugin(
611+
'plugin1',
612+
packagesDir,
613+
platformSupport: <String, PlatformDetails>{
614+
Platform.macOS: const PlatformDetails(PlatformSupport.inline),
615+
},
616+
);
617+
_writeFakePodspec(plugin, 'macos');
618+
619+
Error? commandError;
620+
final List<String> output = await runCapturingPrint(
621+
runner, <String>['podspec-check'], errorHandler: (Error e) {
622+
commandError = e;
623+
});
624+
625+
expect(commandError, isA<ToolExit>());
626+
expect(
627+
output,
628+
containsAllInOrder(
629+
<Matcher>[contains('No PrivacyInfo.xcprivacy file specified.')],
630+
));
631+
});
632+
633+
test('passes when a macOS plugin has a privacy manifest', () async {
634+
final RepositoryPackage plugin = createFakePlugin(
635+
'plugin1',
636+
packagesDir,
637+
platformSupport: <String, PlatformDetails>{
638+
Platform.macOS: const PlatformDetails(PlatformSupport.inline),
639+
},
640+
);
641+
_writeFakePodspec(plugin, 'macos', includePrivacyManifest: true);
642+
643+
final List<String> output =
644+
await runCapturingPrint(runner, <String>['podspec-check']);
645+
646+
expect(
647+
output,
648+
containsAllInOrder(
649+
<Matcher>[contains('Ran for 1 package(s)')],
650+
));
651+
});
608652
});
609653
}

0 commit comments

Comments
 (0)