|
@@ -49,9 +49,10 @@ class NCManageDatabase: NSObject {
|
|
|
|
|
|
// Encrypting the database file on disk with AES-256+SHA2 by supplying a 64-byte encryption key
|
|
|
if NCBrandOptions.sharedInstance.use_database_encryption {
|
|
|
- if let keyData = NCBrandOptions.sharedInstance.databaseEncryptionKey.data(using: String.Encoding.utf8, allowLossyConversion: false) {
|
|
|
- configCompact.encryptionKey = keyData
|
|
|
- }
|
|
|
+ configCompact.encryptionKey = CCUtility.getDatabaseEncryptionKey()
|
|
|
+ //if let keyData = NCBrandOptions.sharedInstance.databaseEncryptionKey.data(using: String.Encoding.utf8, allowLossyConversion: false) {
|
|
|
+ // configCompact.encryptionKey = keyData
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
do {
|
|
@@ -139,12 +140,9 @@ class NCManageDatabase: NSObject {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-
|
|
|
// Encrypting the database file on disk with AES-256+SHA2 by supplying a 64-byte encryption key
|
|
|
if NCBrandOptions.sharedInstance.use_database_encryption {
|
|
|
- if let keyData = NCBrandOptions.sharedInstance.databaseEncryptionKey.data(using: String.Encoding.utf8, allowLossyConversion: false) {
|
|
|
- config.encryptionKey = keyData
|
|
|
- }
|
|
|
+ config.encryptionKey = CCUtility.getDatabaseEncryptionKey()
|
|
|
}
|
|
|
|
|
|
Realm.Configuration.defaultConfiguration = config
|