diff --git a/example/ios/OPSQLiteExample.xcodeproj/project.pbxproj b/example/ios/OPSQLiteExample.xcodeproj/project.pbxproj index 0fb65abe..917d6e45 100644 --- a/example/ios/OPSQLiteExample.xcodeproj/project.pbxproj +++ b/example/ios/OPSQLiteExample.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 022AA638EE144393ADDCAEC0 /* sample.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 3B5A9E3FD2C56B364AF5A4F3 /* libPods-OPSQLiteExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE3066EB7AAB7E17B1CAB50 /* libPods-OPSQLiteExample.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - 022AA638EE144393ADDCAEC0 /* sample.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -29,8 +29,8 @@ 6EE3066EB7AAB7E17B1CAB50 /* libPods-OPSQLiteExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OPSQLiteExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = OPSQLiteExample/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-OPSQLiteExample-OPSQLiteExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OPSQLiteExample-OPSQLiteExampleTests.release.xcconfig"; path = "Target Support Files/Pods-OPSQLiteExample-OPSQLiteExampleTests/Pods-OPSQLiteExample-OPSQLiteExampleTests.release.xcconfig"; sourceTree = ""; }; + 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = sample.sqlite; path = ../assets/sample.sqlite; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */ = {isa = PBXFileReference; name = "sample.sqlite"; path = "../assets/sample.sqlite"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -98,6 +98,15 @@ name = Products; sourceTree = ""; }; + A9BA4AF2CBC44B9BB28B8ABA /* Resources */ = { + isa = PBXGroup; + children = ( + 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */, + ); + name = Resources; + path = ""; + sourceTree = ""; + }; BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( @@ -109,15 +118,6 @@ path = Pods; sourceTree = ""; }; - A9BA4AF2CBC44B9BB28B8ABA /* Resources */ = { - isa = "PBXGroup"; - children = ( - 96FD9FD0FC4F4540AC7A9CE6 /* sample.sqlite */, - ); - name = Resources; - sourceTree = ""; - path = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ diff --git a/example/ios/OPSQLiteExample/Info.plist b/example/ios/OPSQLiteExample/Info.plist index 3e884935..b3eb53c7 100644 --- a/example/ios/OPSQLiteExample/Info.plist +++ b/example/ios/OPSQLiteExample/Info.plist @@ -32,7 +32,7 @@ NSLocationWhenInUseUsageDescription - + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1b00a691..fb2a1336 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -15,10 +15,12 @@ PODS: - hermes-engine/Pre-built (= 0.73.1) - hermes-engine/Pre-built (0.73.1) - libevent (2.1.12) - - op-sqlite (3.0.1): + - op-sqlite (3.0.3): + - OpenSSL-Universal - React - React-callinvoker - React-Core + - OpenSSL-Universal (1.1.2200) - RCT-Folly (2022.05.16.00): - boost - DoubleConversion @@ -1124,6 +1126,7 @@ SPEC REPOS: trunk: - fmt - libevent + - OpenSSL-Universal - SocketRocket EXTERNAL SOURCES: @@ -1240,7 +1243,8 @@ SPEC CHECKSUMS: glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: 34df9d5034e90bd9bf1505e1ca198760373935af libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - op-sqlite: 24443c22e059972abf4109b4e781d3f03336a761 + op-sqlite: 0863e28c8cb854b0efff62b6e04f99a9e102229c + OpenSSL-Universal: 6e1ae0555546e604dbc632a2b9a24a9c46c41ef6 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 RCTRequired: 6dda55e483f75d2b43781d8ad5bd7df276a50981 RCTTypeSafety: df0f2632f4e89938b9b9f6152b5e6c66fc6e969e @@ -1289,4 +1293,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 0ab74fecad6ac2e35f8eab32fe5772c19d2015b2 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/example/src/App.tsx b/example/src/App.tsx index 1dad4035..0a2749b4 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -83,7 +83,7 @@ export default function App() { }; const copyDbPathToClipboad = async () => { - const db = await open({name: 'dbPath.sqlite'}); + const db = await open({name: 'dbPath.sqlite', encryptionKey: 'test'}); db.execute( 'CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY AUTOINCREMENT)', ); diff --git a/op-sqlite.podspec b/op-sqlite.podspec index a68d99c9..c298d7c8 100644 --- a/op-sqlite.podspec +++ b/op-sqlite.podspec @@ -28,7 +28,8 @@ Pod::Spec.new do |s| if ENV['OP_SQLITE_USE_SQLCIPHER'] == '1' then puts "OP-SQLITE using SQLCipher! 🔒\n" s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h" - xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_SQLCIPHER=1" + xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_SQLCIPHER=1 HAVE_FULLFSYNC=1 SQLITE_HAS_CODEC SQLITE_TEMP_STORE=2" + s.dependency "OpenSSL-Universal" else puts "OP-SQLITE using SQLite! 📦\n" s.exclude_files = "cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h" @@ -46,8 +47,6 @@ Pod::Spec.new do |s| optimizedCflags = other_cflags + '$(inherited) -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1' - - if ENV['OP_SQLITE_USE_PHONE_VERSION'] == '1' then puts "OP-SQLITE using iOS embedded SQLite! 📱\n" xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_PHONE_VERSION=1"