From e95ced4d51771bd6560c35015f60d5d73c570495 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Thu, 11 Jan 2024 11:39:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=93=E4=B8=9A=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=B8=AD=E8=A7=A3=E5=AF=86=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/api/api.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pywxdump/api/api.py b/pywxdump/api/api.py index 8333d6a..db8b86d 100644 --- a/pywxdump/api/api.py +++ b/pywxdump/api/api.py @@ -11,7 +11,7 @@ import os from flask import Flask, request, render_template, g, Blueprint, send_file from pywxdump import analyzer, read_img_dat, read_audio from pywxdump.api.rjson import ReJson, RqJson -from pywxdump import read_info,VERSION_LIST +from pywxdump import read_info, VERSION_LIST, batch_decrypt # app = Flask(__name__, static_folder='../ui/web/dist', static_url_path='/') @@ -200,6 +200,27 @@ def get_wxinfo(): pythoncom.CoUninitialize() return ReJson(0, wxinfos) + +@api.route('/api/decrypt', methods=["GET", 'POST']) +def decrypt(): + """ + 解密 + :return: + """ + key = request.json.get("key") + if not key: + return ReJson(1002) + wxdb_path = request.json.get("wxdbPath") + if not wxdb_path: + return ReJson(1002) + out_path = request.json.get("outPath") + if not out_path: + out_path = g.tmp_path + wxinfos = batch_decrypt(key, wxdb_path, out_path=out_path) + return ReJson(0, str(wxinfos)) + + +# END 这部分为专业工具的api @api.route('/') def index(): return render_template('index.html')