文字消息设置圆角

This commit is contained in:
shuaikangzhou
2023-11-20 19:08:11 +08:00
parent 7dbfc46e14
commit fe859ff2f7
6 changed files with 79 additions and 131 deletions

View File

@@ -5,6 +5,8 @@ from typing import Union, List
from Cryptodome.Cipher import AES
from app.log import log
# from Crypto.Cipher import AES # 如果上面的导入失败,可以尝试使用这个
SQLITE_FILE_HEADER = "SQLite format 3\x00" # SQLite文件头
@@ -15,6 +17,7 @@ DEFAULT_ITER = 64000
# 通过密钥解密数据库
@log
def decrypt(key: str, db_path, out_path):
if not os.path.exists(db_path):
return f"[-] db_path:'{db_path}' File not found!"
@@ -55,6 +58,7 @@ def decrypt(key: str, db_path, out_path):
return [True, db_path, out_path, key]
@log
def batch_decrypt(key: str, db_path: Union[str, List[str]], out_path: str):
if not isinstance(key, str) or not isinstance(out_path, str) or not os.path.exists(out_path) or len(key) != 64:
return f"[-] (key:'{key}' or out_path:'{out_path}') Error!"