Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/e2e-ios-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- OpenSSL-Universal (3.6.0000)
- QuickCrypto (1.0.19):
- boost
- DoubleConversion
Expand All @@ -77,6 +78,7 @@ PODS:
- glog
- hermes-engine
- NitroModules
- OpenSSL-Universal (~> 3.6)
- RCT-Folly
- RCT-Folly/Fabric
- RCTRequired
Expand Down Expand Up @@ -2637,6 +2639,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- MMKVCore
- OpenSSL-Universal
- SocketRocket

EXTERNAL SOURCES:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions packages/react-native-quick-crypto/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ README.md

ios/**

# Downloaded by CocoaPods prepare_command
OpenSSL.xcframework/

.cache/**
build/**
compile_commands.json
45 changes: 7 additions & 38 deletions packages/react-native-quick-crypto/QuickCrypto.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}",
Expand Down Expand Up @@ -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"

Expand Down
Loading