Skip to content
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

[various] Adds macOS privacy manifests #7687

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/file_selector/file_selector_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.9.4+1

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

## 0.9.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Displays native macOS open and save panels.
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos' }
s.source_files = 'file_selector_macos/Sources/file_selector_macos/**/*.swift'
s.resource_bundles = {'file_selector_macos_privacy' => ['file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy']}
s.dependency 'FlutterMacOS'

s.platform = :osx, '10.14'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ let package = Package(
targets: [
.target(
name: "file_selector_macos",
dependencies: []
dependencies: [],
resources: [
.process("Resources")
]
)
]
)
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>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion packages/file_selector/file_selector_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: file_selector_macos
description: macOS implementation of the file_selector plugin.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
version: 0.9.4
version: 0.9.4+1

environment:
sdk: ^3.3.0
Expand Down
3 changes: 2 additions & 1 deletion packages/url_launcher/url_launcher_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 3.2.1

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

## 3.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pod::Spec.new do |s|
s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos' }
s.source_files = 'url_launcher_macos/Sources/url_launcher_macos/**/*.swift'
s.resource_bundles = {'url_launcher_macos_privacy' => ['url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy']}
s.dependency 'FlutterMacOS'

s.platform = :osx, '10.14'
Expand Down
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>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher_macos
description: macOS implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 3.2.0
version: 3.2.1

environment:
sdk: ^3.3.0
Expand Down
3 changes: 2 additions & 1 deletion script/tool/lib/src/podspec_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class PodspecCheckCommand extends PackageLoopingCommand {
}
}

if (pluginSupportsPlatform(platformIOS, package) &&
if ((pluginSupportsPlatform(platformIOS, package) ||
pluginSupportsPlatform(platformMacOS, package)) &&
!podspecs.any(_hasPrivacyManifest)) {
printError('No PrivacyInfo.xcprivacy file specified. Please ensure that '
'a privacy manifest is included in the build using '
Expand Down
44 changes: 44 additions & 0 deletions script/tool/test/podspec_check_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -605,5 +605,49 @@ void main() {
<Matcher>[contains('Ran for 1 package(s)')],
));
});

test('fails when a macOS plugin is missing a privacy manifest', () async {
final RepositoryPackage plugin = createFakePlugin(
'plugin1',
packagesDir,
platformSupport: <String, PlatformDetails>{
Platform.macOS: const PlatformDetails(PlatformSupport.inline),
},
);
_writeFakePodspec(plugin, 'macos');

Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['podspec-check'], errorHandler: (Error e) {
commandError = e;
});

expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(
<Matcher>[contains('No PrivacyInfo.xcprivacy file specified.')],
));
});

test('passes when a macOS plugin has a privacy manifest', () async {
final RepositoryPackage plugin = createFakePlugin(
'plugin1',
packagesDir,
platformSupport: <String, PlatformDetails>{
Platform.macOS: const PlatformDetails(PlatformSupport.inline),
},
);
_writeFakePodspec(plugin, 'macos', includePrivacyManifest: true);

final List<String> output =
await runCapturingPrint(runner, <String>['podspec-check']);

expect(
output,
containsAllInOrder(
<Matcher>[contains('Ran for 1 package(s)')],
));
});
});
}