From 6a2b78c71591c3f752c54d848f62a884947ccc9e Mon Sep 17 00:00:00 2001 From: Wes Campaigne Date: Thu, 14 Mar 2024 14:15:54 -0400 Subject: [PATCH 1/2] Fix Privacy Manifest Including a NSPrivacyCollectedDataTypes entry but specifying empty strings is ... kind of invalid. Instead, you can just specify an empty array for NSPrivacyCollectedDataTypes at the top level. Also, the top level NSPrivacyTracking and NSPrivacyTrackingDomains keys were missing; I've added them with empty values. --- .../Resources/PrivacyInfo.xcprivacy | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy b/Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy index 07fb1beb..9d624d6e 100644 --- a/Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy +++ b/Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy @@ -2,21 +2,12 @@ + NSPrivacyTracking + NSPrivacyCollectedDataTypes - - - NSPrivacyCollectedDataType - - NSPrivacyCollectedDataTypeLinked - - NSPrivacyCollectedDataTypeTracking - - NSPrivacyCollectedDataTypePurposes - - - - - + + NSPrivacyTrackingDomains + NSPrivacyAccessedAPITypes From 7b8b9c9cb053ea7ac36fe78365b99dcde650d895 Mon Sep 17 00:00:00 2001 From: Wes Campaigne Date: Thu, 14 Mar 2024 14:21:04 -0400 Subject: [PATCH 2/2] Fix reference to privacy manifest in podspec When static framework linking is used with Cocoapods, files referenced using `resource` are just directly copied into the main app bundle, potentially clobbering each other or main app resources in the process. i.e., the PrivacyInfo.xcprivacy from ZIPFoundation can overwrite the one for the app itself. The correct way to include PrivacyInfo.xcprivacy is by using `resource_bundles` to create a nested bundle to contain the file. (If dynamic linking is used, this bundle will be nested inside the framework bundle for the pod; if static linking is used, the bundle is nested directly in the main app bundle. In either case, clobbering is avoided.) --- ZIPFoundation.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZIPFoundation.podspec b/ZIPFoundation.podspec index 8f9be8ec..e70e52db 100644 --- a/ZIPFoundation.podspec +++ b/ZIPFoundation.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.visionos.deployment_target = '1.0' s.source_files = 'Sources/ZIPFoundation/*.swift' - s.resource = 'Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy' + s.resource_bundles = {'ZIPFoundation_Privacy' => ['Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy']} end