From 7303bc06e5aa117432fec4f089e29d604c57b8ab Mon Sep 17 00:00:00 2001 From: Tek Date: Thu, 17 Oct 2024 11:28:13 +0200 Subject: [PATCH] Adds recovery of sqlite db when db is opened (#516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Donncha Ó Cearbhaill --- src/mvt/ios/modules/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mvt/ios/modules/base.py b/src/mvt/ios/modules/base.py index f36e69b..ef56a5d 100644 --- a/src/mvt/ios/modules/base.py +++ b/src/mvt/ios/modules/base.py @@ -49,7 +49,11 @@ class IOSExtraction(MVTModule): """ # TODO: Find a better solution. if not forced: - conn = self._open_sqlite_db(file_path) + # If the database is open, do not use immutable + if os.path.isfile(file_path + "-shm"): + conn = sqlite3.connect(file_path) + else: + conn = self._open_sqlite_db(file_path) cur = conn.cursor() try: