This commit is contained in:
睿 安
2026-01-21 16:48:36 +08:00
commit abba5cb273
246 changed files with 57473 additions and 0 deletions

1
app/ui/tool/__init__.py Normal file
View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,206 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'getBiasAddrUi.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(650, 580)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.scrollArea = QtWidgets.QScrollArea(Form)
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 632, 562))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.label_4 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_4.setMaximumSize(QtCore.QSize(16777215, 20))
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.verticalLayout_3.addWidget(self.label_4)
self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget.setObjectName("widget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.widget)
self.label.setMinimumSize(QtCore.QSize(80, 0))
self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.lineEdit_tel = QtWidgets.QLineEdit(self.widget)
self.lineEdit_tel.setObjectName("lineEdit_tel")
self.horizontalLayout.addWidget(self.lineEdit_tel)
self.verticalLayout_3.addWidget(self.widget)
self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_3.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget_3.setObjectName("widget_3")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget_3)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_2 = QtWidgets.QLabel(self.widget_3)
self.label_2.setMinimumSize(QtCore.QSize(80, 0))
self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_2.setObjectName("label_2")
self.horizontalLayout_3.addWidget(self.label_2)
self.lineEdit_wx_alias = QtWidgets.QLineEdit(self.widget_3)
self.lineEdit_wx_alias.setObjectName("lineEdit_wx_alias")
self.horizontalLayout_3.addWidget(self.lineEdit_wx_alias)
self.verticalLayout_3.addWidget(self.widget_3)
self.widget_4 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_4.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget_4.setObjectName("widget_4")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget_4)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label_3 = QtWidgets.QLabel(self.widget_4)
self.label_3.setMinimumSize(QtCore.QSize(80, 0))
self.label_3.setLayoutDirection(QtCore.Qt.LeftToRight)
self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_3.setObjectName("label_3")
self.horizontalLayout_4.addWidget(self.label_3)
self.lineEdit_wx_name = QtWidgets.QLineEdit(self.widget_4)
self.lineEdit_wx_name.setObjectName("lineEdit_wx_name")
self.horizontalLayout_4.addWidget(self.lineEdit_wx_name)
self.verticalLayout_3.addWidget(self.widget_4)
self.btn_get_bias_addr = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
self.btn_get_bias_addr.setObjectName("btn_get_bias_addr")
self.verticalLayout_3.addWidget(self.btn_get_bias_addr)
self.widget_2 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_2.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget_2.setObjectName("widget_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2)
self.horizontalLayout_2.setContentsMargins(9, -1, -1, -1)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.commandLinkButton = QtWidgets.QCommandLinkButton(self.widget_2)
self.commandLinkButton.setEnabled(True)
self.commandLinkButton.setTabletTracking(False)
self.commandLinkButton.setFocusPolicy(QtCore.Qt.StrongFocus)
self.commandLinkButton.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
self.commandLinkButton.setToolTipDuration(-1)
self.commandLinkButton.setLayoutDirection(QtCore.Qt.LeftToRight)
self.commandLinkButton.setAutoFillBackground(False)
self.commandLinkButton.setCheckable(False)
self.commandLinkButton.setChecked(False)
self.commandLinkButton.setAutoRepeat(False)
self.commandLinkButton.setAutoExclusive(False)
self.commandLinkButton.setAutoDefault(False)
self.commandLinkButton.setDefault(False)
self.commandLinkButton.setObjectName("commandLinkButton")
self.horizontalLayout_2.addWidget(self.commandLinkButton)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.label_error_log = QtWidgets.QLabel(self.widget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_error_log.sizePolicy().hasHeightForWidth())
self.label_error_log.setSizePolicy(sizePolicy)
self.label_error_log.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_error_log.setObjectName("label_error_log")
self.horizontalLayout_2.addWidget(self.label_error_log)
self.checkBox_send_error_log = QtWidgets.QCheckBox(self.widget_2)
self.checkBox_send_error_log.setText("")
self.checkBox_send_error_log.setIconSize(QtCore.QSize(64, 64))
self.checkBox_send_error_log.setChecked(True)
self.checkBox_send_error_log.setObjectName("checkBox_send_error_log")
self.horizontalLayout_2.addWidget(self.checkBox_send_error_log)
self.verticalLayout_3.addWidget(self.widget_2)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.verticalLayout.addWidget(self.scrollArea)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.label_4.setText(_translate("Form", "为避免输入错误,下面信息请从微信里复制"))
self.label.setText(_translate("Form", "手机号:"))
self.lineEdit_tel.setPlaceholderText(_translate("Form", "填入微信绑定的手机号"))
self.label_2.setText(_translate("Form", "微信号:"))
self.lineEdit_wx_alias.setPlaceholderText(_translate("Form", "填入您的微信号"))
self.label_3.setText(_translate("Form", "微信昵称:"))
self.lineEdit_wx_name.setPlaceholderText(_translate("Form", "填入您的微信昵称"))
self.btn_get_bias_addr.setText(_translate("Form", "获取信息"))
self.commandLinkButton.setText(_translate("Form", "收集版本信息"))
self.commandLinkButton.setDescription(_translate("Form", "需要收集微信版本信息以支持更多用户"))
self.label_error_log.setText(_translate("Form", ""))

View File

@@ -0,0 +1,146 @@
import json
import os.path
from urllib.parse import urljoin
import requests
from PyQt5.QtCore import pyqtSignal, QThread
from PyQt5.QtWidgets import QWidget, QMessageBox
from app.components.QCursorGif import QCursorGif
from app.config import SERVER_API_URL
from app.decrypt.get_bias_addr import BiasAddr
from .getBiasAddrUi import Ui_Form
Stylesheet = """
QPushButton{
background-color: rgb(250,252,253);
border-radius: 5px;
padding: 8px;
border-right: 2px solid #888888; /* 按钮边框2px宽白色 */
border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */
border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */
border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */
}
QPushButton:hover {
background-color: lightgray;
}
/*去掉item虚线边框*/
QListWidget, QListView, QTreeWidget, QTreeView {
outline: 0px;
border:none;
}
/*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/
QListWidget {
min-width: 400px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
color: black;
border:none;
}
QListWidget::item{
min-width: 80px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
}
/*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected {
border-left:none;
color: black;
font-weight: bold;
}
QCheckBox::indicator {
background: rgb(251, 251, 251);
Width:60px;
Height:60px;
border-radius: 10px;
}
QCheckBox::indicator:unchecked{
Width:60px;
Height:60px;
image: url(:/icons/icons/按钮_关闭.svg);
}
QCheckBox::indicator:checked{
Width:60px;
Height:60px;
image: url(:/icons/icons/按钮_开启.svg);
}
"""
class GetBiasAddrControl(QWidget, Ui_Form, QCursorGif):
biasAddrSignal = pyqtSignal(dict)
def __init__(self, parent=None):
super(GetBiasAddrControl, self).__init__(parent)
self.thread = None
self.setStyleSheet(Stylesheet)
self.setupUi(self)
self.init_ui()
def init_ui(self):
self.initCursor([':/icons/icons/Cursors/%d.png' %
i for i in range(8)], self)
self.setCursorTimeout(100)
self.btn_get_bias_addr.clicked.connect(self.get_bias_addr)
self.commandLinkButton.clicked.connect(self.show_info)
self.checkBox_send_error_log.clicked.connect(self.set_error_log)
def set_error_log(self):
if self.checkBox_send_error_log.isChecked():
self.label_error_log.setText('')
else:
self.label_error_log.setText('')
def show_info(self):
QMessageBox.information(self, "收集版本信息",
"为了适配更多版本,需要收集微信的版本信息,该操作不会上传包括手机号、微信号、昵称等在内的任何信息\n示例数据:\n\"3.9.9.27\": [68065304, 0, 68065112, 0, 68066576]"
)
def upload(self, version_data):
url = urljoin(SERVER_API_URL, 'wxBiasAddr')
try:
requests.post(url, json={'bias_dict': version_data})
print('版本信息上传成功')
except:
pass
def get_bias_addr(self):
account = self.lineEdit_wx_alias.text()
mobile = self.lineEdit_tel.text()
name = self.lineEdit_wx_name.text()
if not all([account, mobile, name]):
QMessageBox.critical(self, "错误",
"请把所有信息填写完整")
return
key = None
db_path = "test"
self.startBusy()
self.thread = MyThread(account, mobile, name, key, db_path)
self.thread.signal.connect(self.set_bias_addr)
self.thread.start()
def set_bias_addr(self, data):
if self.checkBox_send_error_log.isChecked():
self.upload(data)
self.stopBusy()
self.biasAddrSignal.emit(data)
class MyThread(QThread):
signal = pyqtSignal(dict)
def __init__(self, account, mobile, name, key, db_path):
super(MyThread, self).__init__()
self.account = account
self.mobile = mobile
self.name = name
self.key = key
self.db_path = db_path
def run(self):
bias_addr = BiasAddr(self.account, self.mobile, self.name, self.key, self.db_path)
data = bias_addr.run(logging_path=True)
self.signal.emit(data)

View File

@@ -0,0 +1,3 @@
from .pc_decrypt import DecryptControl
__all__ = ['DecryptControl']

View File

@@ -0,0 +1,206 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'decryptUi.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(611, 519)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
Dialog.setFont(font)
Dialog.setLayoutDirection(QtCore.Qt.LeftToRight)
Dialog.setStyleSheet("QPushButton {\n"
" background: rgb(238,244,249);\n"
"}\n"
"QPushButton:hover{\n"
" background: rgb(230, 235, 240);\n"
"}")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_2.setObjectName("verticalLayout_2")
spacerItem = QtWidgets.QSpacerItem(20, 79, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
spacerItem1 = QtWidgets.QSpacerItem(78, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem2)
self.btn_help = QtWidgets.QPushButton(Dialog)
self.btn_help.setMinimumSize(QtCore.QSize(0, 40))
self.btn_help.setMaximumSize(QtCore.QSize(200, 16777215))
self.btn_help.setStyleSheet("")
self.btn_help.setObjectName("btn_help")
self.horizontalLayout_4.addWidget(self.btn_help)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.label_3 = QtWidgets.QLabel(Dialog)
font = QtGui.QFont()
font.setFamily("一纸情书")
font.setPointSize(20)
self.label_3.setFont(font)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.verticalLayout.addWidget(self.label_3)
self.label_9 = QtWidgets.QLabel(Dialog)
self.label_9.setAlignment(QtCore.Qt.AlignCenter)
self.label_9.setObjectName("label_9")
self.verticalLayout.addWidget(self.label_9)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.label_pid = QtWidgets.QLabel(Dialog)
self.label_pid.setText("")
self.label_pid.setObjectName("label_pid")
self.gridLayout.addWidget(self.label_pid, 0, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(Dialog)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 1, 0, 1, 1)
self.label_version = QtWidgets.QLabel(Dialog)
self.label_version.setText("")
self.label_version.setObjectName("label_version")
self.gridLayout.addWidget(self.label_version, 1, 1, 1, 1)
self.btn_getinfo = QtWidgets.QPushButton(Dialog)
self.btn_getinfo.setMinimumSize(QtCore.QSize(0, 40))
self.btn_getinfo.setObjectName("btn_getinfo")
self.gridLayout.addWidget(self.btn_getinfo, 1, 2, 2, 1)
self.checkBox = QtWidgets.QCheckBox(Dialog)
self.checkBox.setText("")
self.checkBox.setCheckable(False)
self.checkBox.setObjectName("checkBox")
self.gridLayout.addWidget(self.checkBox, 1, 3, 2, 1)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.lineEdit_phone = QtWidgets.QLineEdit(Dialog)
self.lineEdit_phone.setStyleSheet("background:transparent;\n"
"\n"
" border-radius:5px;\n"
" border-top: 0px solid #b2e281;\n"
" border-bottom: 2px solid black;\n"
" border-right: 0px solid #b2e281;\n"
" border-left: 0px solid #b2e281;\n"
"\n"
"\n"
" border-style:outset\n"
" ")
self.lineEdit_phone.setFrame(False)
self.lineEdit_phone.setObjectName("lineEdit_phone")
self.gridLayout.addWidget(self.lineEdit_phone, 2, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(Dialog)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 3, 0, 1, 1)
self.lineEdit_name = QtWidgets.QLineEdit(Dialog)
self.lineEdit_name.setStyleSheet("background:transparent;\n"
"\n"
" border-radius:5px;\n"
" border-top: 0px solid #b2e281;\n"
" border-bottom: 2px solid black;\n"
" border-right: 0px solid #b2e281;\n"
" border-left: 0px solid #b2e281;\n"
"\n"
"\n"
" border-style:outset\n"
" ")
self.lineEdit_name.setFrame(False)
self.lineEdit_name.setObjectName("lineEdit_name")
self.gridLayout.addWidget(self.lineEdit_name, 3, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1)
self.label_wxid = QtWidgets.QLabel(Dialog)
self.label_wxid.setText("")
self.label_wxid.setObjectName("label_wxid")
self.gridLayout.addWidget(self.label_wxid, 4, 1, 1, 1)
self.btn_db_dir = QtWidgets.QPushButton(Dialog)
self.btn_db_dir.setMinimumSize(QtCore.QSize(0, 40))
self.btn_db_dir.setObjectName("btn_db_dir")
self.gridLayout.addWidget(self.btn_db_dir, 4, 2, 3, 1)
self.label_6 = QtWidgets.QLabel(Dialog)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1)
self.label_key = QtWidgets.QLabel(Dialog)
self.label_key.setMaximumSize(QtCore.QSize(400, 16777215))
self.label_key.setText("")
self.label_key.setObjectName("label_key")
self.gridLayout.addWidget(self.label_key, 5, 1, 1, 1)
self.checkBox_2 = QtWidgets.QCheckBox(Dialog)
self.checkBox_2.setText("")
self.checkBox_2.setCheckable(False)
self.checkBox_2.setObjectName("checkBox_2")
self.gridLayout.addWidget(self.checkBox_2, 5, 3, 1, 1)
self.label_8 = QtWidgets.QLabel(Dialog)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 6, 0, 1, 1)
self.label_db_dir = QtWidgets.QLabel(Dialog)
self.label_db_dir.setMaximumSize(QtCore.QSize(400, 300))
self.label_db_dir.setText("")
self.label_db_dir.setObjectName("label_db_dir")
self.gridLayout.addWidget(self.label_db_dir, 6, 1, 1, 1)
self.verticalLayout.addLayout(self.gridLayout)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem4)
self.btn_start = QtWidgets.QPushButton(Dialog)
self.btn_start.setMinimumSize(QtCore.QSize(80, 40))
self.btn_start.setMaximumSize(QtCore.QSize(200, 16777215))
self.btn_start.setObjectName("btn_start")
self.horizontalLayout_2.addWidget(self.btn_start)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem5)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_ready = QtWidgets.QLabel(Dialog)
self.label_ready.setObjectName("label_ready")
self.horizontalLayout.addWidget(self.label_ready)
self.progressBar = QtWidgets.QProgressBar(Dialog)
self.progressBar.setProperty("value", 0)
self.progressBar.setObjectName("progressBar")
self.horizontalLayout.addWidget(self.progressBar)
self.verticalLayout.addLayout(self.horizontalLayout)
self.horizontalLayout_3.addLayout(self.verticalLayout)
spacerItem6 = QtWidgets.QSpacerItem(128, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem6)
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
spacerItem7 = QtWidgets.QSpacerItem(20, 79, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem7)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.btn_help.setText(_translate("Dialog", "使用说明"))
self.label_3.setText(_translate("Dialog", "解密数据库"))
self.label_9.setText(_translate("Dialog", "以下内容为自动获取,如获取失败请手动填写"))
self.label.setText(_translate("Dialog", "PID"))
self.label_7.setText(_translate("Dialog", "版本"))
self.btn_getinfo.setText(_translate("Dialog", "获取信息"))
self.label_2.setText(_translate("Dialog", "手机号"))
self.label_5.setText(_translate("Dialog", "微信昵称"))
self.label_4.setText(_translate("Dialog", "wxid"))
self.btn_db_dir.setText(_translate("Dialog", "设置微信路径"))
self.label_6.setText(_translate("Dialog", "密钥"))
self.label_8.setText(_translate("Dialog", "微信路径"))
self.btn_start.setText(_translate("Dialog", "开始启动"))
self.label_ready.setText(_translate("Dialog", "未就绪"))

View File

@@ -0,0 +1,340 @@
import json
import os.path
import sys
import traceback
from urllib.parse import urljoin
import requests
from PyQt5.QtCore import pyqtSignal, QThread, QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog
from app.DataBase import msg_db, misc_db, close_db
from app.DataBase.merge import merge_databases, merge_MediaMSG_databases
from app.components.QCursorGif import QCursorGif
from app.config import INFO_FILE_PATH, DB_DIR, SERVER_API_URL
from app.decrypt import get_wx_info, decrypt
from app.log import logger
from app.util import path
from . import decryptUi
from ...Icon import Icon
from ...menu.about_dialog import Decrypt
class DecryptControl(QWidget, decryptUi.Ui_Dialog, QCursorGif):
DecryptSignal = pyqtSignal(bool)
get_wxidSignal = pyqtSignal(str)
versionErrorSignal = pyqtSignal(str)
def __init__(self, parent=None):
super(DecryptControl, self).__init__(parent)
self.max_val = 0
self.setupUi(self)
# 设置忙碌光标图片数组
self.initCursor([':/icons/icons/Cursors/%d.png' %
i for i in range(8)], self)
self.setCursorTimeout(100)
self.version_list = None
self.btn_start.clicked.connect(self.decrypt)
self.btn_getinfo.clicked.connect(self.get_info)
self.btn_db_dir.clicked.connect(self.select_db_dir)
# self.lineEdit.returnPressed.connect(self.set_wxid)
# self.lineEdit.textChanged.connect(self.set_wxid_)
self.lineEdit_name.returnPressed.connect(self.set_wxid)
self.lineEdit_name.textChanged.connect(self.set_wxid_)
self.lineEdit_phone.returnPressed.connect(self.set_wxid)
self.lineEdit_phone.textChanged.connect(self.set_wxid_)
self.btn_help.clicked.connect(self.show_help)
self.btn_getinfo.setIcon(Icon.Get_info_Icon)
self.btn_db_dir.setIcon(Icon.Folder_Icon)
self.btn_start.setIcon(Icon.Start_Icon)
self.btn_help.setIcon(Icon.Help_Icon)
self.info = {}
self.lineEdit_name.setFocus()
self.ready = False
self.wx_dir = None
def show_help(self):
# 定义网页链接
url = QUrl("https://blog.lc044.love/post/4")
# 使用QDesktopServices打开网页
QDesktopServices.openUrl(url)
# @log
def get_info(self):
self.startBusy()
self.get_info_thread = MyThread(self.version_list)
self.get_info_thread.signal.connect(self.set_info)
self.get_info_thread.start()
def set_info(self, result):
# print(result)
if result[0] == -1:
QMessageBox.critical(self, "错误", "请登录微信")
elif result[0] == -2:
self.versionErrorSignal.emit(result[1])
QMessageBox.critical(self, "错误",
"微信版本不匹配\n请手动填写信息")
elif result[0] == -3:
QMessageBox.critical(self, "错误", "WeChat WeChatWin.dll Not Found")
elif result[0] == -10086:
QMessageBox.critical(self, "错误", "未知错误,请收集错误信息")
else:
self.ready = True
self.info = result[0]
self.label_key.setText(self.info['key'])
self.label_wxid.setText(self.info['wxid'])
self.lineEdit_name.setText(self.info['name'])
self.lineEdit_phone.setText(self.info['mobile'])
self.label_pid.setText(str(self.info['pid']))
self.label_version.setText(self.info['version'])
self.lineEdit_name.setFocus()
self.checkBox.setCheckable(True)
self.checkBox.setChecked(True)
self.get_wxidSignal.emit(self.info['wxid'])
directory = os.path.join(path.wx_path(), self.info['wxid'])
if os.path.exists(directory):
self.label_db_dir.setText(directory)
self.wx_dir = directory
self.checkBox_2.setCheckable(True)
self.checkBox_2.setChecked(True)
self.ready = True
if self.ready:
self.label_ready.setText('已就绪')
if self.wx_dir and os.path.exists(os.path.join(self.wx_dir)):
self.label_ready.setText('已就绪')
self.stopBusy()
def set_wxid_(self):
if self.sender() == self.lineEdit_name:
self.info['name'] = self.lineEdit_name.text()
elif self.sender() == self.lineEdit_phone:
self.info['mobel'] = self.lineEdit_phone.text()
def set_wxid(self):
if self.sender() == self.lineEdit_name:
self.info['name'] = self.lineEdit_name.text()
QMessageBox.information(self, "ok", f"昵称修改成功{self.info['name']}")
elif self.sender() == self.lineEdit_phone:
self.info['mobile'] = self.lineEdit_phone.text()
QMessageBox.information(self, "ok", f"手机号修改成功{self.info['mobile']}")
def select_db_dir(self):
directory = QFileDialog.getExistingDirectory(
self, "选取微信文件保存目录——能看到Msg文件夹",
path.wx_path()
) # 起始路径
db_dir = os.path.join(directory, 'Msg')
if not os.path.exists(db_dir):
QMessageBox.critical(self, "错误", "文件夹选择错误\n一般以wxid_xxx结尾")
return
self.label_db_dir.setText(directory)
self.wx_dir = directory
self.checkBox_2.setCheckable(True)
self.checkBox_2.setChecked(True)
if self.ready:
self.label_ready.setText('已就绪')
def decrypt(self):
if not self.ready:
QMessageBox.critical(self, "错误", "请先获取信息")
return
if not self.wx_dir:
QMessageBox.critical(self, "错误", "请先选择微信安装路径")
return
if self.label_wxid.text() == 'None':
QMessageBox.critical(self, "错误", "请填入wxid")
return
db_dir = os.path.join(self.wx_dir, 'Msg')
if self.ready:
if not os.path.exists(db_dir):
QMessageBox.critical(self, "错误", "文件夹选择错误\n一般以wxid_xxx结尾")
return
if self.info.get('key') == 'None':
QMessageBox.critical(self, "错误",
"密钥错误\n请查看教程解决相关问题")
close_db()
self.thread2 = DecryptThread(db_dir, self.info['key'])
self.thread2.maxNumSignal.connect(self.setProgressBarMaxNum)
self.thread2.signal.connect(self.progressBar_view)
self.thread2.okSignal.connect(self.btnExitClicked)
self.thread2.errorSignal.connect(
lambda x: QMessageBox.critical(self, "错误",
"错误\n请检查微信版本是否为最新和微信路径是否正确\n或者关闭微信多开")
)
self.thread2.start()
def btnEnterClicked(self):
# print("enter clicked")
# 中间可以添加处理逻辑
# QMessageBox.about(self, "解密成功", "数据库文件存储在app/DataBase/Msg文件夹下")
self.progressBar_view(self.max_val)
self.DecryptSignal.emit(True)
# self.close()
def setProgressBarMaxNum(self, max_val):
self.max_val = max_val
self.progressBar.setRange(0, max_val)
def progressBar_view(self, value):
"""
进度条显示
:param value: 进度0-100
:return: None
"""
self.progressBar.setProperty('value', value)
# self.btnExitClicked()
# data.init_database()
def btnExitClicked(self):
# print("Exit clicked")
dic = {
'wxid': self.info['wxid'],
'wx_dir': self.wx_dir,
'name': self.info['name'],
'mobile': self.info['mobile'],
'token': Decrypt.decrypt(self.info['wxid'])
}
try:
with open(INFO_FILE_PATH, "w", encoding="utf-8") as f:
json.dump(dic, f, ensure_ascii=False, indent=4)
except:
with open('./info.json', 'w', encoding='utf-8') as f:
f.write(json.dumps(dic))
self.progressBar_view(self.max_val)
self.DecryptSignal.emit(True)
self.close()
class DecryptThread(QThread):
signal = pyqtSignal(str)
maxNumSignal = pyqtSignal(int)
okSignal = pyqtSignal(str)
errorSignal = pyqtSignal(bool)
def __init__(self, db_path, key):
super(DecryptThread, self).__init__()
self.db_path = db_path
self.key = key
self.textBrowser = None
def __del__(self):
pass
def run(self):
close_db()
output_dir = DB_DIR
os.makedirs(output_dir, exist_ok=True)
tasks = []
if os.path.exists(self.db_path):
for root, dirs, files in os.walk(self.db_path):
for file in files:
if '.db' == file[-3:]:
if 'xInfo.db' == file:
continue
inpath = os.path.join(root, file)
# print(inpath)
output_path = os.path.join(output_dir, file)
tasks.append([self.key, inpath, output_path])
else:
try:
name, suffix = file.split('.')
if suffix.startswith('db_SQLITE'):
inpath = os.path.join(root, file)
# print(inpath)
output_path = os.path.join(output_dir, name + '.db')
tasks.append([self.key, inpath, output_path])
except:
continue
self.maxNumSignal.emit(len(tasks))
for i, task in enumerate(tasks):
if decrypt.decrypt(*task) == -1:
self.errorSignal.emit(True)
self.signal.emit(str(i))
# print(self.db_path)
# 目标数据库文件
target_database = os.path.join(DB_DIR, 'MSG.db')
# 源数据库文件列表
source_databases = [os.path.join(DB_DIR, f"MSG{i}.db") for i in range(1, 50)]
import shutil
if os.path.exists(target_database):
os.remove(target_database)
shutil.copy2(os.path.join(DB_DIR, 'MSG0.db'), target_database) # 使用一个数据库文件作为模板
# 合并数据库
merge_databases(source_databases, target_database)
# 音频数据库文件
target_database = os.path.join(DB_DIR, 'MediaMSG.db')
# 源数据库文件列表
if os.path.exists(target_database):
os.remove(target_database)
source_databases = [os.path.join(DB_DIR, f"MediaMSG{i}.db") for i in range(1, 50)]
shutil.copy2(os.path.join(DB_DIR, 'MediaMSG0.db'), target_database) # 使用一个数据库文件作为模板
# 合并数据库
merge_MediaMSG_databases(source_databases, target_database)
self.okSignal.emit('ok')
# self.signal.emit('100')
class MyThread(QThread):
signal = pyqtSignal(list)
def __init__(self, version_list=None):
super(MyThread, self).__init__()
self.version_list = version_list
def __del__(self):
pass
def get_bias_add(self, version):
url = urljoin(SERVER_API_URL, 'wxBiasAddr')
data = {
'version': version
}
try:
response = requests.get(url, json=data)
print(response)
print(response.text)
if response.status_code == 200:
update_info = response.json()
return update_info
else:
return {}
except:
return {}
def run(self):
if self.version_list:
VERSION_LIST = self.version_list
else:
file_path = './app/resources/data/version_list.json'
if not os.path.exists(file_path):
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
file_path = os.path.join(resource_dir, 'app', 'resources', 'data', 'version_list.json')
with open(file_path, "r", encoding="utf-8") as f:
VERSION_LIST = json.loads(f.read())
try:
result = get_wx_info.get_info(VERSION_LIST)
if result == -1:
result = [result]
elif result == -2:
result = [result]
elif result == -3:
result = [result]
elif isinstance(result, str):
version = result
# version = '3.9.9.43'
version_bias = self.get_bias_add(version)
if version_bias.get(version):
logger.info(f"从云端获取内存基址:{version_bias}")
result = get_wx_info.get_info(version_bias)
else:
logger.info(f"从云端获取内存基址失败:{version}")
result = [-2, version]
except:
logger.error(traceback.format_exc())
result = [-10086]
self.signal.emit(result)

View File

@@ -0,0 +1,208 @@
import json
import os.path
import time
import requests
from PyQt5.QtCore import pyqtSignal, QThread
from PyQt5.QtWidgets import QWidget, QMessageBox
from app.config import SEND_LOG_FLAG
from app.person import Me
from .settingUi import Ui_Form
Stylesheet = """
QPushButton{
background-color: rgb(250,252,253);
border-radius: 5px;
padding: 8px;
border-right: 2px solid #888888; /* 按钮边框2px宽白色 */
border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */
border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */
border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */
}
QPushButton:hover {
background-color: lightgray;
}
/*去掉item虚线边框*/
QListWidget, QListView, QTreeWidget, QTreeView {
outline: 0px;
border:none;
}
/*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/
QListWidget {
min-width: 400px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
color: black;
border:none;
}
QListWidget::item{
min-width: 80px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
}
/*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected {
border-left:none;
color: black;
font-weight: bold;
}
QCheckBox::indicator {
background: rgb(251, 251, 251);
Width:60px;
Height:60px;
border-radius: 10px;
}
QCheckBox::indicator:unchecked{
Width:60px;
Height:60px;
image: url(:/icons/icons/按钮_关闭.svg);
}
QCheckBox::indicator:checked{
Width:60px;
Height:60px;
image: url(:/icons/icons/按钮_开启.svg);
}
"""
def set_SEND_LOG_FLAG(flag):
# noinspection PyGlobalUndefined
global SEND_LOG_FLAG
SEND_LOG_FLAG = flag
class SettingControl(QWidget, Ui_Form):
def __init__(self, parent=None):
super(SettingControl, self).__init__(parent)
self.setStyleSheet(Stylesheet)
self.setupUi(self)
self.btn_addstopword.clicked.connect(self.add_stopwords)
self.btn_addnewword_2.clicked.connect(self.add_new_words)
self.commandLinkButton_send_error_log.clicked.connect(self.show_info)
self.btn_send_error_log.clicked.connect(self.send_error_log)
self.init_ui()
self.read_data()
def init_ui(self):
self.checkBox.setText('')
self.checkBox_send_error_log.clicked.connect(self.set_error_log)
def show_info(self):
QMessageBox.information(self, "收集错误信息",
"为了更好的解决用户问题,需要收集软件崩溃导致的错误信息,该操作不会上传包括手机号、微信号、昵称等在内的任何信息\n"
)
def set_error_log(self):
if self.checkBox_send_error_log.isChecked():
self.label_error_log.setText('')
set_SEND_LOG_FLAG(True)
else:
self.label_error_log.setText('')
set_SEND_LOG_FLAG(False)
print('SEND_LOG_FLAG:', SEND_LOG_FLAG)
def read_data(self):
os.makedirs('./app/data', exist_ok=True)
stopwords = ['裂开', '苦涩', '叹气', '凋谢', '让我看看', '', '奋斗', '疑问', '擦汗', '抠鼻', '鄙视', '勾引',
'奸笑', '嘿哈', '捂脸', '机智', '加油', '吃瓜', '尴尬', '炸弹', '旺柴']
new_words = ['YYDS', '666', '显眼包', '遥遥领先']
if os.path.exists('./app/data/stopwords.txt'):
with open('./app/data/stopwords.txt', 'r', encoding='utf-8') as f:
stopwords = set(f.read().splitlines())
self.plainTextEdit.setPlainText(' '.join(stopwords))
else:
self.plainTextEdit.setPlainText(' '.join(stopwords))
stopwords = '\n'.join(stopwords)
with open('./app/data/stopwords.txt', 'w', encoding='utf-8') as f:
f.write(stopwords)
if os.path.exists('./app/data/new_words.txt'):
with open('./app/data/new_words.txt', 'r', encoding='utf-8') as f:
new_words = set(f.read().splitlines())
self.plainTextEdit_newword.setPlainText(' '.join(new_words))
else:
self.plainTextEdit_newword.setPlainText(' '.join(new_words))
stopwords = '\n'.join(new_words)
with open('./app/data/new_words.txt', 'w', encoding='utf-8') as f:
f.write(stopwords)
def add_stopwords(self):
text = self.plainTextEdit.toPlainText()
stopwords = '\n'.join(text.split())
with open('./app/data/stopwords.txt', 'w', encoding='utf-8') as f:
f.write(stopwords)
QMessageBox.about(self, "添加成功", "停用词添加成功")
def add_new_words(self):
text = self.plainTextEdit_newword.toPlainText()
new_words = '\n'.join(text.split())
with open('./app/data/new_words.txt', 'w', encoding='utf-8') as f:
f.write(new_words)
QMessageBox.about(self, "添加成功", "自定义词添加成功")
def send_error_log(self):
self.send_thread = MyThread()
self.send_thread.signal.connect(self.show_resp)
self.send_thread.start()
def show_resp(self, message):
if message.get('code') == 200:
QMessageBox.about(self, "发送结果", f"日志发送成功\n{message.get('message')}")
else:
QMessageBox.about(self, "发送结果", f"{message.get('code')}:{message.get('errmsg')}")
class MyThread(QThread):
signal = pyqtSignal(dict)
def __init__(self, message=''):
super(MyThread, self).__init__()
if message:
self.message = message
else:
filename = time.strftime("%Y-%m-%d", time.localtime(time.time()))
file_path = f'{filename}-log.log'
if os.path.exists(file_path):
with open(file_path, 'r', encoding='gbk') as f:
self.message = f.read()
elif os.path.exists(f'./app/log/logs/{filename}-log.log'):
with open(f'./app/log/logs/{filename}-log.log', 'r', encoding='gbk') as f:
self.message = f.read()
def __del__(self):
pass
def send_error_msg(self, message):
url = "http://api.lc044.love/error"
if not message:
return {
'code': 201,
'errmsg': '日志为空'
}
data = {
'username': Me().wxid,
'error': message
}
try:
response = requests.post(url, json=data)
if response.status_code == 200:
resp_info = response.json()
return resp_info
else:
return {
'code': 503,
'errmsg': '服务器错误'
}
except:
return {
'code': 404,
'errmsg': '客户端错误'
}
def run(self):
resp_info = self.send_error_msg(self.message)
self.signal.emit(resp_info)

View File

@@ -0,0 +1,204 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'settingUi.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(638, 696)
self.verticalLayout_6 = QtWidgets.QVBoxLayout(Form)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.scrollArea = QtWidgets.QScrollArea(Form)
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, -20, 595, 728))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget.setObjectName("widget")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.widget)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(self.widget)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.plainTextEdit = QtWidgets.QPlainTextEdit(self.widget)
self.plainTextEdit.setFrameShape(QtWidgets.QFrame.Box)
self.plainTextEdit.setFrameShadow(QtWidgets.QFrame.Sunken)
self.plainTextEdit.setObjectName("plainTextEdit")
self.horizontalLayout.addWidget(self.plainTextEdit)
self.btn_addstopword = QtWidgets.QPushButton(self.widget)
self.btn_addstopword.setObjectName("btn_addstopword")
self.horizontalLayout.addWidget(self.btn_addstopword)
self.verticalLayout.addLayout(self.horizontalLayout)
self.verticalLayout_4.addLayout(self.verticalLayout)
self.verticalLayout_3.addWidget(self.widget)
self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_3.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget_3.setObjectName("widget_3")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.widget_3)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label_2 = QtWidgets.QLabel(self.widget_3)
self.label_2.setObjectName("label_2")
self.verticalLayout_2.addWidget(self.label_2)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.plainTextEdit_newword = QtWidgets.QPlainTextEdit(self.widget_3)
self.plainTextEdit_newword.setFrameShape(QtWidgets.QFrame.Box)
self.plainTextEdit_newword.setFrameShadow(QtWidgets.QFrame.Sunken)
self.plainTextEdit_newword.setPlainText("")
self.plainTextEdit_newword.setObjectName("plainTextEdit_newword")
self.horizontalLayout_3.addWidget(self.plainTextEdit_newword)
self.btn_addnewword_2 = QtWidgets.QPushButton(self.widget_3)
self.btn_addnewword_2.setObjectName("btn_addnewword_2")
self.horizontalLayout_3.addWidget(self.btn_addnewword_2)
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
self.verticalLayout_5.addLayout(self.verticalLayout_2)
self.verticalLayout_3.addWidget(self.widget_3)
self.widget_2 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_2.setStyleSheet("QWidget{\n"
" background-color:rgb(251,251,251);\n"
" border-radius: 10px;\n"
"}\n"
"\n"
"QPushButton{\n"
" background-color: rgb(250,252,253);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" border-right: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */\n"
" border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
" border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"
"}")
self.widget_2.setObjectName("widget_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2)
self.horizontalLayout_2.setContentsMargins(9, -1, -1, -1)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.commandLinkButton_send_error_log = QtWidgets.QCommandLinkButton(self.widget_2)
self.commandLinkButton_send_error_log.setEnabled(True)
self.commandLinkButton_send_error_log.setTabletTracking(False)
self.commandLinkButton_send_error_log.setFocusPolicy(QtCore.Qt.StrongFocus)
self.commandLinkButton_send_error_log.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
self.commandLinkButton_send_error_log.setToolTipDuration(-1)
self.commandLinkButton_send_error_log.setLayoutDirection(QtCore.Qt.LeftToRight)
self.commandLinkButton_send_error_log.setAutoFillBackground(False)
self.commandLinkButton_send_error_log.setCheckable(False)
self.commandLinkButton_send_error_log.setChecked(False)
self.commandLinkButton_send_error_log.setAutoRepeat(False)
self.commandLinkButton_send_error_log.setAutoExclusive(False)
self.commandLinkButton_send_error_log.setAutoDefault(False)
self.commandLinkButton_send_error_log.setDefault(False)
self.commandLinkButton_send_error_log.setObjectName("commandLinkButton_send_error_log")
self.horizontalLayout_2.addWidget(self.commandLinkButton_send_error_log)
self.btn_send_error_log = QtWidgets.QPushButton(self.widget_2)
self.btn_send_error_log.setObjectName("btn_send_error_log")
self.horizontalLayout_2.addWidget(self.btn_send_error_log)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.label_error_log = QtWidgets.QLabel(self.widget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_error_log.sizePolicy().hasHeightForWidth())
self.label_error_log.setSizePolicy(sizePolicy)
self.label_error_log.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_error_log.setObjectName("label_error_log")
self.horizontalLayout_2.addWidget(self.label_error_log)
self.checkBox_send_error_log = QtWidgets.QCheckBox(self.widget_2)
self.checkBox_send_error_log.setText("")
self.checkBox_send_error_log.setIconSize(QtCore.QSize(64, 64))
self.checkBox_send_error_log.setChecked(True)
self.checkBox_send_error_log.setObjectName("checkBox_send_error_log")
self.horizontalLayout_2.addWidget(self.checkBox_send_error_log)
self.verticalLayout_3.addWidget(self.widget_2)
self.checkBox_2 = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
self.checkBox_2.setObjectName("checkBox_2")
self.verticalLayout_3.addWidget(self.checkBox_2)
self.checkBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
self.checkBox.setObjectName("checkBox")
self.verticalLayout_3.addWidget(self.checkBox)
self.commandLinkButton_2 = QtWidgets.QCommandLinkButton(self.scrollAreaWidgetContents)
self.commandLinkButton_2.setCheckable(True)
self.commandLinkButton_2.setObjectName("commandLinkButton_2")
self.verticalLayout_3.addWidget(self.commandLinkButton_2)
self.radioButton = QtWidgets.QRadioButton(self.scrollAreaWidgetContents)
self.radioButton.setObjectName("radioButton")
self.verticalLayout_3.addWidget(self.radioButton)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.verticalLayout_6.addWidget(self.scrollArea)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.label.setText(_translate("Form", "文本框里输入年度报告词云停用词,每个词之间用空格隔开"))
self.plainTextEdit.setPlainText(_translate("Form", "哈哈哈 发呆"))
self.btn_addstopword.setText(_translate("Form", "添加停用词"))
self.label_2.setText(_translate("Form", "文本框里输入年度报告词云自定义词,每个词之间用空格隔开"))
self.btn_addnewword_2.setText(_translate("Form", "添加自定义词"))
self.commandLinkButton_send_error_log.setText(_translate("Form", "收集错误日志"))
self.commandLinkButton_send_error_log.setDescription(_translate("Form", "收集错误信息以帮助改进"))
self.btn_send_error_log.setText(_translate("Form", "手动发送"))
self.label_error_log.setText(_translate("Form", ""))
self.checkBox_2.setText(_translate("Form", "CheckBox"))
self.checkBox.setText(_translate("Form", "CheckBox"))
self.commandLinkButton_2.setText(_translate("Form", "CommandLinkButton"))
self.radioButton.setText(_translate("Form", "RadioButton"))

85
app/ui/tool/toolUI.py Normal file
View File

@@ -0,0 +1,85 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'toolUI.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(590, 547)
font = QtGui.QFont()
font.setFamily("微软雅黑")
Dialog.setFont(font)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.horizontalLayout.setSpacing(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(Dialog)
self.label.setMaximumSize(QtCore.QSize(80, 80))
self.label.setText("")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.listWidget = QtWidgets.QListWidget(Dialog)
self.listWidget.setMinimumSize(QtCore.QSize(100, 80))
self.listWidget.setMaximumSize(QtCore.QSize(500, 80))
self.listWidget.setFrameShape(QtWidgets.QFrame.NoFrame)
self.listWidget.setFrameShadow(QtWidgets.QFrame.Plain)
self.listWidget.setLineWidth(0)
self.listWidget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setFlow(QtWidgets.QListView.LeftToRight)
self.listWidget.setObjectName("listWidget")
item = QtWidgets.QListWidgetItem()
self.listWidget.addItem(item)
item = QtWidgets.QListWidgetItem()
self.listWidget.addItem(item)
item = QtWidgets.QListWidgetItem()
self.listWidget.addItem(item)
item = QtWidgets.QListWidgetItem()
self.listWidget.addItem(item)
item = QtWidgets.QListWidgetItem()
self.listWidget.addItem(item)
self.horizontalLayout.addWidget(self.listWidget)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setMaximumSize(QtCore.QSize(80, 80))
self.label_2.setText("")
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.stackedWidget = QtWidgets.QStackedWidget(Dialog)
self.stackedWidget.setFrameShape(QtWidgets.QFrame.NoFrame)
self.stackedWidget.setFrameShadow(QtWidgets.QFrame.Raised)
self.stackedWidget.setObjectName("stackedWidget")
self.verticalLayout.addWidget(self.stackedWidget)
self.verticalLayout.setStretch(1, 1)
self.retranslateUi(Dialog)
self.stackedWidget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
__sortingEnabled = self.listWidget.isSortingEnabled()
self.listWidget.setSortingEnabled(False)
item = self.listWidget.item(0)
item.setText(_translate("Dialog", "新建项目"))
item = self.listWidget.item(1)
item.setText(_translate("Dialog", "新建项目"))
item = self.listWidget.item(2)
item.setText(_translate("Dialog", "新建项目"))
item = self.listWidget.item(3)
item.setText(_translate("Dialog", "新建项目"))
item = self.listWidget.item(4)
item.setText(_translate("Dialog", "新建项目"))
self.listWidget.setSortingEnabled(__sortingEnabled)

111
app/ui/tool/tool_window.py Normal file
View File

@@ -0,0 +1,111 @@
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QWidget, QListWidgetItem, QLabel
from app.ui.Icon import Icon
from .pc_decrypt import DecryptControl
from .setting.setting import SettingControl
from .get_bias_addr.get_bias_addr import GetBiasAddrControl
from .toolUI import Ui_Dialog
# 美化样式表
Stylesheet = """
QPushButton{
background-color: rgb(250,252,253);
border-radius: 5px;
padding: 8px;
border-right: 2px solid #888888; /* 按钮边框2px宽白色 */
border-bottom: 2px solid #888888; /* 按钮边框2px宽白色 */
border-left: 1px solid #ffffff; /* 按钮边框2px宽白色 */
border-top: 1px solid #ffffff; /* 按钮边框2px宽白色 */
}
QPushButton:hover {
background-color: lightgray;
}
/*去掉item虚线边框*/
QListWidget, QListView, QTreeWidget, QTreeView {
outline: 0px;
border:none;
}
/*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/
QListWidget {
min-width: 400px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
color: black;
border:none;
}
QListWidget::item{
min-width: 80px;
max-width: 400px;
min-height: 80px;
max-height: 80px;
}
/*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected {
border-left:none;
color: black;
font-weight: bold;
}
"""
class ToolWindow(QWidget, Ui_Dialog):
get_info_signal = pyqtSignal(str)
decrypt_success_signal = pyqtSignal(bool)
load_finish_signal = pyqtSignal(bool)
def __init__(self, parent=None):
super().__init__(parent)
self.setupUi(self)
self.setStyleSheet(Stylesheet)
self.init_ui()
self.load_finish_signal.emit(True)
def init_ui(self):
self.listWidget.clear()
self.listWidget.currentRowChanged.connect(self.setCurrentIndex)
chat_item = QListWidgetItem(Icon.Decrypt_Icon, '解密', self.listWidget)
contact_item = QListWidgetItem(Icon.Contact_Icon, '设置', self.listWidget)
myinfo_item = QListWidgetItem(Icon.Home_Icon, '解密2', self.listWidget)
tool_item = QListWidgetItem(Icon.Home_Icon, '别点', self.listWidget)
self.decrypt_window = DecryptControl()
self.decrypt_window.get_wxidSignal.connect(self.get_info_signal)
self.decrypt_window.DecryptSignal.connect(self.decrypt_success_signal)
self.decrypt_window.versionErrorSignal.connect(self.show_decrypt2)
self.stackedWidget.addWidget(self.decrypt_window)
setting_window = SettingControl()
self.stackedWidget.addWidget(setting_window)
self.get_bias_addr_window = GetBiasAddrControl()
self.get_bias_addr_window.biasAddrSignal.connect(self.decrypt)
self.stackedWidget.addWidget(self.get_bias_addr_window)
label = QLabel('都说了不让你点', self)
label.setFont(QFont("微软雅黑", 50))
label.setAlignment(Qt.AlignCenter)
# 设置label的背景颜色(这里随机)
# 这里加了一个margin边距(方便区分QStackedWidget和QLabel的颜色)
# label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
# randint(0, 255), randint(0, 255), randint(0, 255)))
self.stackedWidget.addWidget(label)
self.listWidget.setCurrentRow(0)
self.stackedWidget.setCurrentIndex(0)
def decrypt(self, version_list):
self.listWidget.setCurrentRow(0)
self.stackedWidget.setCurrentIndex(0)
self.decrypt_window.version_list = version_list
self.decrypt_window.get_info()
def show_decrypt2(self, version):
self.listWidget.setCurrentRow(2)
self.stackedWidget.setCurrentIndex(2)
def setCurrentIndex(self, row):
self.stackedWidget.setCurrentIndex(row)