Skip to content

Commit

Permalink
add op-sqlite and mendix/native
Browse files Browse the repository at this point in the history
  • Loading branch information
furkanarabaci authored and UrazAkgultan committed Nov 18, 2024
1 parent 511b0ea commit 98196d9
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 46 deletions.
21 changes: 13 additions & 8 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ PODS:
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- op-sqlite (9.1.2):
- OpenSSL-Universal
- React
- React-callinvoker
- React-Core
- OpenSSL-Universal (3.1.5007)
- PromisesObjC (2.4.0)
- QRCodeReader.swift (10.1.0)
- RCT-Folly (2024.01.01.00):
Expand Down Expand Up @@ -1444,9 +1450,6 @@ PODS:
- React-Core
- react-native-splash-screen (3.2.0):
- React
- react-native-sqlite-storage (7.1.0):
- React-Core
- SQLCipher
- react-native-video (6.4.5):
- DoubleConversion
- glog
Expand Down Expand Up @@ -1887,6 +1890,7 @@ DEPENDENCIES:
- GoogleMaps
- GoogleUtilities
- IQKeyboardManager
- "op-sqlite (from `../node_modules/@op-engineering/op-sqlite`)"
- QRCodeReader.swift (~> 10.1.0)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
Expand Down Expand Up @@ -1934,7 +1938,6 @@ DEPENDENCIES:
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- "react-native-sqlite-storage (from `../node_modules/@mendix/react-native-sqlite-storage`)"
- react-native-video (from `../node_modules/react-native-video`)
- react-native-view-shot (from `../node_modules/react-native-view-shot`)
- react-native-webview (from `../node_modules/react-native-webview`)
Expand Down Expand Up @@ -1992,7 +1995,7 @@ DEPENDENCIES:
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
trunk:
https://github.com/CocoaPods/Specs:
- Firebase
- FirebaseAnalytics
- FirebaseCore
Expand All @@ -2010,12 +2013,12 @@ SPEC REPOS:
- libwebp
- MultiplatformBleAdapter
- nanopb
- OpenSSL-Universal
- PromisesObjC
- QRCodeReader.swift
- SDWebImage
- SDWebImageWebPCoder
- SocketRocket
- SQLCipher
- SSZipArchive

EXTERNAL SOURCES:
Expand All @@ -2031,6 +2034,8 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/fmt.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
op-sqlite:
:path: "../node_modules/@op-engineering/op-sqlite"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTDeprecation:
Expand Down Expand Up @@ -2119,8 +2124,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-safe-area-context"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
react-native-sqlite-storage:
:path: "../node_modules/@mendix/react-native-sqlite-storage"
react-native-video:
:path: "../node_modules/react-native-video"
react-native-view-shot:
Expand Down Expand Up @@ -2254,6 +2257,8 @@ SPEC CHECKSUMS:
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
op-sqlite: ea5fd8301f488c7544281b3f85f257d520172049
OpenSSL-Universal: 2d916d735a0196be6a14b959ce976c564d392861
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
QRCodeReader.swift: 373a389fe9a22d513c879a32a6f647c58f4ef572
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
Expand Down
22 changes: 22 additions & 0 deletions ios/developerapp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
13B07F8E1A680F5B00A75B9A /* Resources */,
DF17395E25B4582800B65592 /* Embed Frameworks */,
C172FBA7B7AE84E7986F03ED /* [CP] Copy Pods Resources */,
640967B95A03B5199E113383 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -579,6 +580,24 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
640967B95A03B5199E113383 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Mendix-DeveloperApp/Pods-Mendix-DeveloperApp-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Mendix-DeveloperApp/Pods-Mendix-DeveloperApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C172FBA7B7AE84E7986F03ED /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -591,13 +610,16 @@
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle",
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle",
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle",
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager/IQKeyboardManager.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNDeviceInfo/RNDeviceInfoPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
Expand Down
Binary file added mendix-native-4.0.2-beta.4.tgz
Binary file not shown.
53 changes: 17 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@babylonjs/loaders": "6.8.1",
"@babylonjs/react-native": "1.6.3",
"@babylonjs/react-native-iosandroid-0-71": "1.6.3",
"@mendix/native": "file:mendix-native-4.0.1.tgz",
"@mendix/react-native-sqlite-storage": "^7.1.0",
"@mendix/native": "./mendix-native-4.0.2-beta.4.tgz",
"@op-engineering/op-sqlite": "9.1.2",
"@react-native-community/art": "1.2.0",
"@react-native-async-storage/async-storage": "2.0.0",
"@react-native-community/datetimepicker": "8.2.0",
Expand Down
127 changes: 127 additions & 0 deletions patches/@op-engineering+op-sqlite+9.1.2.patch
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

0 comments on commit 98196d9

Please sign in to comment.