diff --git a/decrypt_db.py b/decrypt_db.py index e952141..7daab5c 100644 --- a/decrypt_db.py +++ b/decrypt_db.py @@ -176,6 +176,16 @@ def main(): else: failed += 1 + # 清理 sqlite3.connect() 验证遗留的 -shm/-wal 空文件 + # 避免后续工具打开 .db 时优先读旧 WAL 报 "database disk image is malformed" + for suffix in ("-shm", "-wal"): + residual = out_path + suffix + if os.path.exists(residual): + try: + os.remove(residual) + except OSError: + pass + print(f"\n{'='*60}") print(f"结果: {success} 成功, {failed} 失败, {skipped} 跳过(无密钥), 共 {len(db_files)} 个") print(f"解密数据量: {total_bytes/1024/1024/1024:.1f}GB")