From 82504ddc6f56a7009d94bd4a28e672bd63f10ebc Mon Sep 17 00:00:00 2001 From: Pallab Maiti Date: Thu, 31 Aug 2023 12:34:00 +0530 Subject: [PATCH] fix: db encryption improvements (#381) --- Sources/Classes/RSDBPersistentManager.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Classes/RSDBPersistentManager.m b/Sources/Classes/RSDBPersistentManager.m index 017908b9..43eb9474 100644 --- a/Sources/Classes/RSDBPersistentManager.m +++ b/Sources/Classes/RSDBPersistentManager.m @@ -54,12 +54,12 @@ - (void)createDB:(RSDBEncryption * __nullable)dbEncryption { int code = [self openEncryptedDB:dbEncryption.key]; if (code == SQLITE_NOTADB) { // when key is wrong - // delete encrypted database; then open unencrypted database + // delete encrypted database; then open new encrypted database // all previous events will be deleted [RSLogger logError:@"RSDBPersistentManager: createDB: Wrong key is provided. Deleting encrypted DB and creating a new unencrypted DB"]; [self closeDB]; [RSUtils removeFile:ENCRYPTED_DB_NAME]; - [self openUnencryptedDB]; + [self openEncryptedDB:dbEncryption.key]; } } else { if (dbEncryption == nil || dbEncryption.key == nil) {