From 2ddd999cb8488c426d76197076e995c05303ccdb Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 11 Jan 2024 08:15:04 -0500 Subject: [PATCH 01/10] [Draft] Test resource bundles and podspecs --- GoogleUtilities.podspec | 4 ++++ .../Resources/PrivacyInfo.xcprivacy | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 GoogleUtilities/Resources/PrivacyInfo.xcprivacy diff --git a/GoogleUtilities.podspec b/GoogleUtilities.podspec index 643550ef..29f0a2b3 100644 --- a/GoogleUtilities.podspec +++ b/GoogleUtilities.podspec @@ -35,6 +35,10 @@ other Google CocoaPods. They're not intended for direct public usage. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', } + s.resource_bundles = { + "GoogleUtilities_Privacy" => 'GoogleUtilities/Resources/PrivacyInfo.xcprivacy' + } + s.subspec 'Environment' do |es| es.source_files = [ 'GoogleUtilities/Environment/**/*.[mh]', diff --git a/GoogleUtilities/Resources/PrivacyInfo.xcprivacy b/GoogleUtilities/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..247237a2 --- /dev/null +++ b/GoogleUtilities/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,24 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + 3B52.1 + + + + + + From acfc3eaf0012601149a1221cfbaa7f62dafa2e69 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 11 Jan 2024 10:24:20 -0500 Subject: [PATCH 02/10] Fix dummy resource --- .../Resources/PrivacyInfo.xcprivacy | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/GoogleUtilities/Resources/PrivacyInfo.xcprivacy b/GoogleUtilities/Resources/PrivacyInfo.xcprivacy index 247237a2..0c443a51 100644 --- a/GoogleUtilities/Resources/PrivacyInfo.xcprivacy +++ b/GoogleUtilities/Resources/PrivacyInfo.xcprivacy @@ -2,23 +2,30 @@ - NSPrivacyTracking - - NSPrivacyTrackingDomains - - NSPrivacyCollectedDataTypes - - NSPrivacyAccessedAPITypes - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp - NSPrivacyAccessedAPITypeReasons - - 3B52.1 - - - + NSPrivacyAccessedAPITypes + + + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + App functionality + + + + NSPrivacyTrackingDomains + + example.com + + NSPrivacyTracking + - From d8f70dad62af8656d4d216f84451884325e905f7 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 11 Jan 2024 12:28:20 -0500 Subject: [PATCH 03/10] Add core subspec to expose resource bundle --- GoogleUtilities.podspec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/GoogleUtilities.podspec b/GoogleUtilities.podspec index 29f0a2b3..0992fdb4 100644 --- a/GoogleUtilities.podspec +++ b/GoogleUtilities.podspec @@ -35,10 +35,13 @@ other Google CocoaPods. They're not intended for direct public usage. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', } - s.resource_bundles = { - "GoogleUtilities_Privacy" => 'GoogleUtilities/Resources/PrivacyInfo.xcprivacy' + s.subspec 'Core' do |cs| + cs.resource_bundles = { + "GoogleUtilities_Privacy" => 'GoogleUtilities/Resources/PrivacyInfo.xcprivacy' } + end + s.subspec 'Environment' do |es| es.source_files = [ 'GoogleUtilities/Environment/**/*.[mh]', @@ -46,6 +49,7 @@ other Google CocoaPods. They're not intended for direct public usage. ] es.public_header_files = 'GoogleUtilities/Environment/Public/GoogleUtilities/*.h' es.dependency 'PromisesObjC', '>= 1.2', '< 3.0' + es.dependency 'GoogleUtilities/Core' es.frameworks = [ 'Security' ] @@ -55,6 +59,7 @@ other Google CocoaPods. They're not intended for direct public usage. ls.source_files = 'GoogleUtilities/Logger/**/*.[mh]' ls.public_header_files = 'GoogleUtilities/Logger/Public/GoogleUtilities/*.h' ls.dependency 'GoogleUtilities/Environment' + ls.dependency 'GoogleUtilities/Core' end @@ -64,6 +69,7 @@ other Google CocoaPods. They're not intended for direct public usage. ns.dependency 'GoogleUtilities/NSData+zlib' ns.dependency 'GoogleUtilities/Logger' ns.dependency 'GoogleUtilities/Reachability' + ns.dependency 'GoogleUtilities/Core' ns.frameworks = [ 'Security' ] @@ -72,6 +78,7 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'NSData+zlib' do |ns| ns.source_files = 'GoogleUtilities/NSData+zlib/**/*.[mh]' ns.public_header_files = 'GoogleUtilities/NSData+zlib/Public/GoogleUtilities/*.h' + ns.dependency 'GoogleUtilities/Core' ns.libraries = [ 'z' ] @@ -80,6 +87,7 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'Reachability' do |rs| rs.source_files = 'GoogleUtilities/Reachability/**/*.[mh]' rs.public_header_files = 'GoogleUtilities/Reachability/Public/GoogleUtilities/*.h' + rs.dependency 'GoogleUtilities/Core' rs.ios.frameworks = [ 'SystemConfiguration' ] @@ -102,6 +110,7 @@ other Google CocoaPods. They're not intended for direct public usage. adss.public_header_files = [ 'GoogleUtilities/AppDelegateSwizzler/Public/GoogleUtilities/*.h', ] + adss.dependency 'GoogleUtilities/Core' adss.dependency 'GoogleUtilities/Logger' adss.dependency 'GoogleUtilities/Network' adss.dependency 'GoogleUtilities/Environment' @@ -110,12 +119,14 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'ISASwizzler' do |iss| iss.source_files = 'GoogleUtilities/ISASwizzler/**/*.[mh]', 'GoogleUtilities/Common/*.h' iss.public_header_files = 'GoogleUtilities/ISASwizzler/Public/GoogleUtilities/*.h' + iss.dependency 'GoogleUtilities/Core' end s.subspec 'MethodSwizzler' do |mss| mss.source_files = 'GoogleUtilities/MethodSwizzler/**/*.[mh]', 'GoogleUtilities/Common/*.h' mss.public_header_files = 'GoogleUtilities/MethodSwizzler/Public/GoogleUtilities/*.h' mss.dependency 'GoogleUtilities/Logger' + mss.dependency 'GoogleUtilities/Core' end s.subspec 'SwizzlerTestHelpers' do |sths| @@ -128,6 +139,7 @@ other Google CocoaPods. They're not intended for direct public usage. ud.source_files = 'GoogleUtilities/UserDefaults/**/*.[hm]' ud.public_header_files = 'GoogleUtilities/UserDefaults/Public/GoogleUtilities/*.h' ud.dependency 'GoogleUtilities/Logger' + ud.dependency 'GoogleUtilities/Core' end s.test_spec 'unit' do |unit_tests| From b541e5b48f9b197508e4b84ecb0253c6f7d15b1e Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Wed, 14 Feb 2024 10:15:43 -0500 Subject: [PATCH 04/10] [GoogleUtilities] Add privacy manifest for SPM / CocoaPods --- GoogleUtilities.podspec | 22 ++++++------ .../Privacy/Resources/PrivacyInfo.xcprivacy | 35 +++++++++++++++++++ .../Resources/PrivacyInfo.xcprivacy | 31 ---------------- Package.swift | 25 ++++++++----- 4 files changed, 63 insertions(+), 50 deletions(-) create mode 100644 GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy delete mode 100644 GoogleUtilities/Resources/PrivacyInfo.xcprivacy diff --git a/GoogleUtilities.podspec b/GoogleUtilities.podspec index 0992fdb4..fe4a3ea5 100644 --- a/GoogleUtilities.podspec +++ b/GoogleUtilities.podspec @@ -35,9 +35,9 @@ other Google CocoaPods. They're not intended for direct public usage. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', } - s.subspec 'Core' do |cs| + s.subspec 'Privacy' do |cs| cs.resource_bundles = { - "GoogleUtilities_Privacy" => 'GoogleUtilities/Resources/PrivacyInfo.xcprivacy' + "GoogleUtilities_Privacy" => 'GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy' } end @@ -49,7 +49,7 @@ other Google CocoaPods. They're not intended for direct public usage. ] es.public_header_files = 'GoogleUtilities/Environment/Public/GoogleUtilities/*.h' es.dependency 'PromisesObjC', '>= 1.2', '< 3.0' - es.dependency 'GoogleUtilities/Core' + es.dependency 'GoogleUtilities/Privacy' es.frameworks = [ 'Security' ] @@ -59,7 +59,7 @@ other Google CocoaPods. They're not intended for direct public usage. ls.source_files = 'GoogleUtilities/Logger/**/*.[mh]' ls.public_header_files = 'GoogleUtilities/Logger/Public/GoogleUtilities/*.h' ls.dependency 'GoogleUtilities/Environment' - ls.dependency 'GoogleUtilities/Core' + ls.dependency 'GoogleUtilities/Privacy' end @@ -69,7 +69,7 @@ other Google CocoaPods. They're not intended for direct public usage. ns.dependency 'GoogleUtilities/NSData+zlib' ns.dependency 'GoogleUtilities/Logger' ns.dependency 'GoogleUtilities/Reachability' - ns.dependency 'GoogleUtilities/Core' + ns.dependency 'GoogleUtilities/Privacy' ns.frameworks = [ 'Security' ] @@ -78,7 +78,7 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'NSData+zlib' do |ns| ns.source_files = 'GoogleUtilities/NSData+zlib/**/*.[mh]' ns.public_header_files = 'GoogleUtilities/NSData+zlib/Public/GoogleUtilities/*.h' - ns.dependency 'GoogleUtilities/Core' + ns.dependency 'GoogleUtilities/Privacy' ns.libraries = [ 'z' ] @@ -87,7 +87,7 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'Reachability' do |rs| rs.source_files = 'GoogleUtilities/Reachability/**/*.[mh]' rs.public_header_files = 'GoogleUtilities/Reachability/Public/GoogleUtilities/*.h' - rs.dependency 'GoogleUtilities/Core' + rs.dependency 'GoogleUtilities/Privacy' rs.ios.frameworks = [ 'SystemConfiguration' ] @@ -110,7 +110,7 @@ other Google CocoaPods. They're not intended for direct public usage. adss.public_header_files = [ 'GoogleUtilities/AppDelegateSwizzler/Public/GoogleUtilities/*.h', ] - adss.dependency 'GoogleUtilities/Core' + adss.dependency 'GoogleUtilities/Privacy' adss.dependency 'GoogleUtilities/Logger' adss.dependency 'GoogleUtilities/Network' adss.dependency 'GoogleUtilities/Environment' @@ -119,14 +119,14 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'ISASwizzler' do |iss| iss.source_files = 'GoogleUtilities/ISASwizzler/**/*.[mh]', 'GoogleUtilities/Common/*.h' iss.public_header_files = 'GoogleUtilities/ISASwizzler/Public/GoogleUtilities/*.h' - iss.dependency 'GoogleUtilities/Core' + iss.dependency 'GoogleUtilities/Privacy' end s.subspec 'MethodSwizzler' do |mss| mss.source_files = 'GoogleUtilities/MethodSwizzler/**/*.[mh]', 'GoogleUtilities/Common/*.h' mss.public_header_files = 'GoogleUtilities/MethodSwizzler/Public/GoogleUtilities/*.h' mss.dependency 'GoogleUtilities/Logger' - mss.dependency 'GoogleUtilities/Core' + mss.dependency 'GoogleUtilities/Privacy' end s.subspec 'SwizzlerTestHelpers' do |sths| @@ -139,7 +139,7 @@ other Google CocoaPods. They're not intended for direct public usage. ud.source_files = 'GoogleUtilities/UserDefaults/**/*.[hm]' ud.public_header_files = 'GoogleUtilities/UserDefaults/Public/GoogleUtilities/*.h' ud.dependency 'GoogleUtilities/Logger' - ud.dependency 'GoogleUtilities/Core' + ud.dependency 'GoogleUtilities/Privacy' end s.test_spec 'unit' do |unit_tests| diff --git a/GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy b/GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..eba704d9 --- /dev/null +++ b/GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,35 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + + NSPrivacyCollectedDataTypes + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + 1C8F.1 + C56D.1 + + + + + + diff --git a/GoogleUtilities/Resources/PrivacyInfo.xcprivacy b/GoogleUtilities/Resources/PrivacyInfo.xcprivacy deleted file mode 100644 index 0c443a51..00000000 --- a/GoogleUtilities/Resources/PrivacyInfo.xcprivacy +++ /dev/null @@ -1,31 +0,0 @@ - - - - - NSPrivacyAccessedAPITypes - - - - NSPrivacyCollectedDataTypes - - - NSPrivacyCollectedDataType - NSPrivacyCollectedDataTypeDeviceID - NSPrivacyCollectedDataTypeLinked - - NSPrivacyCollectedDataTypeTracking - - NSPrivacyCollectedDataTypePurposes - - App functionality - - - - NSPrivacyTrackingDomains - - example.com - - NSPrivacyTracking - - - diff --git a/Package.swift b/Package.swift index 146973b6..741c7bb4 100644 --- a/Package.swift +++ b/Package.swift @@ -72,11 +72,17 @@ let package = Package( ], // TODO: Restructure directory structure to simplify the excludes here. targets: [ + .target( + name: "GoogleUtilities-Privacy", + path: "GoogleUtilities/Privacy", + resources: [.process("Resources/PrivacyInfo.xcprivacy")] + ), .target( name: "GoogleUtilities-AppDelegateSwizzler", dependencies: ["GoogleUtilities-Environment", "GoogleUtilities-Logger", - "GoogleUtilities-Network"], + "GoogleUtilities-Network", + "GoogleUtilities-Privacy"], path: "GoogleUtilities", exclude: [ "AppDelegateSwizzler/README.md", @@ -104,7 +110,8 @@ let package = Package( name: "GoogleUtilities-Environment", dependencies: [ .product(name: "FBLPromises", package: "Promises"), - .target(name: "third_party-IsAppEncrypted"), + "third_party-IsAppEncrypted", + "GoogleUtilities-Privacy" ], path: "GoogleUtilities/Environment", publicHeadersPath: "Public", @@ -125,7 +132,7 @@ let package = Package( .target( name: "GoogleUtilities-Logger", - dependencies: ["GoogleUtilities-Environment"], + dependencies: ["GoogleUtilities-Environment", "GoogleUtilities-Privacy"], path: "GoogleUtilities/Logger", publicHeadersPath: "Public", cSettings: [ @@ -135,7 +142,7 @@ let package = Package( .target( name: "GoogleUtilities-ISASwizzler", - dependencies: ["GoogleUtilities-Logger"], + dependencies: ["GoogleUtilities-Logger", "GoogleUtilities-Privacy"], path: "GoogleUtilities/ISASwizzler", publicHeadersPath: "Public", cSettings: [ @@ -145,7 +152,7 @@ let package = Package( .target( name: "GoogleUtilities-MethodSwizzler", - dependencies: ["GoogleUtilities-Logger"], + dependencies: ["GoogleUtilities-Logger", "GoogleUtilities-Privacy"], path: "GoogleUtilities/MethodSwizzler", publicHeadersPath: "Public", cSettings: [ @@ -156,7 +163,8 @@ let package = Package( name: "GoogleUtilities-Network", dependencies: ["GoogleUtilities-Logger", "GoogleUtilities-NSData", - "GoogleUtilities-Reachability"], + "GoogleUtilities-Reachability", + "GoogleUtilities-Privacy"], path: "GoogleUtilities/Network", publicHeadersPath: "Public", cSettings: [ @@ -165,6 +173,7 @@ let package = Package( ), .target( name: "GoogleUtilities-NSData", + dependencies: ["GoogleUtilities-Privacy"], path: "GoogleUtilities/NSData+zlib", publicHeadersPath: "Public", cSettings: [ @@ -176,7 +185,7 @@ let package = Package( ), .target( name: "GoogleUtilities-Reachability", - dependencies: ["GoogleUtilities-Logger"], + dependencies: ["GoogleUtilities-Logger", "GoogleUtilities-Privacy"], path: "GoogleUtilities/Reachability", publicHeadersPath: "Public", cSettings: [ @@ -185,7 +194,7 @@ let package = Package( ), .target( name: "GoogleUtilities-UserDefaults", - dependencies: ["GoogleUtilities-Logger"], + dependencies: ["GoogleUtilities-Logger", "GoogleUtilities-Privacy"], path: "GoogleUtilities/UserDefaults", publicHeadersPath: "Public", cSettings: [ From de4af189af8b99f89524805ad85367d35ee9b117 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Wed, 14 Feb 2024 11:23:02 -0500 Subject: [PATCH 05/10] Fix spacing in podspec --- GoogleUtilities.podspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GoogleUtilities.podspec b/GoogleUtilities.podspec index d00e7a8d..79924f5a 100644 --- a/GoogleUtilities.podspec +++ b/GoogleUtilities.podspec @@ -38,8 +38,7 @@ other Google CocoaPods. They're not intended for direct public usage. s.subspec 'Privacy' do |cs| cs.resource_bundles = { "GoogleUtilities_Privacy" => 'GoogleUtilities/Privacy/Resources/PrivacyInfo.xcprivacy' - } - + } end s.subspec 'Environment' do |es| From c27cd306b6b675b46691bd26ab58bf115c3a5c8b Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 15 Feb 2024 19:48:02 -0500 Subject: [PATCH 06/10] fix target name --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 9c71bae5..6a041431 100644 --- a/Package.swift +++ b/Package.swift @@ -110,7 +110,7 @@ let package = Package( name: "GoogleUtilities-Environment", dependencies: [ .product(name: "FBLPromises", package: "Promises"), - "third_party-IsAppEncrypted", + "third-party-IsAppEncrypted", "GoogleUtilities-Privacy" ], path: "GoogleUtilities/Environment", From 702fb157fa3e79310f63631f449276b92ed6c672 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 15 Feb 2024 19:49:11 -0500 Subject: [PATCH 07/10] Style --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 6a041431..c3cbe7e5 100644 --- a/Package.swift +++ b/Package.swift @@ -111,7 +111,7 @@ let package = Package( dependencies: [ .product(name: "FBLPromises", package: "Promises"), "third-party-IsAppEncrypted", - "GoogleUtilities-Privacy" + "GoogleUtilities-Privacy", ], path: "GoogleUtilities/Environment", publicHeadersPath: "Public", From dd41a9fa7c318b527cc470dd6057665eb793ca63 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 15 Feb 2024 19:56:14 -0500 Subject: [PATCH 08/10] Fix CI --- GoogleUtilities/Privacy/Empty.swift | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 GoogleUtilities/Privacy/Empty.swift diff --git a/GoogleUtilities/Privacy/Empty.swift b/GoogleUtilities/Privacy/Empty.swift new file mode 100644 index 00000000..0ab403e3 --- /dev/null +++ b/GoogleUtilities/Privacy/Empty.swift @@ -0,0 +1,3 @@ +This file is intentionally empty and satisfies SwiftPM's requirement that a +target contain sources. + From d9925fa6fb4a1f8fab81600adf8b589e9535c0c4 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 15 Feb 2024 20:02:28 -0500 Subject: [PATCH 09/10] wrap text in comment --- GoogleUtilities/Privacy/Empty.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GoogleUtilities/Privacy/Empty.swift b/GoogleUtilities/Privacy/Empty.swift index 0ab403e3..98361ded 100644 --- a/GoogleUtilities/Privacy/Empty.swift +++ b/GoogleUtilities/Privacy/Empty.swift @@ -1,3 +1,3 @@ -This file is intentionally empty and satisfies SwiftPM's requirement that a -target contain sources. +// This file is intentionally empty and satisfies SwiftPM's requirement that a +// target contain sources. From e6fb1776aee44d8b1b257ae0868f0100f3b3b902 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Thu, 15 Feb 2024 20:25:59 -0500 Subject: [PATCH 10/10] Style --- GoogleUtilities/Privacy/Empty.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/GoogleUtilities/Privacy/Empty.swift b/GoogleUtilities/Privacy/Empty.swift index 98361ded..37be0ed5 100644 --- a/GoogleUtilities/Privacy/Empty.swift +++ b/GoogleUtilities/Privacy/Empty.swift @@ -1,3 +1,2 @@ // This file is intentionally empty and satisfies SwiftPM's requirement that a // target contain sources. -