diff --git a/.github/workflows/e2e-ios-test.yml b/.github/workflows/e2e-ios-test.yml index d7e2ac97..3c794141 100644 --- a/.github/workflows/e2e-ios-test.yml +++ b/.github/workflows/e2e-ios-test.yml @@ -86,7 +86,6 @@ jobs: ~/Library/Caches/CocoaPods packages/react-native-quick-crypto/ios/libsodium-stable packages/react-native-quick-crypto/deps - packages/react-native-quick-crypto/OpenSSL.xcframework key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock', 'example/Gemfile.lock') }} - name: Restore DerivedData cache diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index af0ebd4e..929004ce 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -69,6 +69,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga + - OpenSSL-Universal (3.6.0000) - QuickCrypto (1.0.19): - boost - DoubleConversion @@ -77,6 +78,7 @@ PODS: - glog - hermes-engine - NitroModules + - OpenSSL-Universal (~> 3.6) - RCT-Folly - RCT-Folly/Fabric - RCTRequired @@ -2637,6 +2639,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - MMKVCore + - OpenSSL-Universal - SocketRocket EXTERNAL SOURCES: @@ -2811,7 +2814,8 @@ SPEC CHECKSUMS: MMKVCore: f2dd4c9befea04277a55e84e7812f930537993df NitroMmkv: afbc5b2fbf963be567c6c545aa1efcf6a9cec68e NitroModules: 11bba9d065af151eae51e38a6425e04c3b223ff3 - QuickCrypto: 7091e1849151490ffc1883c3e0ad5b86fdf9f535 + OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7 + QuickCrypto: 2084e4b3fe8ec7c33d57c446927b90d7e266b5f0 RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 RCTDeprecation: c4b9e2fd0ab200e3af72b013ed6113187c607077 RCTRequired: e97dd5dafc1db8094e63bc5031e0371f092ae92a diff --git a/example/package.json b/example/package.json index 67af6a7b..07b78c92 100644 --- a/example/package.json +++ b/example/package.json @@ -40,7 +40,7 @@ "react-native-mmkv": "4.0.1", "react-native-nitro-modules": "0.33.2", "react-native-quick-base64": "2.2.2", - "react-native-quick-crypto": "1.0.19", + "react-native-quick-crypto": "workspace:*", "react-native-safe-area-context": "5.6.2", "react-native-screens": "4.18.0", "react-native-vector-icons": "10.3.0", diff --git a/packages/react-native-quick-crypto/.gitignore b/packages/react-native-quick-crypto/.gitignore index 2a0cff43..253e0720 100644 --- a/packages/react-native-quick-crypto/.gitignore +++ b/packages/react-native-quick-crypto/.gitignore @@ -3,9 +3,6 @@ README.md ios/** -# Downloaded by CocoaPods prepare_command -OpenSSL.xcframework/ - .cache/** build/** compile_commands.json diff --git a/packages/react-native-quick-crypto/QuickCrypto.podspec b/packages/react-native-quick-crypto/QuickCrypto.podspec index 4e3496c0..b3d50fa3 100644 --- a/packages/react-native-quick-crypto/QuickCrypto.podspec +++ b/packages/react-native-quick-crypto/QuickCrypto.podspec @@ -42,41 +42,14 @@ Pod::Spec.new do |s| end end - # OpenSSL 3.6+ vendored xcframework (not yet on CocoaPods trunk) - openssl_version = "3.6.0001" - openssl_url = "https://github.com/krzyzanowskim/OpenSSL/releases/download/#{openssl_version}/OpenSSL.xcframework.zip" - - # Ensure OpenSSL.xcframework is present during podspec evaluation. - # This is necessary because prepare_command is skipped for :path pods, - # which is how React Native native modules are installed. - # See: https://github.com/margelo/react-native-quick-crypto/issues/882 - openssl_dir = File.join(__dir__, "OpenSSL.xcframework") - openssl_plist = File.join(openssl_dir, "Info.plist") - unless File.exist?(openssl_plist) - # Clean up any partial download - FileUtils.rm_rf(openssl_dir) if File.directory?(openssl_dir) - FileUtils.rm_f(File.join(__dir__, "OpenSSL.xcframework.zip")) - - Pod::UI.puts "[QuickCrypto] ⬇️ Downloading OpenSSL.xcframework..." - Dir.chdir(__dir__) do - system("curl -sSfL --connect-timeout 30 --max-time 300 -o OpenSSL.xcframework.zip #{openssl_url}") || raise("Failed to download OpenSSL") - system("unzip -q -o OpenSSL.xcframework.zip") || raise("Failed to unzip OpenSSL") - File.delete("OpenSSL.xcframework.zip") if File.exist?("OpenSSL.xcframework.zip") - end - Pod::UI.puts "[QuickCrypto] ✅ OpenSSL.xcframework downloaded successfully" - end - if sodium_enabled # Build libsodium from source for XSalsa20 cipher support # CocoaPods packages are outdated (1.0.12) and SPM causes module conflicts s.prepare_command = <<-CMD set -e - # Download OpenSSL.xcframework - if [ ! -d "OpenSSL.xcframework" ]; then - curl -L -o OpenSSL.xcframework.zip #{openssl_url} - unzip -o OpenSSL.xcframework.zip - rm -f OpenSSL.xcframework.zip - fi + # Clean up vendored OpenSSL.xcframework from pre-1.0.20 installs + rm -rf OpenSSL.xcframework + rm -f OpenSSL.xcframework.zip # Build libsodium mkdir -p ios 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| else s.prepare_command = <<-CMD set -e - # Download OpenSSL.xcframework - if [ ! -d "OpenSSL.xcframework" ]; then - curl -L -o OpenSSL.xcframework.zip #{openssl_url} - unzip -o OpenSSL.xcframework.zip - rm -f OpenSSL.xcframework.zip - fi # Clean up libsodium if previously built rm -rf ios/libsodium-stable rm -f ios/libsodium.tar.gz + # Clean up vendored OpenSSL.xcframework from pre-1.0.20 installs + rm -rf OpenSSL.xcframework + rm -f OpenSSL.xcframework.zip CMD end - s.vendored_frameworks = "OpenSSL.xcframework" - base_source_files = [ # implementation (Swift) "ios/**/*.{swift}", @@ -210,6 +178,7 @@ Pod::Spec.new do |s| load "nitrogen/generated/ios/QuickCrypto+autolinking.rb" add_nitrogen_files(s) + s.dependency "OpenSSL-Universal", "~> 3.6" s.dependency "React-jsi" s.dependency "React-callinvoker"