Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle SQLCipher in the bindings #443

Merged
merged 5 commits into from
Jul 22, 2024
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ In the `ios` directory, update your `Podfile` file as follows:

- Set this value: `platform :ios, '16.0'`. This is required by XMTP.

If you get the error `The SQLCipher Sqlite extension is not present, but an encryption key is given`

- At the project configuration level in XCode make sure that xmtpV3 is loaded before all other packages by setting `Other Linker Flags` first item to `-l"xmtpv3"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhaaaa do you think it would be worth it to add this screenshot here for clarity?

Capture d’écran 2024-07-22 à 11 29 13

```bash
npx pod-install
```
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ repositories {
dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
implementation "org.xmtp:android:0.14.7"
implementation "org.xmtp:android:0.14.8"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.facebook.react:react-native:0.71.3'
implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1"
Expand Down
22 changes: 7 additions & 15 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PODS:
- hermes-engine/Pre-built (= 0.71.14)
- hermes-engine/Pre-built (0.71.14)
- libevent (2.1.12)
- LibXMTP (0.5.4-beta4)
- LibXMTP (0.5.6-beta0)
- Logging (1.0.0)
- MessagePacker (0.4.7)
- MMKV (1.3.7):
Expand Down Expand Up @@ -443,28 +443,22 @@ PODS:
- RNSVG (13.14.0):
- React-Core
- secp256k1.swift (0.1.4)
- SQLCipher (4.6.0):
- SQLCipher/standard (= 4.6.0)
- SQLCipher/common (4.6.0)
- SQLCipher/standard (4.6.0):
- SQLCipher/common
- SwiftProtobuf (1.25.2)
- web3.swift (1.6.0):
- BigInt (~> 5.0.0)
- GenericJSON (~> 2.0)
- Logging (~> 1.0.0)
- secp256k1.swift (~> 0.1)
- XMTP (0.13.6):
- XMTP (0.13.7):
- Connect-Swift (= 0.12.0)
- GzipSwift
- LibXMTP (= 0.5.4-beta4)
- LibXMTP (= 0.5.6-beta0)
- web3.swift
- XMTPReactNative (0.1.0):
- ExpoModulesCore
- MessagePacker
- secp256k1.swift
- SQLCipher
- XMTP (= 0.13.6)
- XMTP (= 0.13.7)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -553,7 +547,6 @@ SPEC REPOS:
- MMKVCore
- OpenSSL-Universal
- secp256k1.swift
- SQLCipher
- SwiftProtobuf
- web3.swift
- XMTP
Expand Down Expand Up @@ -718,7 +711,7 @@ SPEC CHECKSUMS:
GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa
hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
LibXMTP: 97cafc8cdde820552c9960739397fef256b635fa
LibXMTP: e7682dedb10e18343c011280d494a8e4a43d9eb7
Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26
MessagePacker: ab2fe250e86ea7aedd1a9ee47a37083edd41fd02
MMKV: 36a22a9ec84c9bb960613a089ddf6f48be9312b0
Expand Down Expand Up @@ -768,11 +761,10 @@ SPEC CHECKSUMS:
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SQLCipher: 30a8e81afa6128e600b17ffa77d0f92fa05ed208
SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
XMTP: aeeff5ecac80f7ec9a2ba4f732d439ab600545ed
XMTPReactNative: ee19ad5bbcd115abeb6a00041c92942c4243d0e1
XMTP: 16bd630ff61081d3a325619a26ea176ed256d419
XMTPReactNative: 4716836807cb33c72bde0846ac46b3fe923a3625
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,11 @@
"${PODS_ROOT}/Target Support Files/Pods-xmtpreactnativesdkexample/Pods-xmtpreactnativesdkexample-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher/SQLCipher.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SQLCipher.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -517,6 +515,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-l\"xmtpv3\"",
"$(inherited)",
"-Wl",
"-ld_classic",
Expand Down Expand Up @@ -576,6 +575,7 @@
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
"-l\"xmtpv3\"",
"$(inherited)",
"-Wl",
"-ld_classic",
Expand Down
12 changes: 6 additions & 6 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
233, 120, 198, 96, 154, 65, 132, 17, 132, 96, 250, 40, 103, 35, 125, 64,
166, 83, 208, 224, 254, 44, 205, 227, 175, 49, 234, 129, 74, 252, 135, 145,
])
const client = await Client.createRandom({

Check warning on line 34 in example/src/tests/groupTests.ts

View workflow job for this annotation

GitHub Actions / lint

'client' is assigned a value but never used
env: 'local',
appVersion: 'Testing/0.0.0',
enableV3: true,
Expand Down Expand Up @@ -885,15 +885,15 @@
caroClient.address,
])
await delayToPropogate()
if (groups.length !== 2) {
throw Error('Expected group length 2 but it is: ' + groups.length)
if (groups.length !== 3) {
throw Error('Expected group length 3 but it is: ' + groups.length)
}
// Sync groups after creation if you created a group
const listedGroups = await alixClient.conversations.listGroups()
await delayToPropogate()
groups.push(listedGroups[listedGroups.length - 1])
if ((groups.length as number) !== 3) {
throw Error('Expected group length 3 but it is: ' + groups.length)
if ((groups.length as number) !== 4) {
throw Error('Expected group length 4 but it is: ' + groups.length)
}

cancelStreamGroups()
Expand All @@ -905,8 +905,8 @@
alixClient.address,
])
await delayToPropogate()
if ((groups.length as number) !== 3) {
throw Error('Unexpected num groups (should be 3): ' + groups.length)
if ((groups.length as number) !== 4) {
throw Error('Unexpected num groups (should be 4): ' + groups.length)
}

return true
Expand Down
3 changes: 1 addition & 2 deletions ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Pod::Spec.new do |s|

s.source_files = "**/*.{h,m,swift}"
s.dependency 'secp256k1.swift'
s.dependency 'SQLCipher'
s.dependency "MessagePacker"
s.dependency "XMTP", "= 0.13.6"
s.dependency "XMTP", "= 0.13.7"
end
Loading