fixed encrypted sql database gets overwritten on sql-schema change (#887)
fix from: jobobby04
This commit is contained in:
parent
ac9048db46
commit
d28670a24c
@ -82,7 +82,10 @@ class AppModule(val app: Application) : InjektModule {
|
|||||||
|
|
||||||
addSingletonFactory<SqlDriver> {
|
addSingletonFactory<SqlDriver> {
|
||||||
// SY -->
|
// SY -->
|
||||||
System.loadLibrary("sqlcipher")
|
if (securityPreferences.encryptDatabase().get()) {
|
||||||
|
System.loadLibrary("sqlcipher")
|
||||||
|
}
|
||||||
|
|
||||||
// SY <--
|
// SY <--
|
||||||
AndroidSqliteDriver(
|
AndroidSqliteDriver(
|
||||||
schema = Database.Schema,
|
schema = Database.Schema,
|
||||||
@ -94,7 +97,7 @@ class AppModule(val app: Application) : InjektModule {
|
|||||||
LEGACY_DATABASE_NAME
|
LEGACY_DATABASE_NAME
|
||||||
},
|
},
|
||||||
factory = if (securityPreferences.encryptDatabase().get()) {
|
factory = if (securityPreferences.encryptDatabase().get()) {
|
||||||
SupportOpenHelperFactory(CbzCrypto.getDecryptedPasswordSql())
|
SupportOpenHelperFactory(CbzCrypto.getDecryptedPasswordSql(), null, false, 25)
|
||||||
} else if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
} else if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
// Support database inspector in Android Studio
|
// Support database inspector in Android Studio
|
||||||
FrameworkSQLiteOpenHelperFactory()
|
FrameworkSQLiteOpenHelperFactory()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user