From fa2399d27e53684577bcea82486b85bf4323b13a Mon Sep 17 00:00:00 2001
From: shuaikangzhou <863909694@qq.com>
Date: Fri, 3 Nov 2023 23:24:23 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AD=E6=96=87=E8=B7=AF?=
=?UTF-8?q?=E5=BE=84=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
.idea/workspace.xml | 29 ++++++++++++++++++-----------
app/DataBase/data.py | 2 +-
app/Ui/decrypt/decrypt.py | 18 ++++++++++++------
4 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1fc986b..0bbcc8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.vscode
+.idea
build
data
sqlcipher-3.0.1
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3039714..67b3fcb 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,11 @@
-
+
+
-
-
-
+
@@ -466,7 +465,14 @@
1698853140384
-
+
+ 1698940208580
+
+
+
+ 1698940208580
+
+
@@ -523,23 +529,24 @@
-
+
+
-
- file://$PROJECT_DIR$/app/DataBase/output.py
- 42
-
-
file://$PROJECT_DIR$/app/DataBase/output.py
412
+
+ file://$PROJECT_DIR$/main.py
+ 18
+
+
diff --git a/app/DataBase/data.py b/app/DataBase/data.py
index 5d94e02..99b9fb5 100644
--- a/app/DataBase/data.py
+++ b/app/DataBase/data.py
@@ -129,7 +129,7 @@ def decrypt(db, key):
if not db:
print('没有数据库文件')
return False
- if os.path.exists('./app/DataBase/Msg.db'):
+ if is_db_exist():
print('/app/DataBase/Msg.db 已经存在')
return True
cmd = './sqlcipher-3.0.1/bin/sqlcipher-shell32.exe'
diff --git a/app/Ui/decrypt/decrypt.py b/app/Ui/decrypt/decrypt.py
index 5562a4c..981879b 100644
--- a/app/Ui/decrypt/decrypt.py
+++ b/app/Ui/decrypt/decrypt.py
@@ -8,7 +8,6 @@
@comment : ··· 解密数据库,导出原始数据库文件
"""
import hashlib
-import os
import time
import xml.etree.ElementTree as ET
@@ -32,11 +31,11 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
self.btn_db.clicked.connect(self.get_db)
self.btn_xml.clicked.connect(self.get_xml)
self.pushButton_3.clicked.connect(self.decrypt)
- self.xml_path = None
- self.db_path = None
+ self.xml_path: str = None
+ self.db_path: str = None
def db_exist(self):
- if os.path.exists('./app/DataBase/Msg.db'):
+ if data.is_db_exist():
self.btnEnterClicked()
self.close()
@@ -52,8 +51,13 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
def get_db(self):
self.db_path, _ = QFileDialog.getOpenFileName(self, 'Open file', r'..', "Database files (*.db)")
if self.db_path:
- self.label_db.setText('数据库已就绪')
- return self.db_path
+ if self.db_path.isascii():
+ self.label_db.setText('数据库已就绪')
+ return self.db_path
+ else:
+ self.label_db.setText('数据库未就绪')
+ QMessageBox.critical(self, "错误", "db文件请不要带有中文路径\n可以放在D:\\\\data 目录下")
+ self.db_path = ''
return False
def decrypt(self):
@@ -107,6 +111,8 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
:return: None
"""
self.progressBar.setProperty('value', value)
+ if value == '99':
+ QMessageBox.information(self, "温馨提示", "我知道你很急\n但你先别急")
if value == '100':
QMessageBox.information(self, "解密成功", "请退出该界面",
QMessageBox.Yes)