Skip to content

Commit 86273d5

Browse files
authored
fix: use OpenSSL-Universal CocoaPods dependency instead of vendored xcframework (#977)
1 parent 92ef1f9 commit 86273d5

5 files changed

Lines changed: 13 additions & 44 deletions

File tree

.github/workflows/e2e-ios-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ jobs:
8686
~/Library/Caches/CocoaPods
8787
packages/react-native-quick-crypto/ios/libsodium-stable
8888
packages/react-native-quick-crypto/deps
89-
packages/react-native-quick-crypto/OpenSSL.xcframework
9089
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock', 'example/Gemfile.lock') }}
9190

9291
- name: Restore DerivedData cache

example/ios/Podfile.lock

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ PODS:
6969
- ReactCommon/turbomodule/core
7070
- SocketRocket
7171
- Yoga
72+
- OpenSSL-Universal (3.6.0000)
7273
- QuickCrypto (1.0.19):
7374
- boost
7475
- DoubleConversion
@@ -77,6 +78,7 @@ PODS:
7778
- glog
7879
- hermes-engine
7980
- NitroModules
81+
- OpenSSL-Universal (~> 3.6)
8082
- RCT-Folly
8183
- RCT-Folly/Fabric
8284
- RCTRequired
@@ -2637,6 +2639,7 @@ DEPENDENCIES:
26372639
SPEC REPOS:
26382640
trunk:
26392641
- MMKVCore
2642+
- OpenSSL-Universal
26402643
- SocketRocket
26412644

26422645
EXTERNAL SOURCES:
@@ -2811,7 +2814,8 @@ SPEC CHECKSUMS:
28112814
MMKVCore: f2dd4c9befea04277a55e84e7812f930537993df
28122815
NitroMmkv: afbc5b2fbf963be567c6c545aa1efcf6a9cec68e
28132816
NitroModules: 11bba9d065af151eae51e38a6425e04c3b223ff3
2814-
QuickCrypto: 7091e1849151490ffc1883c3e0ad5b86fdf9f535
2817+
OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7
2818+
QuickCrypto: 2084e4b3fe8ec7c33d57c446927b90d7e266b5f0
28152819
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
28162820
RCTDeprecation: c4b9e2fd0ab200e3af72b013ed6113187c607077
28172821
RCTRequired: e97dd5dafc1db8094e63bc5031e0371f092ae92a

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"react-native-mmkv": "4.0.1",
4141
"react-native-nitro-modules": "0.33.2",
4242
"react-native-quick-base64": "2.2.2",
43-
"react-native-quick-crypto": "1.0.19",
43+
"react-native-quick-crypto": "workspace:*",
4444
"react-native-safe-area-context": "5.6.2",
4545
"react-native-screens": "4.18.0",
4646
"react-native-vector-icons": "10.3.0",

packages/react-native-quick-crypto/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ README.md
33

44
ios/**
55

6-
# Downloaded by CocoaPods prepare_command
7-
OpenSSL.xcframework/
8-
96
.cache/**
107
build/**
118
compile_commands.json

packages/react-native-quick-crypto/QuickCrypto.podspec

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)