From b2657383eaa5922c7d9fee6ec533de26d56dbabc Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Tue, 12 Mar 2024 22:07:34 -0400 Subject: [PATCH 01/10] Added privacy manifest for compliance: Includes details for Stat system call usage to align with Apple's privacy requirements. --- Xcode/PrivacyInfo.xcprivacy | 17 +++++++++++++++++ Xcode/Swifter.xcodeproj/project.pbxproj | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 Xcode/PrivacyInfo.xcprivacy diff --git a/Xcode/PrivacyInfo.xcprivacy b/Xcode/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..fe840a04 --- /dev/null +++ b/Xcode/PrivacyInfo.xcprivacy @@ -0,0 +1,17 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + + diff --git a/Xcode/Swifter.xcodeproj/project.pbxproj b/Xcode/Swifter.xcodeproj/project.pbxproj index ce264f99..5acf5e42 100644 --- a/Xcode/Swifter.xcodeproj/project.pbxproj +++ b/Xcode/Swifter.xcodeproj/project.pbxproj @@ -48,6 +48,7 @@ 269B47981D3AAAE20042D137 /* Errno.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B2A11D369C9D00D35BFB /* Errno.swift */; }; 269B47991D3AAAE20042D137 /* String+BASE64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F61D2C44F30030FC98 /* String+BASE64.swift */; }; 269B47A71D3AAC4F0042D137 /* SwiftertvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37E4A86E2BA1407000971516 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */; }; 39BFCFFA26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; 39BFCFFB26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; 39BFCFFC26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; @@ -177,6 +178,7 @@ 269B47A11D3AAAE20042D137 /* Swifter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swifter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 269B47A41D3AAC4F0042D137 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwiftertvOS.h; sourceTree = ""; }; + 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilesTests.swift; sourceTree = ""; }; 540CA839228F275B00A3AF9B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 540CA83A228F275B00A3AF9B /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; @@ -364,6 +366,7 @@ 7C839B6519422CFF003A6950 = { isa = PBXGroup; children = ( + 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */, 540CA83A228F275B00A3AF9B /* CHANGELOG.md */, 540CA839228F275B00A3AF9B /* README.md */, 7B912F4B220507DB0062C360 /* LinuxMain.swift */, @@ -723,6 +726,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 37E4A86E2BA1407000971516 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 327bc6ddf51b057bde1dd1d2f6705aa509905ff6 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Wed, 13 Mar 2024 01:50:33 -0400 Subject: [PATCH 02/10] updated podspec file --- Swifter.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/Swifter.podspec b/Swifter.podspec index 73b4a501..0d0b1011 100644 --- a/Swifter.podspec +++ b/Swifter.podspec @@ -12,5 +12,6 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/httpswift/swifter.git", :tag => "1.5.0" } s.source_files = 'Xcode/Sources/*.{swift}' s.swift_version = '5.0' + s.resource_bundles = {'Swifter' => ['Xcode/PrivacyInfo.xcprivacy']} end From 72c05a0ecc9516ae3bc1c5061b2b73a852f54b2d Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Wed, 13 Mar 2024 13:18:21 -0400 Subject: [PATCH 03/10] added privacyinfo to swift package --- Package.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 66fde6e1..7e62e425 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,10 @@ let package = Package( .target( name: "Swifter", dependencies: [], - path: "Xcode/Sources" + path: "Xcode/Sources", + resources: [ + .process("PrivacyInfo.xcprivacy") + ] ), .target( From 8018fc51d87fb595bcf9ea9ebcc74734887a9251 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Wed, 13 Mar 2024 13:47:07 -0400 Subject: [PATCH 04/10] swift tools version to 5.3 --- Package.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 7e62e425..0103360f 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.3 import PackageDescription @@ -14,12 +14,12 @@ let package = Package( targets: [ .target( - name: "Swifter", - dependencies: [], + name: "Swifter", + dependencies: [], path: "Xcode/Sources", resources: [ .process("PrivacyInfo.xcprivacy") - ] + ] ), .target( From 035429e16d5ab24a59f5e5c766c479e3ad57ece9 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Wed, 13 Mar 2024 13:47:32 -0400 Subject: [PATCH 05/10] fixed compiler warnings... not sure how this was working before --- Xcode/Tests/FilesTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xcode/Tests/FilesTests.swift b/Xcode/Tests/FilesTests.swift index 1f884844..2c82e5d8 100644 --- a/Xcode/Tests/FilesTests.swift +++ b/Xcode/Tests/FilesTests.swift @@ -55,7 +55,7 @@ class FilesTests: XCTestCase { let closure = shareFile(temporaryDirectoryURL.appendingPathComponent("does_not_exist").path) let result = closure(request) - XCTAssert(result == .notFound) + XCTAssert(result == .notFound()) } func testShareFilesFromDirectory() { @@ -77,7 +77,7 @@ class FilesTests: XCTestCase { let closure = shareFilesFromDirectory(temporaryDirectoryURL.path) let result = closure(request) - XCTAssert(result == .notFound) + XCTAssert(result == .notFound()) } func testDirectoryBrowser() { @@ -95,6 +95,6 @@ class FilesTests: XCTestCase { let closure = directoryBrowser(temporaryDirectoryURL.path) let result = closure(request) - XCTAssert(result == .notFound) + XCTAssert(result == .notFound()) } } From f1400c08e4e8047b0dbfcdd14d30d991964b07e3 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Wed, 13 Mar 2024 17:48:32 -0400 Subject: [PATCH 06/10] added backward support for swift tools 5.0 --- Package@swift-5.0.swift | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Package@swift-5.0.swift diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift new file mode 100644 index 00000000..9fc9f48c --- /dev/null +++ b/Package@swift-5.0.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.0 + +import PackageDescription + +let package = Package( + name: "Swifter", + + products: [ + .library(name: "Swifter", targets: ["Swifter"]), + .executable(name: "SwifterExample", targets: ["SwifterExample"]) + ], + + dependencies: [], + + targets: [ + .target( + name: "Swifter", + dependencies: [], + path: "Xcode/Sources" + ), + + .target( + name: "SwifterExample", + dependencies: [ + "Swifter" + ], + path: "SwifterExample" + ), + + .testTarget( + name: "SwifterTests", + dependencies: [ + "Swifter" + ], + path: "Xcode/Tests" + ) + ] +) From 3e52ad54ed97c36fcb51f1eac2323f91bcc3c840 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Thu, 14 Mar 2024 14:41:30 -0400 Subject: [PATCH 07/10] moved privacyinfo to Resources --- Package.swift | 2 +- Swifter.podspec | 2 +- Xcode/{ => Resources}/PrivacyInfo.xcprivacy | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename Xcode/{ => Resources}/PrivacyInfo.xcprivacy (100%) diff --git a/Package.swift b/Package.swift index 0103360f..27a8ac31 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( dependencies: [], path: "Xcode/Sources", resources: [ - .process("PrivacyInfo.xcprivacy") + .process("../Resources/PrivacyInfo.xcprivacy") ] ), diff --git a/Swifter.podspec b/Swifter.podspec index 0d0b1011..bedb6d62 100644 --- a/Swifter.podspec +++ b/Swifter.podspec @@ -12,6 +12,6 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/httpswift/swifter.git", :tag => "1.5.0" } s.source_files = 'Xcode/Sources/*.{swift}' s.swift_version = '5.0' - s.resource_bundles = {'Swifter' => ['Xcode/PrivacyInfo.xcprivacy']} + s.resource_bundles = {'Swifter' => ['Xcode/Resources/PrivacyInfo.xcprivacy']} end diff --git a/Xcode/PrivacyInfo.xcprivacy b/Xcode/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from Xcode/PrivacyInfo.xcprivacy rename to Xcode/Resources/PrivacyInfo.xcprivacy From bf3991e1ea932ea9e61d24b27ebbbc166d2e20db Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Thu, 14 Mar 2024 17:30:23 -0400 Subject: [PATCH 08/10] using .copy instead of .process since the contents don't need change --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 27a8ac31..b5dc89e9 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( dependencies: [], path: "Xcode/Sources", resources: [ - .process("../Resources/PrivacyInfo.xcprivacy") + .copy("../Resources/PrivacyInfo.xcprivacy") ] ), From b6edfa355fc8d8f5acfc63641187e9a760a9c43d Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Sun, 17 Mar 2024 16:24:29 -0400 Subject: [PATCH 09/10] fixed path in project file and upgraded min taret to iOS 12 --- Xcode/Swifter.xcodeproj/project.pbxproj | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Xcode/Swifter.xcodeproj/project.pbxproj b/Xcode/Swifter.xcodeproj/project.pbxproj index 5acf5e42..c70ab4b4 100644 --- a/Xcode/Swifter.xcodeproj/project.pbxproj +++ b/Xcode/Swifter.xcodeproj/project.pbxproj @@ -48,7 +48,8 @@ 269B47981D3AAAE20042D137 /* Errno.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B2A11D369C9D00D35BFB /* Errno.swift */; }; 269B47991D3AAAE20042D137 /* String+BASE64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F61D2C44F30030FC98 /* String+BASE64.swift */; }; 269B47A71D3AAC4F0042D137 /* SwiftertvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 37E4A86E2BA1407000971516 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */; }; + 3768D9FA2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */; }; + 3768D9FB2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */; }; 39BFCFFA26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; 39BFCFFB26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; 39BFCFFC26E4F0A000A6D7BF /* FilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */; }; @@ -178,7 +179,7 @@ 269B47A11D3AAAE20042D137 /* Swifter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swifter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 269B47A41D3AAC4F0042D137 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 269B47A51D3AAC4F0042D137 /* SwiftertvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwiftertvOS.h; sourceTree = ""; }; - 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 39BFCFF926E4F0A000A6D7BF /* FilesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilesTests.swift; sourceTree = ""; }; 540CA839228F275B00A3AF9B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 540CA83A228F275B00A3AF9B /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; @@ -366,7 +367,6 @@ 7C839B6519422CFF003A6950 = { isa = PBXGroup; children = ( - 37E4A86D2BA1407000971516 /* PrivacyInfo.xcprivacy */, 540CA83A228F275B00A3AF9B /* CHANGELOG.md */, 540CA839228F275B00A3AF9B /* README.md */, 7B912F4B220507DB0062C360 /* LinuxMain.swift */, @@ -411,6 +411,7 @@ 7CA4815619A2EF2B0030B30D /* Resources */ = { isa = PBXGroup; children = ( + 3768D9F92BA7884700A70E4E /* PrivacyInfo.xcprivacy */, 7CB102DF1A17381D00CBA3B4 /* logo.png */, ); path = Resources; @@ -726,7 +727,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 37E4A86E2BA1407000971516 /* PrivacyInfo.xcprivacy in Resources */, + 3768D9FB2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -744,6 +745,7 @@ 7AE8940D1C05151100A29F63 /* Launch Screen.storyboard in Resources */, 7CB102E01A17381D00CBA3B4 /* logo.png in Resources */, 7CDAB8141BE2A1D400C8A977 /* Images.xcassets in Resources */, + 3768D9FA2BA7884700A70E4E /* PrivacyInfo.xcprivacy in Resources */, 7CDAB8131BE2A1D400C8A977 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1164,7 +1166,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = SwifteriOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.5.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -1193,7 +1195,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = SwifteriOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.5.0; MTL_ENABLE_DEBUG_INFO = NO; From 1815448c40d4941d430d3e54f9c103ae4ae83478 Mon Sep 17 00:00:00 2001 From: Hani Ewais Date: Sun, 17 Mar 2024 16:32:43 -0400 Subject: [PATCH 10/10] reverting to min target iOS 9, this should be in a seperate PR --- Xcode/Swifter.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xcode/Swifter.xcodeproj/project.pbxproj b/Xcode/Swifter.xcodeproj/project.pbxproj index c70ab4b4..fbf06d95 100644 --- a/Xcode/Swifter.xcodeproj/project.pbxproj +++ b/Xcode/Swifter.xcodeproj/project.pbxproj @@ -1166,7 +1166,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = SwifteriOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.5.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -1195,7 +1195,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = SwifteriOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.5.0; MTL_ENABLE_DEBUG_INFO = NO;