-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
511b0ea
commit 98196d9
Showing
6 changed files
with
181 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
diff --git a/node_modules/@op-engineering/op-sqlite/android/build.gradle b/node_modules/@op-engineering/op-sqlite/android/build.gradle | ||
index 4186aa3..242dd95 100644 | ||
--- a/node_modules/@op-engineering/op-sqlite/android/build.gradle | ||
+++ b/node_modules/@op-engineering/op-sqlite/android/build.gradle | ||
@@ -1,5 +1,4 @@ | ||
import java.nio.file.Paths | ||
-import groovy.json.JsonSlurper | ||
|
||
buildscript { | ||
repositories { | ||
@@ -27,28 +26,14 @@ def isNewArchitectureEnabled() { | ||
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" | ||
} | ||
|
||
-def useSQLCipher = false | ||
+def useSQLCipher = true | ||
def useLibsql = false | ||
def useCRSQLite = false | ||
-def performanceMode = "0" | ||
+def performanceMode = "2" | ||
def sqliteFlags = "" | ||
def enableFTS5 = false | ||
def useSqliteVec = false | ||
|
||
-def packageJsonFile = new File("$rootDir/../package.json") | ||
-def packageJson = new JsonSlurper().parseText(packageJsonFile.text) | ||
- | ||
-def opsqliteConfig = packageJson["op-sqlite"] | ||
-if(opsqliteConfig) { | ||
- useSQLCipher = opsqliteConfig["sqlcipher"] | ||
- useCRSQLite = opsqliteConfig["crsqlite"] | ||
- useSqliteVec = opsqliteConfig["sqliteVec"] | ||
- performanceMode = opsqliteConfig["performanceMode"] ? opsqliteConfig["performanceMode"] : "" | ||
- sqliteFlags = opsqliteConfig["sqliteFlags"] ? opsqliteConfig["sqliteFlags"] : "" | ||
- enableFTS5 = opsqliteConfig["fts5"] | ||
- useLibsql = opsqliteConfig["libsql"] | ||
-} | ||
- | ||
if(useSQLCipher) { | ||
println "[OP-SQLITE] using SQLCipher 🔒" | ||
} else if(useLibsql) { | ||
@@ -171,8 +156,8 @@ android { | ||
} | ||
|
||
compileOptions { | ||
- sourceCompatibility JavaVersion.VERSION_1_8 | ||
- targetCompatibility JavaVersion.VERSION_1_8 | ||
+ sourceCompatibility JavaVersion.VERSION_17 | ||
+ targetCompatibility JavaVersion.VERSION_17 | ||
} | ||
|
||
externalNativeBuild { | ||
diff --git a/node_modules/@op-engineering/op-sqlite/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt b/node_modules/@op-engineering/op-sqlite/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt | ||
index 7445a4c..2d922aa 100644 | ||
--- a/node_modules/@op-engineering/op-sqlite/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt | ||
+++ b/node_modules/@op-engineering/op-sqlite/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt | ||
@@ -2,9 +2,7 @@ package com.op.sqlite | ||
|
||
import com.facebook.react.bridge.ReactContext | ||
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl | ||
-import com.facebook.react.common.annotations.FrameworkAPI | ||
|
||
-@OptIn(FrameworkAPI::class) | ||
class OPSQLiteBridge { | ||
private external fun installNativeJsi( | ||
jsContextNativePointer: Long, | ||
diff --git a/node_modules/@op-engineering/op-sqlite/cpp/bindings.cpp b/node_modules/@op-engineering/op-sqlite/cpp/bindings.cpp | ||
index f5a3c48..512deaa 100644 | ||
--- a/node_modules/@op-engineering/op-sqlite/cpp/bindings.cpp | ||
+++ b/node_modules/@op-engineering/op-sqlite/cpp/bindings.cpp | ||
@@ -68,13 +68,6 @@ void install(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, | ||
options.getProperty(rt, "encryptionKey").asString(rt).utf8(rt); | ||
} | ||
|
||
-#ifdef OP_SQLITE_USE_SQLCIPHER | ||
- if (encryptionKey.empty()) { | ||
- throw std::runtime_error( | ||
- "[OP SQLite] using SQLCipher encryption key is required"); | ||
- } | ||
-#endif | ||
- | ||
if (!location.empty()) { | ||
if (location == ":memory:") { | ||
path = ":memory:"; | ||
diff --git a/node_modules/@op-engineering/op-sqlite/op-sqlite.podspec b/node_modules/@op-engineering/op-sqlite/op-sqlite.podspec | ||
index ee168c4..103e3bf 100644 | ||
--- a/node_modules/@op-engineering/op-sqlite/op-sqlite.podspec | ||
+++ b/node_modules/@op-engineering/op-sqlite/op-sqlite.podspec | ||
@@ -9,36 +9,16 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 | ||
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' | ||
|
||
parent_folder_name = File.basename(__dir__) | ||
-app_package = nil | ||
-# for development purposes on user machines the podspec should be able to read the package.json from the root folder | ||
-# since it lives inside node_modules/@op-engineering/op-sqlite | ||
-if __dir__.include?("node_modules") | ||
- app_package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) | ||
-else | ||
- app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json"))) | ||
-end | ||
|
||
-op_sqlite_config = app_package["op-sqlite"] | ||
-use_sqlcipher = false | ||
+use_sqlcipher = true | ||
use_crsqlite = false | ||
use_libsql = false | ||
-performance_mode = "0" | ||
+performance_mode = "2" | ||
phone_version = false | ||
sqlite_flags = "" | ||
fts5 = false | ||
use_sqlite_vec = false | ||
|
||
-if(op_sqlite_config != nil) | ||
- use_sqlcipher = op_sqlite_config["sqlcipher"] == true | ||
- use_crsqlite = op_sqlite_config["crsqlite"] == true | ||
- use_libsql = op_sqlite_config["libsql"] == true | ||
- performance_mode = op_sqlite_config["performanceMode"] || "0" | ||
- phone_version = op_sqlite_config["iosSqlite"] == true | ||
- sqlite_flags = op_sqlite_config["sqliteFlags"] || "" | ||
- fts5 = op_sqlite_config["fts5"] == true | ||
- use_sqlite_vec = op_sqlite_config["sqliteVec"] == true | ||
-end | ||
- | ||
if phone_version && use_sqlcipher | ||
raise "Cannot use phone embedded version and SQLCipher. SQLCipher needs to be compiled from sources with the project." | ||
end |