@@ -42,41 +42,14 @@ Pod::Spec.new do |s|
4242 end
4343 end
4444
45- # OpenSSL 3.6+ vendored xcframework (not yet on CocoaPods trunk)
46- openssl_version = "3.6.0001"
47- openssl_url = "https://github.com/krzyzanowskim/OpenSSL/releases/download/#{ openssl_version } /OpenSSL.xcframework.zip"
48-
49- # Ensure OpenSSL.xcframework is present during podspec evaluation.
50- # This is necessary because prepare_command is skipped for :path pods,
51- # which is how React Native native modules are installed.
52- # See: https://github.com/margelo/react-native-quick-crypto/issues/882
53- openssl_dir = File . join ( __dir__ , "OpenSSL.xcframework" )
54- openssl_plist = File . join ( openssl_dir , "Info.plist" )
55- unless File . exist? ( openssl_plist )
56- # Clean up any partial download
57- FileUtils . rm_rf ( openssl_dir ) if File . directory? ( openssl_dir )
58- FileUtils . rm_f ( File . join ( __dir__ , "OpenSSL.xcframework.zip" ) )
59-
60- Pod ::UI . puts "[QuickCrypto] ⬇️ Downloading OpenSSL.xcframework..."
61- Dir . chdir ( __dir__ ) do
62- system ( "curl -sSfL --connect-timeout 30 --max-time 300 -o OpenSSL.xcframework.zip #{ openssl_url } " ) || raise ( "Failed to download OpenSSL" )
63- system ( "unzip -q -o OpenSSL.xcframework.zip" ) || raise ( "Failed to unzip OpenSSL" )
64- File . delete ( "OpenSSL.xcframework.zip" ) if File . exist? ( "OpenSSL.xcframework.zip" )
65- end
66- Pod ::UI . puts "[QuickCrypto] ✅ OpenSSL.xcframework downloaded successfully"
67- end
68-
6945 if sodium_enabled
7046 # Build libsodium from source for XSalsa20 cipher support
7147 # CocoaPods packages are outdated (1.0.12) and SPM causes module conflicts
7248 s . prepare_command = <<-CMD
7349 set -e
74- # Download OpenSSL.xcframework
75- if [ ! -d "OpenSSL.xcframework" ]; then
76- curl -L -o OpenSSL.xcframework.zip #{ openssl_url }
77- unzip -o OpenSSL.xcframework.zip
78- rm -f OpenSSL.xcframework.zip
79- fi
50+ # Clean up vendored OpenSSL.xcframework from pre-1.0.20 installs
51+ rm -rf OpenSSL.xcframework
52+ rm -f OpenSSL.xcframework.zip
8053 # Build libsodium
8154 mkdir -p ios
8255 curl -L -o ios/libsodium.tar.gz https://download.libsodium.org/libsodium/releases/libsodium-1.0.20-stable.tar.gz
@@ -90,20 +63,15 @@ Pod::Spec.new do |s|
9063 else
9164 s . prepare_command = <<-CMD
9265 set -e
93- # Download OpenSSL.xcframework
94- if [ ! -d "OpenSSL.xcframework" ]; then
95- curl -L -o OpenSSL.xcframework.zip #{ openssl_url }
96- unzip -o OpenSSL.xcframework.zip
97- rm -f OpenSSL.xcframework.zip
98- fi
9966 # Clean up libsodium if previously built
10067 rm -rf ios/libsodium-stable
10168 rm -f ios/libsodium.tar.gz
69+ # Clean up vendored OpenSSL.xcframework from pre-1.0.20 installs
70+ rm -rf OpenSSL.xcframework
71+ rm -f OpenSSL.xcframework.zip
10272 CMD
10373 end
10474
105- s . vendored_frameworks = "OpenSSL.xcframework"
106-
10775 base_source_files = [
10876 # implementation (Swift)
10977 "ios/**/*.{swift}" ,
@@ -210,6 +178,7 @@ Pod::Spec.new do |s|
210178 load "nitrogen/generated/ios/QuickCrypto+autolinking.rb"
211179 add_nitrogen_files ( s )
212180
181+ s . dependency "OpenSSL-Universal" , "~> 3.6"
213182 s . dependency "React-jsi"
214183 s . dependency "React-callinvoker"
215184
0 commit comments