From fcd38c008e731ec919b8e508dbf3f5f3019f66c0 Mon Sep 17 00:00:00 2001 From: Lisheng Guan Date: Fri, 27 Dec 2024 16:15:55 +0800 Subject: [PATCH] Encryption: switch to SQLite3MC --- app/build.gradle | 1 + .../main/java/com/money/manager/ex/core/ioc/DbModule.java | 3 ++- .../java/com/money/manager/ex/database/MmxOpenHelper.java | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d549698b1..685425b77 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -158,6 +158,7 @@ dependencies { , 'com.github.PhilJay:MPAndroidChart:v2.2.5' , 'org.javamoney:moneta-bp:1.4.1' , 'com.google.code.gson:gson:2.11.0' + , 'net.zetetic:android-database-sqlcipher:4.5.4' // database encryption , 'org.greenrobot:eventbus:3.3.1' , 'androidx.recyclerview:recyclerview:1.3.0' // For control over item selection of both touch and mouse driven selection diff --git a/app/src/main/java/com/money/manager/ex/core/ioc/DbModule.java b/app/src/main/java/com/money/manager/ex/core/ioc/DbModule.java index e53b71a6f..baf136199 100644 --- a/app/src/main/java/com/money/manager/ex/core/ioc/DbModule.java +++ b/app/src/main/java/com/money/manager/ex/core/ioc/DbModule.java @@ -19,7 +19,8 @@ import androidx.sqlite.db.SupportSQLiteOpenHelper; -import com.money.manager.ex.sqlite3mc.SupportFactory; +// import com.money.manager.ex.sqlite3mc.SupportFactory; +import net.sqlcipher.database.SupportFactory; import com.money.manager.ex.MmexApplication; import com.money.manager.ex.database.MmxOpenHelper; import com.squareup.sqlbrite3.BriteDatabase; diff --git a/app/src/main/java/com/money/manager/ex/database/MmxOpenHelper.java b/app/src/main/java/com/money/manager/ex/database/MmxOpenHelper.java index 43c1937ce..5d1db6158 100644 --- a/app/src/main/java/com/money/manager/ex/database/MmxOpenHelper.java +++ b/app/src/main/java/com/money/manager/ex/database/MmxOpenHelper.java @@ -26,7 +26,8 @@ import com.google.common.io.Files; import com.money.manager.ex.Constants; -import com.money.manager.ex.sqlite3mc.SupportFactory; +// import com.money.manager.ex.sqlite3mc.SupportFactory; +import net.sqlcipher.database.SupportFactory; import com.money.manager.ex.MmexApplication; import com.money.manager.ex.R; import com.money.manager.ex.core.Core; @@ -68,7 +69,7 @@ public MmxOpenHelper(Context context, String dbPath) { this.mPassword = MmexApplication.getApp().getPassword(); // Load the sqlite3mc native library. - System.loadLibrary("sqliteX"); + // System.loadLibrary("sqliteX"); } private final Context mContext;