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

40
app/DataBase/__init__.py Normal file
View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
"""
@File : __init__.py.py
@Author : Shuaikang Zhou
@Time : 2023/1/5 0:10
@IDE : Pycharm
@Version : Python3.10
@comment : ···
"""
from .hard_link import HardLink
from .micro_msg import MicroMsg
from .media_msg import MediaMsg
from .misc import Misc
from .msg import Msg
from .msg import MsgType
misc_db = Misc()
msg_db = Msg()
micro_msg_db = MicroMsg()
hard_link_db = HardLink()
media_msg_db = MediaMsg()
def close_db():
misc_db.close()
msg_db.close()
micro_msg_db.close()
hard_link_db.close()
media_msg_db.close()
def init_db():
misc_db.init_database()
msg_db.init_database()
micro_msg_db.init_database()
hard_link_db.init_database()
media_msg_db.init_database()
__all__ = ['misc_db', 'micro_msg_db', 'msg_db', 'hard_link_db', 'MsgType', "media_msg_db", "close_db"]

297
app/DataBase/hard_link.py Normal file
View File

@@ -0,0 +1,297 @@
import binascii
import os.path
import sqlite3
import threading
import traceback
import xml.etree.ElementTree as ET
from app.log import log, logger
from app.util.protocbuf.msg_pb2 import MessageBytesExtra
image_db_lock = threading.Lock()
video_db_lock = threading.Lock()
image_db_path = "./app/Database/Msg/HardLinkImage.db"
video_db_path = "./app/Database/Msg/HardLinkVideo.db"
root_path = "FileStorage/MsgAttach/"
video_root_path = "FileStorage/Video/"
@log
def get_md5_from_xml(content, type_="img"):
try:
# 解析XML
root = ET.fromstring(content)
if type_ == "img":
# 提取md5的值
md5_value = root.find(".//img").get("md5")
elif type_ == "video":
md5_value = root.find(".//videomsg").get("md5")
# print(md5_value)
return md5_value
except ET.ParseError:
return None
def decodeExtraBuf(extra_buf_content: bytes):
if not extra_buf_content:
return {
"region": ('', '', ''),
"signature": '',
"telephone": '',
"gender": 0,
}
trunkName = {
b"\x46\xCF\x10\xC4": "个性签名",
b"\xA4\xD9\x02\x4A": "国家",
b"\xE2\xEA\xA8\xD1": "省份",
b"\x1D\x02\x5B\xBF": "",
# b"\x81\xAE\x19\xB4": "朋友圈背景url",
# b"\xF9\x17\xBC\xC0": "公司名称",
# b"\x4E\xB9\x6D\x85": "企业微信属性",
# b"\x0E\x71\x9F\x13": "备注图片",
b"\x75\x93\x78\xAD": "手机号",
b"\x74\x75\x2C\x06": "性别",
}
res = {"手机号": ""}
off = 0
try:
for key in trunkName:
trunk_head = trunkName[key]
try:
off = extra_buf_content.index(key) + 4
except:
pass
char = extra_buf_content[off: off + 1]
off += 1
if char == b"\x04": # 四个字节的int小端序
intContent = extra_buf_content[off: off + 4]
off += 4
intContent = int.from_bytes(intContent, "little")
res[trunk_head] = intContent
elif char == b"\x18": # utf-16字符串
lengthContent = extra_buf_content[off: off + 4]
off += 4
lengthContent = int.from_bytes(lengthContent, "little")
strContent = extra_buf_content[off: off + lengthContent]
off += lengthContent
res[trunk_head] = strContent.decode("utf-16").rstrip("\x00")
return {
"region": (res["国家"], res["省份"], res[""]),
"signature": res["个性签名"],
"telephone": res["手机号"],
"gender": res["性别"],
}
except:
logger.error(f'联系人解析错误:\n{traceback.format_exc()}')
return {
"region": ('', '', ''),
"signature": '',
"telephone": '',
"gender": 0,
}
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
@singleton
class HardLink:
def __init__(self):
self.imageDB = None
self.videoDB = None
self.image_cursor = None
self.video_cursor = None
self.open_flag = False
self.init_database()
def init_database(self):
if not self.open_flag:
if os.path.exists(image_db_path):
self.imageDB = sqlite3.connect(image_db_path, check_same_thread=False)
# '''创建游标'''
self.image_cursor = self.imageDB.cursor()
self.open_flag = True
if image_db_lock.locked():
image_db_lock.release()
if os.path.exists(video_db_path):
self.videoDB = sqlite3.connect(video_db_path, check_same_thread=False)
# '''创建游标'''
self.video_cursor = self.videoDB.cursor()
self.open_flag = True
if video_db_lock.locked():
video_db_lock.release()
def get_image_by_md5(self, md5: bytes):
if not md5:
return None
if not self.open_flag:
return None
sql = """
select Md5Hash,MD5,FileName,HardLinkImageID.Dir as DirName1,HardLinkImageID2.Dir as DirName2
from HardLinkImageAttribute
join HardLinkImageID on HardLinkImageAttribute.DirID1 = HardLinkImageID.DirID
join HardLinkImageID as HardLinkImageID2 on HardLinkImageAttribute.DirID2 = HardLinkImageID2.DirID
where MD5 = ?;
"""
try:
image_db_lock.acquire(True)
try:
self.image_cursor.execute(sql, [md5])
except AttributeError:
self.init_database()
self.image_cursor.execute(sql, [md5])
result = self.image_cursor.fetchone()
return result
finally:
image_db_lock.release()
def get_video_by_md5(self, md5: bytes):
if not md5:
return None
if not self.open_flag:
return None
sql = """
select Md5Hash,MD5,FileName,HardLinkVideoID2.Dir as DirName2
from HardLinkVideoAttribute
join HardLinkVideoID as HardLinkVideoID2 on HardLinkVideoAttribute.DirID2 = HardLinkVideoID2.DirID
where MD5 = ?;
"""
try:
video_db_lock.acquire(True)
try:
self.video_cursor.execute(sql, [md5])
except sqlite3.OperationalError:
return None
except AttributeError:
self.init_database()
self.video_cursor.execute(sql, [md5])
result = self.video_cursor.fetchone()
return result
finally:
video_db_lock.release()
def get_image_original(self, content, bytesExtra) -> str:
msg_bytes = MessageBytesExtra()
msg_bytes.ParseFromString(bytesExtra)
result = ''
for tmp in msg_bytes.message2:
if tmp.field1 != 4:
continue
pathh = tmp.field2 # wxid\FileStorage\...
pathh = "\\".join(pathh.split("\\")[1:])
return pathh
md5 = get_md5_from_xml(content)
if not md5:
pass
else:
result = self.get_image_by_md5(binascii.unhexlify(md5))
if result:
dir1 = result[3]
dir2 = result[4]
data_image = result[2]
dir0 = "Image"
dat_image = os.path.join(root_path, dir1, dir0, dir2, data_image)
result = dat_image
return result
def get_image_thumb(self, content, bytesExtra) -> str:
msg_bytes = MessageBytesExtra()
msg_bytes.ParseFromString(bytesExtra)
result = ''
for tmp in msg_bytes.message2:
if tmp.field1 != 3:
continue
pathh = tmp.field2 # wxid\FileStorage\...
pathh = "\\".join(pathh.split("\\")[1:])
return pathh
md5 = get_md5_from_xml(content)
if not md5:
pass
else:
result = self.get_image_by_md5(binascii.unhexlify(md5))
if result:
dir1 = result[3]
dir2 = result[4]
data_image = result[2]
dir0 = "Thumb"
dat_image = os.path.join(root_path, dir1, dir0, dir2, data_image)
result = dat_image
return result
def get_image(self, content, bytesExtra, up_dir="", thumb=False) -> str:
msg_bytes = MessageBytesExtra()
msg_bytes.ParseFromString(bytesExtra)
if thumb:
result = self.get_image_thumb(content, bytesExtra)
else:
result = self.get_image_original(content, bytesExtra)
if not (result and os.path.exists(os.path.join(up_dir, result))):
result = self.get_image_thumb(content, bytesExtra)
return result
def get_video(self, content, bytesExtra, thumb=False):
msg_bytes = MessageBytesExtra()
msg_bytes.ParseFromString(bytesExtra)
for tmp in msg_bytes.message2:
if tmp.field1 != (3 if thumb else 4):
continue
pathh = tmp.field2 # wxid\FileStorage\...
pathh = "\\".join(pathh.split("\\")[1:])
return pathh
md5 = get_md5_from_xml(content, type_="video")
if not md5:
return ''
result = self.get_video_by_md5(binascii.unhexlify(md5))
if result:
dir2 = result[3]
data_image = result[2].split(".")[0] + ".jpg" if thumb else result[2]
# dir0 = 'Thumb' if thumb else 'Image'
dat_image = os.path.join(video_root_path, dir2, data_image)
return dat_image
else:
return ''
def close(self):
if self.open_flag:
try:
image_db_lock.acquire(True)
video_db_lock.acquire(True)
self.open_flag = False
self.imageDB.close()
self.videoDB.close()
finally:
image_db_lock.release()
video_db_lock.release()
def __del__(self):
self.close()
# 6b02292eecea118f06be3a5b20075afc_t
if __name__ == "__main__":
msg_root_path = "./Msg/"
image_db_path = "./Msg/HardLinkImage.db"
video_db_path = "./Msg/HardLinkVideo.db"
hard_link_db = HardLink()
hard_link_db.init_database()
# content = '''<?xml version="1.0"?><msg>\n\t<img aeskey="bc37a58c32cb203ee9ac587b068e5853" encryver="1" cdnthumbaeskey="bc37a58c32cb203ee9ac587b068e5853" cdnthumburl="3057020100044b30490201000204d181705002032f5405020428a7b4de02046537869d042462313532363539632d663930622d343463302d616636662d333837646434633061626534020401150a020201000405004c4c6d00" cdnthumblength="3097" cdnthumbheight="120" cdnthumbwidth="68" cdnmidheight="0" cdnmidwidth="0" cdnhdheight="0" cdnhdwidth="0" cdnmidimgurl="3057020100044b30490201000204d181705002032f5405020428a7b4de02046537869d042462313532363539632d663930622d343463302d616636662d333837646434633061626534020401150a020201000405004c4c6d00" length="57667" md5="6844b812d5d514eb6878657e0bf4cdbb" originsourcemd5="1dfdfa24922270ea1cb5daba103f45ca" />\n\t<platform_signature></platform_signature>\n\t<imgdatahash></imgdatahash>\n</msg>\n'''
# print(hard_link_db.get_image(content))
# print(hard_link_db.get_image(content, thumb=False))
# result = get_md5_from_xml(content)
# print(result)
content = """<?xml version="1.0"?>
<msg>
<videomsg aeskey="d635d2013d221dbd05a4eab3a8185f5a" cdnvideourl="3057020100044b304902010002040297cead02032f540502042ba7b4de020465673b74042438316562356530652d653764352d343263632d613531642d6464383661313330623965330204052400040201000405004c537500" cdnthumbaeskey="d635d2013d221dbd05a4eab3a8185f5a" cdnthumburl="3057020100044b304902010002040297cead02032f540502042ba7b4de020465673b74042438316562356530652d653764352d343263632d613531642d6464383661313330623965330204052400040201000405004c537500" length="25164270" playlength="60" cdnthumblength="7419" cdnthumbwidth="1920" cdnthumbheight="1080" fromusername="wxid_yt67eeoo4blm22" md5="95558f0e503651375b475636519d2285" newmd5="4ece19bcd92dc5b93b83f397461a1310" isplaceholder="0" rawmd5="d660ba186bb31126d94fa568144face8" rawlength="143850007" cdnrawvideourl="3052020100044b30490201000204d8cd585302032f540502040f6a42b7020465673b85042464666462306634342d653339342d343232302d613534392d3930633030646236306266610204059400040201000400" cdnrawvideoaeskey="5915b14ac8d121e0944d9e444aebb7ed" overwritenewmsgid="0" originsourcemd5="a1a567d8c170bca33d075b787a60dd3f" isad="0" />
</msg>
"""
print(hard_link_db.get_video(content))
print(hard_link_db.get_video(content, thumb=True))

145
app/DataBase/media_msg.py Normal file
View File

@@ -0,0 +1,145 @@
import os.path
import subprocess
import sys
import traceback
from os import system
import sqlite3
import threading
import xml.etree.ElementTree as ET
from pilk import decode
from app.log import logger
lock = threading.Lock()
db_path = "./app/Database/Msg/MediaMSG.db"
def get_ffmpeg_path():
# 获取打包后的资源目录
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
# 构建 FFmpeg 可执行文件的路径
ffmpeg_path = os.path.join(resource_dir, 'app', 'resources','data', 'ffmpeg.exe')
return ffmpeg_path
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
@singleton
class MediaMsg:
def __init__(self):
self.DB = None
self.cursor: sqlite3.Cursor = None
self.open_flag = False
self.init_database()
def init_database(self):
if not self.open_flag:
if os.path.exists(db_path):
self.DB = sqlite3.connect(db_path, check_same_thread=False)
# '''创建游标'''
self.cursor = self.DB.cursor()
self.open_flag = True
if lock.locked():
lock.release()
def get_media_buffer(self, reserved0):
sql = '''
select Buf
from Media
where Reserved0 = ?
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [reserved0])
result = self.cursor.fetchone()
finally:
lock.release()
return result[0] if result else None
def get_audio(self, reserved0, output_path):
buf = self.get_media_buffer(reserved0)
if not buf:
return ''
silk_path = f"{output_path}/{reserved0}.silk"
pcm_path = f"{output_path}/{reserved0}.pcm"
mp3_path = f"{output_path}/{reserved0}.mp3"
if os.path.exists(mp3_path):
return mp3_path
with open(silk_path, "wb") as f:
f.write(buf)
# open(silk_path, "wb").write()
try:
decode(silk_path, pcm_path, 44100)
# 调用系统上的 ffmpeg 可执行文件
# 获取 FFmpeg 可执行文件的路径
ffmpeg_path = get_ffmpeg_path()
# # 调用 FFmpeg
if os.path.exists(ffmpeg_path):
cmd = f'''"{ffmpeg_path}" -loglevel quiet -y -f s16le -i "{pcm_path}" -ar 44100 -ac 1 "{mp3_path}"'''
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
# 源码运行的时候下面的有效
# 这里不知道怎么捕捉异常
cmd = f'''"{os.path.join(os.getcwd(), 'app', 'resources', 'data','ffmpeg.exe')}" -loglevel quiet -y -f s16le -i "{pcm_path}" -ar 44100 -ac 1 "{mp3_path}"'''
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
os.remove(silk_path)
os.remove(pcm_path)
except Exception as e:
print(f"Error: {e}")
logger.error(f'语音发送错误\n{traceback.format_exc()}')
cmd = f'''"{os.path.join(os.getcwd(), 'app', 'resources', 'data', 'ffmpeg.exe')}" -loglevel quiet -y -f s16le -i "{pcm_path}" -ar 44100 -ac 1 "{mp3_path}"'''
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
finally:
print(mp3_path)
return mp3_path
def get_audio_path(self, reserved0, output_path):
mp3_path = f"{output_path}\\{reserved0}.mp3"
mp3_path = mp3_path.replace("/", "\\")
return mp3_path
def get_audio_text(self, content):
try:
root = ET.fromstring(content)
transtext = root.find(".//voicetrans").get("transtext")
return transtext
except:
return ""
def close(self):
if self.open_flag:
try:
lock.acquire(True)
self.open_flag = False
self.DB.close()
finally:
lock.release()
def __del__(self):
self.close()
if __name__ == '__main__':
db_path = './Msg/MediaMSG.db'
media_msg_db = MediaMsg()
reserved = '2865682741418252473'
path = media_msg_db.get_audio(reserved, r"D:\gou\message\WeChatMsg")
print(path)

103
app/DataBase/merge.py Normal file
View File

@@ -0,0 +1,103 @@
import os
import sqlite3
import traceback
from app.log import logger
def merge_MediaMSG_databases(source_paths, target_path):
# 创建目标数据库连接
target_conn = sqlite3.connect(target_path)
target_cursor = target_conn.cursor()
try:
# 开始事务
target_conn.execute("BEGIN;")
for i, source_path in enumerate(source_paths):
if not os.path.exists(source_path):
continue
db = sqlite3.connect(source_path)
db.text_factory = str
cursor = db.cursor()
# 附加源数据库
try:
sql = '''SELECT Key,Reserved0,Buf,Reserved1,Reserved2 FROM Media;'''
cursor.execute(sql)
result = cursor.fetchall()
target_cursor.executemany(
"INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)"
"VALUES(?,?,?,?,?)",
result)
except sqlite3.IntegrityError:
print("有重复key", "跳过")
except sqlite3.OperationalError:
print("no such table: Media", "跳过")
cursor.close()
db.close()
# 提交事务
target_conn.execute("COMMIT;")
except Exception as e:
# 发生异常时回滚事务
target_conn.execute("ROLLBACK;")
raise e
finally:
# 关闭目标数据库连接
target_conn.close()
def merge_databases(source_paths, target_path):
# 创建目标数据库连接
target_conn = sqlite3.connect(target_path)
target_cursor = target_conn.cursor()
try:
# 开始事务
target_conn.execute("BEGIN;")
for i, source_path in enumerate(source_paths):
if not os.path.exists(source_path):
continue
db = sqlite3.connect(source_path)
db.text_factory = str
cursor = db.cursor()
try:
sql = '''
SELECT TalkerId,MsgsvrID,Type,SubType,IsSender,CreateTime,Sequence,StrTalker,StrContent,DisplayContent,BytesExtra,CompressContent
FROM MSG;
'''
cursor.execute(sql)
result = cursor.fetchall()
# 附加源数据库
target_cursor.executemany(
"INSERT INTO MSG "
"(TalkerId,MsgsvrID,Type,SubType,IsSender,CreateTime,Sequence,StrTalker,StrContent,DisplayContent,"
"BytesExtra,CompressContent)"
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?)",
result)
except:
logger.error(f'{source_path}数据库合并错误:\n{traceback.format_exc()}')
cursor.close()
db.close()
# 提交事务
target_conn.execute("COMMIT;")
except Exception as e:
# 发生异常时回滚事务
target_conn.execute("ROLLBACK;")
raise e
finally:
# 关闭目标数据库连接
target_conn.close()
if __name__ == "__main__":
# 源数据库文件列表
source_databases = ["Msg/MSG1.db", "Msg/MSG2.db", "Msg/MSG3.db"]
# 目标数据库文件
target_database = "Msg/MSG.db"
import shutil
shutil.copy('Msg/MSG0.db', target_database) # 使用一个数据库文件作为模板
# 合并数据库
merge_databases(source_databases, target_database)

152
app/DataBase/micro_msg.py Normal file
View File

@@ -0,0 +1,152 @@
import os.path
import sqlite3
import threading
lock = threading.Lock()
db_path = "./app/Database/Msg/MicroMsg.db"
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
def is_database_exist():
return os.path.exists(db_path)
class MicroMsg:
def __init__(self):
self.DB = None
self.cursor = None
self.open_flag = False
self.init_database()
def init_database(self):
if not self.open_flag:
if os.path.exists(db_path):
self.DB = sqlite3.connect(db_path, check_same_thread=False)
# '''创建游标'''
self.cursor = self.DB.cursor()
self.open_flag = True
if lock.locked():
lock.release()
def get_contact(self):
if not self.open_flag:
return []
try:
lock.acquire(True)
sql = '''SELECT UserName, Alias, Type, Remark, NickName, PYInitial, RemarkPYInitial, ContactHeadImgUrl.smallHeadImgUrl, ContactHeadImgUrl.bigHeadImgUrl,ExTraBuf,COALESCE(ContactLabel.LabelName, 'None') AS labelName
FROM Contact
INNER JOIN ContactHeadImgUrl ON Contact.UserName = ContactHeadImgUrl.usrName
LEFT JOIN ContactLabel ON Contact.LabelIDList = ContactLabel.LabelId
WHERE (Type!=4 AND VerifyFlag=0)
AND NickName != ''
ORDER BY
CASE
WHEN RemarkPYInitial = '' THEN PYInitial
ELSE RemarkPYInitial
END ASC
'''
self.cursor.execute(sql)
result = self.cursor.fetchall()
except sqlite3.OperationalError:
# lock.acquire(True)
sql = '''
SELECT UserName, Alias, Type, Remark, NickName, PYInitial, RemarkPYInitial, ContactHeadImgUrl.smallHeadImgUrl, ContactHeadImgUrl.bigHeadImgUrl,ExTraBuf,"None"
FROM Contact
INNER JOIN ContactHeadImgUrl ON Contact.UserName = ContactHeadImgUrl.usrName
WHERE (Type!=4 AND VerifyFlag=0)
AND NickName != ''
ORDER BY
CASE
WHEN RemarkPYInitial = '' THEN PYInitial
ELSE RemarkPYInitial
END ASC
'''
self.cursor.execute(sql)
result = self.cursor.fetchall()
finally:
lock.release()
from app.DataBase import msg_db
return msg_db.get_contact(result)
def get_contact_by_username(self, username):
if not self.open_flag:
return None
try:
lock.acquire(True)
sql = '''
SELECT UserName, Alias, Type, Remark, NickName, PYInitial, RemarkPYInitial, ContactHeadImgUrl.smallHeadImgUrl, ContactHeadImgUrl.bigHeadImgUrl,ExTraBuf,ContactLabel.LabelName
FROM Contact
INNER JOIN ContactHeadImgUrl ON Contact.UserName = ContactHeadImgUrl.usrName
LEFT JOIN ContactLabel ON Contact.LabelIDList = ContactLabel.LabelId
WHERE UserName = ?
'''
self.cursor.execute(sql, [username])
result = self.cursor.fetchone()
except sqlite3.OperationalError:
# 解决ContactLabel表不存在的问题
# lock.acquire(True)
sql = '''
SELECT UserName, Alias, Type, Remark, NickName, PYInitial, RemarkPYInitial, ContactHeadImgUrl.smallHeadImgUrl, ContactHeadImgUrl.bigHeadImgUrl,ExTraBuf,"None"
FROM Contact
INNER JOIN ContactHeadImgUrl ON Contact.UserName = ContactHeadImgUrl.usrName
WHERE UserName = ?
'''
self.cursor.execute(sql, [username])
result = self.cursor.fetchone()
finally:
lock.release()
return result
def get_chatroom_info(self, chatroomname):
'''
获取群聊信息
'''
if not self.open_flag:
return None
try:
lock.acquire(True)
sql = '''SELECT ChatRoomName, RoomData FROM ChatRoom WHERE ChatRoomName = ?'''
self.cursor.execute(sql, [chatroomname])
result = self.cursor.fetchone()
finally:
lock.release()
return result
def close(self):
if self.open_flag:
try:
lock.acquire(True)
self.open_flag = False
self.DB.close()
finally:
lock.release()
def __del__(self):
self.close()
if __name__ == '__main__':
db_path = "./app/database/Msg/MicroMsg.db"
msg = MicroMsg()
msg.init_database()
contacts = msg.get_contact()
from app.DataBase.hard_link import decodeExtraBuf
s = {'wxid_vtz9jk9ulzjt22','wxid_zu9l4wxdv1pa22', 'wxid_0o18ef858vnu22','wxid_8piw6sb4hvfm22','wxid_e7ypfycxpnu322','wxid_oxmg02c8kwxu22','wxid_7pp2fblq7hkq22','wxid_h1n9niofgyci22'}
for contact in contacts:
if contact[0] in s:
print(contact[:7])
buf = contact[9]
info = decodeExtraBuf(buf)
print(info)

78
app/DataBase/misc.py Normal file
View File

@@ -0,0 +1,78 @@
import os.path
import sqlite3
import threading
lock = threading.Lock()
DB = None
cursor = None
db_path = "./app/Database/Msg/Misc.db"
# db_path = './Msg/Misc.db'
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
@singleton
class Misc:
def __init__(self):
self.DB = None
self.cursor = None
self.open_flag = False
self.init_database()
def init_database(self):
if not self.open_flag:
if os.path.exists(db_path):
self.DB = sqlite3.connect(db_path, check_same_thread=False)
# '''创建游标'''
self.cursor = self.DB.cursor()
self.open_flag = True
if lock.locked():
lock.release()
def get_avatar_buffer(self, userName):
if not self.open_flag:
return None
sql = '''
select smallHeadBuf
from ContactHeadImg1
where usrName=?;
'''
if not self.open_flag:
self.init_database()
try:
lock.acquire(True)
self.cursor.execute(sql, [userName])
result = self.cursor.fetchall()
if result:
return result[0][0]
finally:
lock.release()
return None
def close(self):
if self.open_flag:
try:
lock.acquire(True)
self.open_flag = False
self.DB.close()
finally:
lock.release()
def __del__(self):
self.close()
if __name__ == '__main__':
Misc()
print(Misc().get_avatar_buffer('wxid_al2oan01b6fn11'))

894
app/DataBase/msg.py Normal file
View File

@@ -0,0 +1,894 @@
import os.path
import random
import sqlite3
import threading
import traceback
from collections import defaultdict
from datetime import datetime, date
from typing import Tuple
from app.log import logger
from app.util.compress_content import parser_reply
from app.util.protocbuf.msg_pb2 import MessageBytesExtra
db_path = "./app/Database/Msg/MSG.db"
lock = threading.Lock()
def is_database_exist():
return os.path.exists(db_path)
def convert_to_timestamp_(time_input) -> int:
if isinstance(time_input, (int, float)):
# 如果输入是时间戳,直接返回
return int(time_input)
elif isinstance(time_input, str):
# 如果输入是格式化的时间字符串,将其转换为时间戳
try:
dt_object = datetime.strptime(time_input, '%Y-%m-%d %H:%M:%S')
return int(dt_object.timestamp())
except ValueError:
# 如果转换失败,可能是其他格式的字符串,可以根据需要添加更多的处理逻辑
print("Error: Unsupported date format")
return -1
elif isinstance(time_input, date):
# 如果输入是datetime.date对象将其转换为时间戳
dt_object = datetime.combine(time_input, datetime.min.time())
return int(dt_object.timestamp())
else:
print("Error: Unsupported input type")
return -1
def convert_to_timestamp(time_range) -> Tuple[int, int]:
"""
将时间转换成时间戳
@param time_range:
@return:
"""
if not time_range:
return 0, 0
else:
return convert_to_timestamp_(time_range[0]), convert_to_timestamp_(time_range[1])
def parser_chatroom_message(messages):
from app.DataBase import micro_msg_db, misc_db
from app.util.protocbuf.msg_pb2 import MessageBytesExtra
from app.person import Contact, Me, ContactDefault
'''
获取一个群聊的聊天记录
return list
a[0]: localId,
a[1]: talkerId, 和strtalker对应的不是群聊信息发送人
a[2]: type,
a[3]: subType,
a[4]: is_sender,
a[5]: timestamp,
a[6]: status, (没啥用)
a[7]: str_content,
a[8]: str_time, (格式化的时间)
a[9]: msgSvrId,
a[10]: BytesExtra,
a[11]: CompressContent,
a[12]: DisplayContent,
a[13]: msg_sender, ContactPC 或 ContactDefault 类型,这个才是群聊里的信息发送人,不是群聊或者自己是发送者没有这个字段)
'''
updated_messages = [] # 用于存储修改后的消息列表
for row in messages:
message = list(row)
if message[4] == 1: # 自己发送的就没必要解析了
message.append(Me())
updated_messages.append(tuple(message))
continue
if message[10] is None: # BytesExtra是空的跳过
message.append(ContactDefault(wxid))
updated_messages.append(tuple(message))
continue
msgbytes = MessageBytesExtra()
msgbytes.ParseFromString(message[10])
wxid = ''
for tmp in msgbytes.message2:
if tmp.field1 != 1:
continue
wxid = tmp.field2
if wxid == "": # 系统消息里面 wxid 不存在
message.append(ContactDefault(wxid))
updated_messages.append(tuple(message))
continue
# todo 解析还是有问题,会出现这种带:的东西
if ':' in wxid: # wxid_ewi8gfgpp0eu22:25319:1
wxid = wxid.split(':')[0]
contact_info_list = micro_msg_db.get_contact_by_username(wxid)
if contact_info_list is None: # 群聊中已退群的联系人不会保存在数据库里
message.append(ContactDefault(wxid))
updated_messages.append(tuple(message))
continue
contact_info = {
'UserName': contact_info_list[0],
'Alias': contact_info_list[1],
'Type': contact_info_list[2],
'Remark': contact_info_list[3],
'NickName': contact_info_list[4],
'smallHeadImgUrl': contact_info_list[7]
}
contact = Contact(contact_info)
contact.smallHeadImgBLOG = misc_db.get_avatar_buffer(contact.wxid)
contact.set_avatar(contact.smallHeadImgBLOG)
message.append(contact)
updated_messages.append(tuple(message))
return updated_messages
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
class MsgType:
TEXT = 1
IMAGE = 3
EMOJI = 47
class Msg:
def __init__(self):
self.DB = None
self.cursor = None
self.open_flag = False
self.init_database()
def init_database(self, path=None):
global db_path
if not self.open_flag:
if path:
db_path = path
if os.path.exists(db_path):
self.DB = sqlite3.connect(db_path, check_same_thread=False)
# '''创建游标'''
self.cursor = self.DB.cursor()
self.open_flag = True
if lock.locked():
lock.release()
def add_sender(self, messages):
"""
@param messages:
@return:
"""
new_messages = []
for message in messages:
is_sender = message[4]
wxid = ''
if is_sender:
pass
else:
msgbytes = MessageBytesExtra()
msgbytes.ParseFromString(message[10])
for tmp in msgbytes.message2:
if tmp.field1 != 1:
continue
wxid = tmp.field2
new_message = (*message, wxid)
new_messages.append(new_message)
return new_messages
def get_messages(
self,
username_,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
):
"""
return list
a[0]: localId,
a[1]: talkerId, 和strtalker对应的不是群聊信息发送人
a[2]: type,
a[3]: subType,
a[4]: is_sender,
a[5]: timestamp,
a[6]: status, (没啥用)
a[7]: str_content,
a[8]: str_time, (格式化的时间)
a[9]: msgSvrId,
a[10]: BytesExtra,
a[11]: CompressContent,
a[12]: DisplayContent,
a[13]: 联系人的类(如果是群聊就有,不是的话没有这个字段)
"""
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent
from MSG
where StrTalker=?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
order by CreateTime
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchall()
finally:
lock.release()
return parser_chatroom_message(result) if username_.__contains__('@chatroom') else result
# result.sort(key=lambda x: x[5])
# return self.add_sender(result)
def get_messages_all(self, time_range=None):
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,StrTalker,Reserved1,CompressContent
from MSG
{'WHERE CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
order by CreateTime
'''
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchall()
finally:
lock.release()
result.sort(key=lambda x: x[5])
return result
def get_messages_group_by_day(
self,
username_: str,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> dict:
"""
return dict {
date: messages
}
"""
if not self.open_flag:
return {}
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent
from MSG
where StrTalker=? AND type=1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
order by CreateTime;
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchall()
finally:
lock.release()
result = parser_chatroom_message(result) if username_.__contains__('@chatroom') else result
# 按天分组存储聊天记录
grouped_results = defaultdict(list)
for row in result:
'2024-01-01'
date = row[8][:10] # 获取日期部分
grouped_results[date].append(row) # 将消息加入对应的日期列表中
return grouped_results
def get_messages_length(self):
sql = '''
select count(*)
group by MsgSvrID
from MSG
'''
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchone()
except Exception as e:
result = None
finally:
lock.release()
return result[0]
def get_message_by_num(self, username_, local_id):
sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent
from MSG
where StrTalker = ? and localId < ? and (Type=1 or Type=3)
order by CreateTime desc
limit 20
'''
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql, [username_, local_id])
result = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
# result.sort(key=lambda x: x[5])
return parser_chatroom_message(result) if username_.__contains__('@chatroom') else result
def get_messages_by_type(
self,
username_,
type_,
year_='all',
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
):
"""
@param username_:
@param type_:
@param year_:
@param time_range: Tuple(timestamp:开始时间戳,timestamp:结束时间戳)
@return:
"""
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
if year_ == 'all':
sql = f'''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent
from MSG
where StrTalker=? and Type=?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
order by CreateTime
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_, type_])
result = self.cursor.fetchall()
finally:
lock.release()
else:
sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent
from MSG
where StrTalker=? and Type=? and strftime('%Y', CreateTime, 'unixepoch', 'localtime') = ?
order by CreateTime
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_, type_, year_])
finally:
lock.release()
result = self.cursor.fetchall()
return result
def get_messages_by_keyword(self, username_, keyword, num=5, max_len=10, time_range=None, year_='all'):
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra
from MSG
where StrTalker=? and Type=1 and LENGTH(StrContent)<? and StrContent like ?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
order by CreateTime desc
'''
temp = []
try:
lock.acquire(True)
self.cursor.execute(sql, [username_, max_len, f'%{keyword}%'] if year_ == "all" else [username_, max_len,
f'%{keyword}%',
year_])
messages = self.cursor.fetchall()
finally:
lock.release()
if len(messages) > 5:
messages = random.sample(messages, num)
try:
lock.acquire(True)
for msg in messages:
local_id = msg[0]
is_send = msg[4]
sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID
from MSG
where localId > ? and StrTalker=? and Type=1 and IsSender=?
limit 1
'''
self.cursor.execute(sql, [local_id, username_, 1 - is_send])
temp.append((msg, self.cursor.fetchone()))
finally:
lock.release()
res = []
for dialog in temp:
msg1 = dialog[0]
msg2 = dialog[1]
try:
res.append((
(msg1[4], msg1[5], msg1[7].split(keyword), msg1[8]),
(msg2[4], msg2[5], msg2[7], msg2[8])
))
except TypeError:
res.append((
('', '', ['', ''], ''),
('', '', '', '')
))
"""
返回值为一个列表,每个列表元素是一个对话
每个对话是一个元组数据
('is_send','时间戳','以关键词为分割符的消息内容','格式化时间')
"""
return res
def get_contact(self, contacts):
if not self.open_flag:
return None
try:
lock.acquire(True)
sql = '''select StrTalker, MAX(CreateTime) from MSG group by StrTalker'''
self.cursor.execute(sql)
res = self.cursor.fetchall()
finally:
lock.release()
res = {StrTalker: CreateTime for StrTalker, CreateTime in res}
contacts = [list(cur_contact) for cur_contact in contacts]
for i, cur_contact in enumerate(contacts):
if cur_contact[0] in res:
contacts[i].append(res[cur_contact[0]])
else:
contacts[i].append(0)
contacts.sort(key=lambda cur_contact: cur_contact[-1], reverse=True)
return contacts
def get_messages_calendar(self, username_):
sql = '''
SELECT strftime('%Y-%m-%d',CreateTime,'unixepoch','localtime') as days
from (
SELECT MsgSvrID, CreateTime
FROM MSG
WHERE StrTalker = ?
ORDER BY CreateTime
)
group by days
'''
if not self.open_flag:
print('数据库未就绪')
return None
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchall()
finally:
lock.release()
return [date[0] for date in result]
def get_messages_by_days(
self,
username_,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
):
result = None
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
SELECT strftime('%Y-%m-%d',CreateTime,'unixepoch','localtime') as days,count(MsgSvrID)
from (
SELECT MsgSvrID, CreateTime
FROM MSG
WHERE StrTalker = ?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
)
group by days
'''
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchall()
finally:
lock.release()
return result
def get_messages_by_month(
self,
username_,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
):
result = None
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
SELECT strftime('%Y-%m',CreateTime,'unixepoch','localtime') as days,count(MsgSvrID)
from (
SELECT MsgSvrID, CreateTime
FROM MSG
WHERE StrTalker = ?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
)
group by days
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result
def get_messages_by_hour(self, username_, time_range=None, year_='all'):
result = []
if not self.open_flag:
return result
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
SELECT strftime('%H:00',CreateTime,'unixepoch','localtime') as hours,count(MsgSvrID)
from (
SELECT MsgSvrID, CreateTime
FROM MSG
where StrTalker = ?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
)
group by hours
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
result = self.cursor.fetchall()
return result
def get_first_time_of_message(self, username_=''):
if not self.open_flag:
return None
sql = f'''
select StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime
from MSG
{'where StrTalker=?' if username_ else ''}
order by CreateTime
limit 1
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_] if username_ else [])
result = self.cursor.fetchone()
finally:
lock.release()
return result
def get_latest_time_of_message(self, username_='', time_range=None, year_='all'):
if not self.open_flag:
return None
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f'''
SELECT isSender,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,
strftime('%H:%M:%S', CreateTime,'unixepoch','localtime') as hour
FROM MSG
WHERE Type=1 AND
{'StrTalker = ? AND ' if username_ else f"'{username_}'=? AND "}
hour BETWEEN '00:00:00' AND '05:00:00'
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
ORDER BY hour DESC
LIMIT 20;
'''
try:
lock.acquire(True)
self.cursor.execute(sql, [username_, year_] if year_ != "all" else [username_])
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
result = self.cursor.fetchall()
if not result:
return []
res = []
is_sender = result[0][0]
res.append(result[0])
for msg in result[1:]:
if msg[0] != is_sender:
res.append(msg)
break
return res
def get_send_messages_type_number(
self,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> list:
"""
统计自己发的各类型消息条数按条数降序精确到subtype\n
return [(type_1, subtype_1, number_1), (type_2, subtype_2, number_2), ...]\n
be like [(1, 0, 71481), (3, 0, 6686), (49, 57, 3887), ..., (10002, 0, 1)]
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f"""
SELECT type, subtype, Count(MsgSvrID)
from MSG
where isSender = 1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
group by type, subtype
order by Count(MsgSvrID) desc
"""
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result
def get_messages_number(
self,
username_,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> int:
"""
统计好友聊天消息的数量
@param username_:
@param time_range:
@return:
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f"""
SELECT Count(MsgSvrID)
from MSG
where StrTalker = ?
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
result = 0
if not self.open_flag:
return 0
try:
lock.acquire(True)
self.cursor.execute(sql, [username_])
result = self.cursor.fetchone()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result[0] if result else 0
def get_chatted_top_contacts(
self,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
contain_chatroom=False,
top_n=10
) -> list:
"""
统计聊天最多的 n 个联系人(默认不包含群组),按条数降序\n
return [(wxid_1, number_1), (wxid_2, number_2), ...]
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f"""
SELECT strtalker, Count(MsgSvrID)
from MSG
where strtalker != "filehelper" and strtalker != "notifymessage" and strtalker not like "gh_%"
{"and strtalker not like '%@chatroom'" if not contain_chatroom else ""}
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
group by strtalker
order by Count(MsgSvrID) desc
limit {top_n}
"""
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result
def get_send_messages_length(
self,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> int:
"""
统计自己总共发消息的字数包含type=1的文本和type=49,subtype=57里面自己发的文本
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql_type_1 = f"""
SELECT sum(length(strContent))
from MSG
where isSender = 1 and type = 1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
sql_type_49 = f"""
SELECT CompressContent
from MSG
where isSender = 1 and type = 49 and subtype = 57
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
sum_type_1 = None
result_type_49 = None
sum_type_49 = 0
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql_type_1)
sum_type_1 = self.cursor.fetchall()[0][0]
self.cursor.execute(sql_type_49)
result_type_49 = self.cursor.fetchall()
for message in result_type_49:
message = message[0]
content = parser_reply(message)
if content["is_error"]:
continue
sum_type_49 += len(content["title"])
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return sum_type_1 + sum_type_49
def get_send_messages_number_sum(
self,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> int:
"""统计自己总共发了多少条消息"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f"""
SELECT count(MsgSvrID)
from MSG
where isSender = 1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchall()[0][0]
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result
def get_send_messages_number_by_hour(
self,
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> list:
"""
统计每个(小时)时段自己总共发了多少消息,从最多到最少排序\n
return be like [('23', 9526), ('00', 7890), ('22', 7600), ..., ('05', 29)]
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql = f"""
SELECT strftime('%H', CreateTime, 'unixepoch', 'localtime') as hour,count(MsgSvrID)
from (
SELECT MsgSvrID, CreateTime
FROM MSG
where isSender = 1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
)
group by hour
order by count(MsgSvrID) desc
"""
result = None
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql)
result = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
return result
def get_message_length(
self,
username_='',
time_range: Tuple[int | float | str | date, int | float | str | date] = None,
) -> int:
"""
统计自己总共发消息的字数包含type=1的文本和type=49,subtype=57里面自己发的文本
"""
if time_range:
start_time, end_time = convert_to_timestamp(time_range)
sql_type_1 = f"""
SELECT sum(length(strContent))
from MSG
where StrTalker = ? and
type = 1
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
sql_type_49 = f"""
SELECT CompressContent
from MSG
where StrTalker = ? and
type = 49 and subtype = 57
{'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''}
"""
sum_type_1 = 0
result_type_1 = 0
result_type_49 = 0
sum_type_49 = 0
if not self.open_flag:
return None
try:
lock.acquire(True)
self.cursor.execute(sql_type_1, [username_])
result_type_1 = self.cursor.fetchall()[0][0]
self.cursor.execute(sql_type_49, [username_])
result_type_49 = self.cursor.fetchall()
except sqlite3.DatabaseError:
logger.error(f'{traceback.format_exc()}\n数据库损坏请删除msg文件夹重试')
finally:
lock.release()
for message in result_type_49:
message = message[0]
content = parser_reply(message)
if content["is_error"]:
continue
sum_type_49 += len(content["title"])
sum_type_1 = result_type_1 if result_type_1 else 0
return sum_type_1 + sum_type_49
def close(self):
if self.open_flag:
try:
lock.acquire(True)
self.open_flag = False
self.DB.close()
finally:
lock.release()
def __del__(self):
self.close()
if __name__ == '__main__':
db_path = "./Msg/MSG.db"
msg = Msg()
msg.init_database()
wxid = 'wxid_0o18ef858vnu22'
wxid = '24521163022@chatroom'
wxid = 'wxid_vtz9jk9ulzjt22' # si
print()
time_range = ('2023-01-01 00:00:00', '2024-01-01 00:00:00')
print(msg.get_messages_calendar(wxid))
print(msg.get_first_time_of_message())
print(msg.get_latest_time_of_message())
top_n = msg.get_chatted_top_contacts(time_range=time_range, top_n=9999999)
print(top_n)
print(len(top_n))

184
app/DataBase/package_msg.py Normal file
View File

@@ -0,0 +1,184 @@
import threading
from app.DataBase import msg_db, micro_msg_db, misc_db
from app.util.protocbuf.msg_pb2 import MessageBytesExtra
from app.util.protocbuf.roomdata_pb2 import ChatRoomData
from app.person import Contact, Me, ContactDefault
lock = threading.Lock()
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
@singleton
class PackageMsg:
def __init__(self):
self.ChatRoomMap = {}
def get_package_message_all(self):
'''
获取完整的聊天记录
'''
updated_messages = [] # 用于存储修改后的消息列表
messages = msg_db.get_messages_all()
for row in messages:
row_list = list(row)
# 删除不使用的几个字段
del row_list[13]
del row_list[12]
del row_list[11]
del row_list[10]
del row_list[9]
strtalker = row[11]
info = micro_msg_db.get_contact_by_username(strtalker)
if info is not None:
row_list.append(info[3])
row_list.append(info[4])
else:
row_list.append('')
row_list.append('')
# 判断是否是群聊
if strtalker.__contains__('@chatroom'):
# 自己发送
if row[4] == 1:
row_list.append('')
else:
# 存在BytesExtra为空的情况此时消息类型应该为提示性消息。跳过不处理
if row[10] is None:
continue
# 解析BytesExtra
msgbytes = MessageBytesExtra()
msgbytes.ParseFromString(row[10])
wxid = ''
for tmp in msgbytes.message2:
if tmp.field1 != 1:
continue
wxid = tmp.field2
sender = ''
# 获取群聊成员列表
membersMap = self.get_chatroom_member_list(strtalker)
if membersMap is not None:
if wxid in membersMap:
sender = membersMap.get(wxid)
else:
senderinfo = micro_msg_db.get_contact_by_username(wxid)
if senderinfo is not None:
sender = senderinfo[4]
membersMap[wxid] = senderinfo[4]
if len(senderinfo[3]) > 0:
sender = senderinfo[3]
membersMap[wxid] = senderinfo[3]
row_list.append(sender)
else:
if row[4] == 1:
row_list.append('')
else:
if info is not None:
row_list.append(info[4])
else:
row_list.append('')
updated_messages.append(tuple(row_list))
return updated_messages
def get_package_message_by_wxid(self, chatroom_wxid):
'''
获取一个群聊的聊天记录
return list
a[0]: localId,
a[1]: talkerId, 和strtalker对应的不是群聊信息发送人
a[2]: type,
a[3]: subType,
a[4]: is_sender,
a[5]: timestamp,
a[6]: status, (没啥用)
a[7]: str_content,
a[8]: str_time, (格式化的时间)
a[9]: msgSvrId,
a[10]: BytesExtra,
a[11]: CompressContent,
a[12]: DisplayContent,
a[13]: msg_sender, ContactPC 或 ContactDefault 类型,这个才是群聊里的信息发送人,不是群聊或者自己是发送者没有这个字段)
'''
updated_messages = [] # 用于存储修改后的消息列表
messages = msg_db.get_messages(chatroom_wxid)
for row in messages:
message = list(row)
if message[4] == 1: # 自己发送的就没必要解析了
message.append(Me())
updated_messages.append(message)
continue
if message[10] is None: # BytesExtra是空的跳过
message.append(ContactDefault(wxid))
updated_messages.append(message)
continue
msgbytes = MessageBytesExtra()
msgbytes.ParseFromString(message[10])
wxid = ''
for tmp in msgbytes.message2:
if tmp.field1 != 1:
continue
wxid = tmp.field2
if wxid == "": # 系统消息里面 wxid 不存在
message.append(ContactDefault(wxid))
updated_messages.append(message)
continue
contact_info_list = micro_msg_db.get_contact_by_username(wxid)
if contact_info_list is None: # 群聊中已退群的联系人不会保存在数据库里
message.append(ContactDefault(wxid))
updated_messages.append(message)
continue
contact_info = {
'UserName': contact_info_list[0],
'Alias': contact_info_list[1],
'Type': contact_info_list[2],
'Remark': contact_info_list[3],
'NickName': contact_info_list[4],
'smallHeadImgUrl': contact_info_list[7]
}
contact = Contact(contact_info)
contact.smallHeadImgBLOG = misc_db.get_avatar_buffer(contact.wxid)
contact.set_avatar(contact.smallHeadImgBLOG)
message.append(contact)
updated_messages.append(tuple(message))
return updated_messages
def get_chatroom_member_list(self, strtalker):
membermap = {}
'''
获取群聊成员
'''
try:
lock.acquire(True)
if strtalker in self.ChatRoomMap:
membermap = self.ChatRoomMap.get(strtalker)
else:
chatroom = micro_msg_db.get_chatroom_info(strtalker)
if chatroom is None:
return None
# 解析RoomData数据
parsechatroom = ChatRoomData()
parsechatroom.ParseFromString(chatroom[1])
# 群成员数据放入字典存储
for mem in parsechatroom.members:
if mem.displayName is not None and len(mem.displayName) > 0:
membermap[mem.wxID] = mem.displayName
self.ChatRoomMap[strtalker] = membermap
finally:
lock.release()
return membermap
if __name__ == "__main__":
p = PackageMsg()
print(p.get_package_message_by_wxid("48615079469@chatroom"))

9
app/__init__.py Normal file
View File

@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
"""
@File : __init__.py.py
@Author : Shuaikang Zhou
@Time : 2023/1/5 17:43
@IDE : Pycharm
@Version : Python3.10
@comment : ···
"""

0
app/analysis/__init__.py Normal file
View File

535
app/analysis/analysis.py Normal file
View File

@@ -0,0 +1,535 @@
import os
from collections import Counter
import sys
from datetime import datetime
from typing import List
import jieba
from app.DataBase import msg_db, MsgType
from pyecharts import options as opts
from pyecharts.charts import WordCloud, Calendar, Bar, Line, Pie, Map
from app.person import Contact
from app.util.region_conversion import conversion_province_to_chinese
os.makedirs('./data/聊天统计/', exist_ok=True)
def wordcloud_(wxid, time_range=None):
import jieba
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, time_range=time_range)
if not txt_messages:
return {
'chart_data': None,
'keyword': "没有聊天你想分析啥",
'max_num': "0",
'dialogs': []
}
# text = ''.join(map(lambda x: x[7], txt_messages))
text = ''.join(map(lambda x: x[7], txt_messages)) # 1“我”说的话0“Ta”说的话
total_msg_len = len(text)
# 使用jieba进行分词并加入停用词
words = jieba.cut(text)
# 统计词频
word_count = Counter(words)
# 过滤停用词
stopwords_file = './app/data/stopwords.txt'
with open(stopwords_file, "r", encoding="utf-8") as stopword_file:
stopwords1 = set(stopword_file.read().splitlines())
# 构建 FFmpeg 可执行文件的路径
stopwords = set()
stopwords_file = './app/resources/data/stopwords.txt'
if not os.path.exists(stopwords_file):
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
stopwords_file = os.path.join(resource_dir, 'app', 'resources', 'data', 'stopwords.txt')
with open(stopwords_file, "r", encoding="utf-8") as stopword_file:
stopwords = set(stopword_file.read().splitlines())
stopwords = stopwords.union(stopwords1)
filtered_word_count = {word: count for word, count in word_count.items() if len(word) > 1 and word not in stopwords}
# 转换为词云数据格式
data = [(word, count) for word, count in filtered_word_count.items()]
# text_data = data
data.sort(key=lambda x: x[1], reverse=True)
text_data = data[:100] if len(data) > 100 else data
# 创建词云图
keyword, max_num = text_data[0]
w = (
WordCloud(init_opts=opts.InitOpts())
.add(series_name="聊天文字", data_pair=text_data, word_size_range=[5, 100])
)
# return w.render_embed()
return {
'chart_data': w.dump_options_with_quotes(),
'keyword': keyword,
'max_num': str(max_num),
'dialogs': msg_db.get_messages_by_keyword(wxid, keyword, num=5, max_len=12)
}
def get_wordcloud(text):
total_msg_len = len(text)
jieba.load_userdict('./app/data/new_words.txt')
# 使用jieba进行分词并加入停用词
words = jieba.cut(text)
# 统计词频
word_count = Counter(words)
# 过滤停用词
stopwords_file = './app/data/stopwords.txt'
with open(stopwords_file, "r", encoding="utf-8") as stopword_file:
stopwords1 = set(stopword_file.read().splitlines())
# 构建 FFmpeg 可执行文件的路径
stopwords = set()
stopwords_file = './app/resources/data/stopwords.txt'
if not os.path.exists(stopwords_file):
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
stopwords_file = os.path.join(resource_dir, 'app', 'resources', 'data', 'stopwords.txt')
with open(stopwords_file, "r", encoding="utf-8") as stopword_file:
stopwords = set(stopword_file.read().splitlines())
stopwords = stopwords.union(stopwords1)
filtered_word_count = {word: count for word, count in word_count.items() if len(word) > 1 and word not in stopwords}
# 转换为词云数据格式
data = [(word, count) for word, count in filtered_word_count.items()]
# text_data = data
data.sort(key=lambda x: x[1], reverse=True)
text_data = data[:100] if len(data) > 100 else data
# 创建词云图
if text_data:
keyword, max_num = text_data[0]
else:
keyword, max_num = '', 0
w = (
WordCloud()
.add(series_name="聊天文字", data_pair=text_data, word_size_range=[5, 40])
)
return {
'chart_data_wordcloud': w.dump_options_with_quotes(),
'keyword': keyword,
'keyword_max_num': max_num,
}
def wordcloud_christmas(wxid,time_range=None, year='2023'):
import jieba
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, time_range=time_range)
if not txt_messages:
return {
'wordcloud_chart_data': None,
'keyword': "没有聊天你想分析啥",
'max_num': '0',
'dialogs': [],
'total_num': 0,
}
text = ''.join(map(lambda x: x[7], txt_messages))
total_msg_len = len(text)
wordcloud_data = get_wordcloud(text)
# return w.render_embed()
keyword = wordcloud_data.get('keyword')
max_num = wordcloud_data.get('keyword_max_num')
dialogs = msg_db.get_messages_by_keyword(wxid, keyword, num=3, max_len=12, time_range=time_range)
return {
'wordcloud_chart_data': wordcloud_data.get('chart_data_wordcloud'),
'keyword': keyword,
'keyword_max_num': str(max_num),
'dialogs': dialogs,
'total_num': total_msg_len,
}
def calendar_chart(wxid, time_range=None):
calendar_data = msg_db.get_messages_by_days(wxid, time_range)
if not calendar_data:
return {
'chart_data': None,
'calendar_chart_data': None,
'chat_days': 0,
# 'chart':c,
}
min_ = min(map(lambda x: x[1], calendar_data))
max_ = max(map(lambda x: x[1], calendar_data))
start_date_ = calendar_data[0][0]
end_date_ = calendar_data[-1][0]
print(start_date_, '---->', end_date_)
calendar_days = (start_date_, end_date_)
calendar_title = '和Ta的聊天情况'
c = (
Calendar()
.add(
"",
calendar_data,
calendar_opts=opts.CalendarOpts(range_=calendar_days)
)
.set_global_opts(
visualmap_opts=opts.VisualMapOpts(
max_=max_,
min_=min_,
orient="horizontal",
pos_bottom="0px",
pos_left="0px",
),
legend_opts=opts.LegendOpts(is_show=False)
)
)
return {
'chart_data': c.dump_options_with_quotes(),
'calendar_chart_data': c.dump_options_with_quotes(),
'chat_days': len(calendar_data),
# 'chart':c,
}
def month_count(wxid, time_range=None):
"""
每月聊天条数
"""
msg_data = msg_db.get_messages_by_month(wxid, time_range)
y_data = list(map(lambda x: x[1], msg_data))
x_axis = list(map(lambda x: x[0], msg_data))
m = (
Bar(init_opts=opts.InitOpts())
.add_xaxis(x_axis)
.add_yaxis("消息数量", y_data,
label_opts=opts.LabelOpts(is_show=True),
itemstyle_opts=opts.ItemStyleOpts(color="#ffae80"),
)
.set_global_opts(
title_opts=opts.TitleOpts(title="逐月统计", subtitle=None),
datazoom_opts=opts.DataZoomOpts(),
toolbox_opts=opts.ToolboxOpts(),
yaxis_opts=opts.AxisOpts(
name="消息数",
type_="value",
axistick_opts=opts.AxisTickOpts(is_show=True),
splitline_opts=opts.SplitLineOpts(is_show=True),
),
visualmap_opts=opts.VisualMapOpts(
min_=min(y_data),
max_=max(y_data),
dimension=1, # 根据第2个维度y 轴)进行映射
is_piecewise=False, # 是否分段显示
range_color=["#ffbe7a", "#fa7f6f"], # 设置颜色范围
type_="color",
pos_right="0%",
),
)
)
return {
'chart_data': m.dump_options_with_quotes(),
# 'chart': m,
}
def hour_count(wxid, is_Annual_report=False, year='2023'):
"""
小时计数聊天条数
"""
msg_data = msg_db.get_messages_by_hour(wxid, is_Annual_report, year)
print(msg_data)
y_data = list(map(lambda x: x[1], msg_data))
x_axis = list(map(lambda x: x[0], msg_data))
h = (
Line(init_opts=opts.InitOpts())
.add_xaxis(xaxis_data=x_axis)
.add_yaxis(
series_name="聊天频率",
y_axis=y_data,
markpoint_opts=opts.MarkPointOpts(
data=[
opts.MarkPointItem(type_="max", name="最大值"),
opts.MarkPointItem(type_="min", name="最小值", value=int(10)),
]
),
markline_opts=opts.MarkLineOpts(
data=[opts.MarkLineItem(type_="average", name="平均值")]
),
)
.set_global_opts(
title_opts=opts.TitleOpts(title="聊天时段", subtitle=None),
# datazoom_opts=opts.DataZoomOpts(),
# toolbox_opts=opts.ToolboxOpts(),
)
.set_series_opts(
label_opts=opts.LabelOpts(
is_show=False
)
)
)
return {
'chart_data': h
}
types = {
'文本': 1,
'图片': 3,
'语音': 34,
'视频': 43,
'表情包': 47,
'音乐与音频': 4903,
'文件': 4906,
'分享卡片': 4905,
'转账': 492000,
'音视频通话': 50,
'拍一拍等系统消息': 10000,
}
types_ = {
1: '文本',
3: '图片',
34: '语音',
43: '视频',
47: '表情包',
4957: '引用消息',
4903: '音乐与音频',
4906: '文件',
4905: '分享卡片',
492000: '转账',
50: '音视频通话',
10000: '拍一拍等系统消息',
}
def get_weekday(timestamp):
# 将时间戳转换为日期时间对象
dt_object = datetime.fromtimestamp(timestamp)
# 获取星期几0代表星期一1代表星期二以此类推
weekday = dt_object.weekday()
weekdays = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
return weekdays[weekday]
def sender(wxid, time_range, my_name='', ta_name=''):
msg_data = msg_db.get_messages(wxid, time_range)
types_count = {}
send_num = 0 # 发送消息的数量
weekday_count = {}
for message in msg_data:
type_ = message[2]
is_sender = message[4]
subType = message[3]
timestamp = message[5]
weekday = get_weekday(timestamp)
str_time = message[8]
send_num += is_sender
type_ = f'{type_}{subType:0>2d}' if subType != 0 else type_
type_ = int(type_)
if type_ in types_count:
types_count[type_] += 1
else:
types_count[type_] = 1
if weekday in weekday_count:
weekday_count[weekday] += 1
else:
weekday_count[weekday] = 1
receive_num = len(msg_data) - send_num
data = [[types_.get(key), value] for key, value in types_count.items() if key in types_]
if not data:
return {
'chart_data_sender': None,
'chart_data_types': None,
'chart_data_weekday': None,
}
p1 = (
Pie()
.add(
"",
data,
center=["40%", "50%"],
)
.set_global_opts(
datazoom_opts=opts.DataZoomOpts(),
toolbox_opts=opts.ToolboxOpts(),
title_opts=opts.TitleOpts(title="消息类型占比"),
legend_opts=opts.LegendOpts(type_="scroll", pos_left="80%", pos_top="20%", orient="vertical"),
)
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
# .render("./data/聊天统计/types_pie.html")
)
p2 = (
Pie()
.add(
"",
[[my_name, send_num], [ta_name, receive_num]],
center=["40%", "50%"],
)
.set_global_opts(
datazoom_opts=opts.DataZoomOpts(),
toolbox_opts=opts.ToolboxOpts(),
title_opts=opts.TitleOpts(title="双方消息占比"),
legend_opts=opts.LegendOpts(type_="scroll", pos_left="80%", pos_top="20%", orient="vertical"),
)
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}\n{d}%"))
# .render("./data/聊天统计/pie_scroll_legend.html")
)
p3 = (
Pie()
.add(
"",
[[key, value] for key, value in weekday_count.items()],
radius=["40%", "75%"],
)
.set_global_opts(
datazoom_opts=opts.DataZoomOpts(),
toolbox_opts=opts.ToolboxOpts(),
title_opts=opts.TitleOpts(title="星期分布图"),
legend_opts=opts.LegendOpts(orient="vertical", pos_top="15%", pos_left="2%"),
)
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}\n{d}%"))
# .render("./data/聊天统计/pie_weekdays.html")
)
return {
'chart_data_sender': p2.dump_options_with_quotes(),
'chart_data_types': p1.dump_options_with_quotes(),
'chart_data_weekday': p3.dump_options_with_quotes(),
}
def contacts_analysis(contacts):
man_contact_num = 0
woman_contact_num = 0
province_dict = {
'北京': '北京市',
'上海': '上海市',
'天津': '天津市',
'重庆': '重庆市',
'新疆': '新疆维吾尔族自治区',
'广西': '广西壮族自治区',
'内蒙古': '内蒙古自治区',
'宁夏': '宁夏回族自治区',
'西藏': '西藏自治区'
}
provinces = []
for contact, num, text_length in contacts:
if contact.detail.get('gender') == 1:
man_contact_num += 1
elif contact.detail.get('gender') == 2:
woman_contact_num += 1
province_py = contact.detail.get('region')
if province_py:
province = province_py[1]
province = conversion_province_to_chinese(province)
if province:
if province in province_dict:
province = province_dict[province]
else:
province += ''
provinces.append(province)
print(province, contact.detail)
data = Counter(provinces)
data = [[k, v] for k, v in data.items()]
print(data)
max_ = max(list(map(lambda x:x[1],data)))
c = (
Map()
.add("分布", data, "china")
.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
.set_global_opts(
title_opts=opts.TitleOpts(title="地区分布"),
visualmap_opts=opts.VisualMapOpts(max_=max_, is_piecewise=True),
legend_opts=opts.LegendOpts(is_show=False),
)
)
return {
'woman_contact_num': woman_contact_num,
'man_contact_num': man_contact_num,
'contact_region_map': c.dump_options_with_quotes(),
}
def my_message_counter(time_range, my_name=''):
msg_data = msg_db.get_messages_all(time_range=time_range)
types_count = {}
send_num = 0 # 发送消息的数量
weekday_count = {}
str_content = ''
total_text_num = 0
for message in msg_data:
type_ = message[2]
is_sender = message[4]
subType = message[3]
timestamp = message[5]
weekday = get_weekday(timestamp)
str_time = message[8]
send_num += is_sender
type_ = f'{type_}{subType:0>2d}' if subType != 0 else type_
type_ = int(type_)
if type_ in types_count:
types_count[type_] += 1
else:
types_count[type_] = 1
if weekday in weekday_count:
weekday_count[weekday] += 1
else:
weekday_count[weekday] = 1
if type_ == 1:
total_text_num += len(message[7])
if is_sender == 1:
str_content += message[7]
receive_num = len(msg_data) - send_num
data = [[types_.get(key), value] for key, value in types_count.items() if key in types_]
if not data:
return {
'chart_data_sender': None,
'chart_data_types': None,
}
p1 = (
Pie()
.add(
"",
data,
center=["40%", "50%"],
)
.set_global_opts(
datazoom_opts=opts.DataZoomOpts(),
legend_opts=opts.LegendOpts(type_="scroll", pos_left="70%", pos_top="10%", orient="vertical"),
)
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
# .render("./data/聊天统计/types_pie.html")
)
p2 = (
Pie()
.add(
"",
[['发送', send_num], ['接收', receive_num]],
center=["40%", "50%"],
)
.set_global_opts(
datazoom_opts=opts.DataZoomOpts(),
legend_opts=opts.LegendOpts(type_="scroll", pos_left="70%", pos_top="20%", orient="vertical"),
)
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}\n{d}%", position='inside'))
# .render("./data/聊天统计/pie_scroll_legend.html")
)
w = get_wordcloud(str_content)
return {
'chart_data_sender': p2.dump_options_with_quotes(),
'chart_data_types': p1.dump_options_with_quotes(),
'chart_data_wordcloud': w.get('chart_data_wordcloud'),
'keyword': w.get('keyword'),
'keyword_max_num': w.get('keyword_max_num'),
'total_text_num': total_text_num,
}
if __name__ == '__main__':
msg_db.init_database(path='../DataBase/Msg/MSG.db')
# w = wordcloud('wxid_0o18ef858vnu22')
# w_data = wordcloud('wxid_27hqbq7vx5hf22', True, '2023')
# # print(w_data)
# w_data['chart_data'].render("./data/聊天统计/wordcloud.html")
wxid = 'wxid_0o18ef858vnu22'
# data = month_count(wxid, time_range=None)
# data['chart'].render("./data/聊天统计/month_count.html")
# data = calendar_chart(wxid, time_range=None)
# data['chart'].render("./data/聊天统计/calendar_chart.html")
data = sender(wxid, time_range=None, my_name='发送', ta_name='接收')
print(data)

View File

@@ -0,0 +1,103 @@
from datetime import datetime
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import *
from app import person
class ContactUi(QtWidgets.QPushButton):
"""
联系人类继承自pyqt的按钮里面封装了联系人头像等标签
"""
usernameSingal = pyqtSignal(str)
def __init__(self, Ui, id=None, rconversation=None):
super(ContactUi, self).__init__(Ui)
self.contact: person.Contact = person.Contact(rconversation[1])
self.init_ui(Ui)
self.msgCount = rconversation[0]
self.username = rconversation[1]
self.conversationTime = rconversation[6]
self.msgType = rconversation[7]
self.digest = rconversation[8]
hasTrunc = rconversation[10]
attrflag = rconversation[11]
if hasTrunc == 0:
if attrflag == 0:
self.digest = '[动画表情]'
elif attrflag == 67108864:
try:
remark = data.get_conRemark(rconversation[9])
msg = self.digest.split(':')[1].strip('\n').strip()
self.digest = f'{remark}:{msg}'
except Exception as e:
pass
else:
pass
self.show_info(id)
def init_ui(self, Ui):
self.layoutWidget = QtWidgets.QWidget(Ui)
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout1 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout1.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
self.gridLayout1.setContentsMargins(10, 10, 10, 10)
self.gridLayout1.setSpacing(10)
self.gridLayout1.setObjectName("gridLayout1")
self.label_time = QtWidgets.QLabel(self.layoutWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(8)
self.label_time.setFont(font)
self.label_time.setLayoutDirection(QtCore.Qt.RightToLeft)
self.label_time.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
self.label_time.setObjectName("label_time")
self.gridLayout1.addWidget(self.label_time, 0, 2, 1, 1)
self.label_remark = QtWidgets.QLabel(self.layoutWidget)
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(10)
# font.setBold(True)
self.label_remark.setFont(font)
self.label_remark.setObjectName("label_remark")
self.gridLayout1.addWidget(self.label_remark, 0, 1, 1, 1)
self.label_msg = QtWidgets.QLabel(self.layoutWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(8)
self.label_msg.setFont(font)
self.label_msg.setObjectName("label_msg")
self.gridLayout1.addWidget(self.label_msg, 1, 1, 1, 2)
self.label_avatar = QtWidgets.QLabel(self.layoutWidget)
self.label_avatar.setMinimumSize(QtCore.QSize(60, 60))
self.label_avatar.setMaximumSize(QtCore.QSize(60, 60))
self.label_avatar.setLayoutDirection(QtCore.Qt.RightToLeft)
self.label_avatar.setAutoFillBackground(False)
self.label_avatar.setStyleSheet("background-color: #ffffff;")
self.label_avatar.setInputMethodHints(QtCore.Qt.ImhNone)
self.label_avatar.setFrameShape(QtWidgets.QFrame.NoFrame)
self.label_avatar.setFrameShadow(QtWidgets.QFrame.Plain)
self.label_avatar.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.label_avatar.setObjectName("label_avatar")
self.gridLayout1.addWidget(self.label_avatar, 0, 0, 2, 1)
self.gridLayout1.setColumnStretch(0, 1)
self.gridLayout1.setColumnStretch(1, 6)
self.gridLayout1.setRowStretch(0, 5)
self.gridLayout1.setRowStretch(1, 3)
self.setLayout(self.gridLayout1)
self.setStyleSheet(
"QPushButton {background-color: rgb(220,220,220);}"
"QPushButton:hover{background-color: rgb(208,208,208);}\n"
)
def show_info(self, id):
time = datetime.now().strftime("%m-%d %H:%M")
msg = '还没说话'
self.label_avatar.setPixmap(self.contact.avatar) # 在label上显示图片
self.label_remark.setText(self.contact.conRemark)
self.label_msg.setText(self.digest)
self.label_time.setText(data.timestamp2str(self.conversationTime)[2:])
def show_msg(self):
self.usernameSingal.emit(self.username)

303
app/components/CAvatar.py Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,71 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2020年3月13日
@author: Irony
@site: https://pyqt.site , https://github.com/PyQt5
@email: 892768447@qq.com
@file: Demo.Lib.QCursorGif
@description:
"""
try:
from PyQt5.QtCore import QTimer, Qt
from PyQt5.QtGui import QCursor, QPixmap
from PyQt5.QtWidgets import QApplication
except ImportError:
from PySide2.QtCore import QTimer, Qt
from PySide2.QtGui import QCursor, QPixmap
from PySide2.QtWidgets import QApplication
from app.resources import resource_rc
var = resource_rc.qt_resource_name
class QCursorGif:
def initCursor(self, cursors, parent=None):
# 记录默认的光标
self._oldCursor = Qt.ArrowCursor
self.setOldCursor(parent)
# 加载光标图片
self._cursorImages = [
QCursor(QPixmap(cursor)) for cursor in cursors]
self._cursorIndex = 0
self._cursorCount = len(self._cursorImages) - 1
# 创建刷新定时器
self._cursorTimeout = 200
self._cursorTimer = QTimer(parent)
self._cursorTimer.timeout.connect(self._doBusy)
self.num = 0
def _doBusy(self):
if self._cursorIndex > self._cursorCount:
self._cursorIndex = 0
QApplication.setOverrideCursor(
self._cursorImages[self._cursorIndex])
self._cursorIndex += 1
self.num += 1
def startBusy(self):
# QApplication.setOverrideCursor(Qt.WaitCursor)
if not self._cursorTimer.isActive():
self._cursorTimer.start(self._cursorTimeout)
def stopBusy(self):
self._cursorTimer.stop()
QApplication.restoreOverrideCursor()
# 将光标出栈,恢复至原始状态
for i in range(self.num):
QApplication.restoreOverrideCursor()
self.num = 0
def setCursorTimeout(self, timeout):
self._cursorTimeout = timeout
def setOldCursor(self, parent=None):
QApplication.overrideCursor()
self._oldCursor = (QApplication.overrideCursor() or parent.cursor() or Qt.ArrowCursor or Qt.IBeamCursor) if parent else (
QApplication.overrideCursor() or Qt.ArrowCursor)

View File

@@ -0,0 +1,2 @@
from .contact_info_ui import ContactQListWidgetItem
from .scroll_bar import ScrollBar

View File

@@ -0,0 +1,301 @@
import os.path
import subprocess
import platform
from PyQt5 import QtGui
from PyQt5.QtCore import QSize, pyqtSignal, Qt, QThread
from PyQt5.QtGui import QPainter, QFont, QColor, QPixmap, QPolygon, QFontMetrics
from PyQt5.QtWidgets import QWidget, QLabel, QHBoxLayout, QSizePolicy, QVBoxLayout, QSpacerItem, \
QScrollArea
from app.components.scroll_bar import ScrollBar
class MessageType:
Text = 1
Image = 3
class TextMessage(QLabel):
heightSingal = pyqtSignal(int)
def __init__(self, text, is_send=False, parent=None):
if isinstance(text, bytes):
text = text.decode('utf-8')
super(TextMessage, self).__init__(text, parent)
font = QFont('微软雅黑', 12)
self.setFont(font)
self.setWordWrap(True)
self.setMaximumWidth(800)
# self.setMinimumWidth(100)
self.setMinimumHeight(45)
self.setTextInteractionFlags(Qt.TextSelectableByMouse)
self.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
if is_send:
self.setAlignment(Qt.AlignCenter | Qt.AlignRight)
self.setStyleSheet(
'''
background-color:#b2e281;
border-radius:10px;
padding:10px;
'''
)
else:
self.setStyleSheet(
'''
background-color:white;
border-radius:10px;
padding:10px;
'''
)
font_metrics = QFontMetrics(font)
rect = font_metrics.boundingRect(text)
# rect = font_metrics
self.setMaximumWidth(rect.width() + 40)
def paintEvent(self, a0: QtGui.QPaintEvent) -> None:
super(TextMessage, self).paintEvent(a0)
class Triangle(QLabel):
def __init__(self, Type, is_send=False, position=(0, 0), parent=None):
"""
@param Type:
@param is_send:
@param position:(x,y)
@param parent:
"""
super().__init__(parent)
self.Type = Type
self.is_send = is_send
self.position = position
def paintEvent(self, a0: QtGui.QPaintEvent) -> None:
super(Triangle, self).paintEvent(a0)
if self.Type == MessageType.Text:
self.setFixedSize(6, 45)
painter = QPainter(self)
triangle = QPolygon()
x, y = self.position
if self.is_send:
painter.setPen(QColor('#b2e281'))
painter.setBrush(QColor('#b2e281'))
triangle.setPoints(0, 20+y, 0, 34+y, 6, 27+y)
else:
painter.setPen(QColor('white'))
painter.setBrush(QColor('white'))
triangle.setPoints(0, 27+y, 6, 20+y, 6, 34+y)
painter.drawPolygon(triangle)
class Notice(QLabel):
def __init__(self, text, type_=3, parent=None):
super().__init__(text, parent)
self.type_ = type_
self.setFont(QFont('微软雅黑', 10))
self.setWordWrap(True)
self.setTextInteractionFlags(Qt.TextSelectableByMouse)
self.setAlignment(Qt.AlignCenter)
class Avatar(QLabel):
def __init__(self, avatar, parent=None):
super().__init__(parent)
if isinstance(avatar, str):
self.setPixmap(QPixmap(avatar).scaled(45, 45))
self.image_path = avatar
elif isinstance(avatar, QPixmap):
self.setPixmap(avatar.scaled(45, 45))
self.setFixedSize(QSize(45, 45))
def open_image_viewer(file_path):
system_platform = platform.system()
if system_platform == "Darwin": # macOS
subprocess.run(["open", file_path])
elif system_platform == "Windows":
subprocess.run(["start", " ", file_path], shell=True)
elif system_platform == "Linux":
subprocess.run(["xdg-open", file_path])
else:
print("Unsupported platform")
class OpenImageThread(QThread):
def __init__(self, image_path):
super().__init__()
self.image_path = image_path
def run(self) -> None:
if os.path.exists(self.image_path):
open_image_viewer(self.image_path)
class ImageMessage(QLabel):
def __init__(self, image, is_send, image_link='', max_width=480, max_height=240, parent=None):
"""
param:image 图像路径或者QPixmap对象
param:image_link='' 点击图像打开的文件路径
"""
super().__init__(parent)
self.image = QLabel(self)
self.max_width = max_width
self.max_height = max_height
# self.setFixedSize(self.max_width,self.max_height)
self.setMaximumWidth(self.max_width)
self.setMaximumHeight(self.max_height)
self.setCursor(Qt.PointingHandCursor)
if isinstance(image, str):
pixmap = QPixmap(image)
self.image_path = image
elif isinstance(image, QPixmap):
pixmap = image
self.set_image(pixmap)
if image_link:
self.image_path = image_link
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
if is_send:
self.setAlignment(Qt.AlignCenter | Qt.AlignRight)
# self.setScaledContents(True)
def set_image(self, pixmap):
# 计算调整后的大小
adjusted_width = min(pixmap.width(), self.max_width)
adjusted_height = min(pixmap.height(), self.max_height)
self.setPixmap(pixmap.scaled(adjusted_width, adjusted_height, Qt.KeepAspectRatio))
# 调整QLabel的大小以适应图片的宽高但不超过最大宽高
# self.setFixedSize(adjusted_width, adjusted_height)
def mousePressEvent(self, event):
if event.buttons() == Qt.LeftButton: # 左键按下
print('打开图像', self.image_path)
self.open_image_thread = OpenImageThread(self.image_path)
self.open_image_thread.start()
class BubbleMessage(QWidget):
def __init__(self, str_content, avatar, Type, is_send=False, display_name=None, parent=None):
super().__init__(parent)
self.isSend = is_send
# self.set
self.setStyleSheet(
'''
border:none;
'''
)
layout = QHBoxLayout()
layout.setSpacing(0)
layout.setContentsMargins(0, 5, 5, 5)
# self.resize(QSize(200, 50))
self.avatar = Avatar(avatar)
triangle = Triangle(Type, is_send, (0, 0))
if Type == MessageType.Text:
self.message = TextMessage(str_content, is_send)
# self.message.setMaximumWidth(int(self.width() * 0.6))
elif Type == MessageType.Image:
self.message = ImageMessage(str_content, is_send)
else:
raise ValueError("未知的消息类型")
if display_name:
triangle = Triangle(Type, is_send, (0, 10))
label_name = QLabel(display_name, self)
label_name.setFont(QFont('微软雅黑', 10))
if is_send:
label_name.setAlignment(Qt.AlignRight)
vlayout = QVBoxLayout()
vlayout.setSpacing(0)
if is_send:
vlayout.addWidget(label_name, 0, Qt.AlignTop | Qt.AlignRight)
vlayout.addWidget(self.message, 0, Qt.AlignTop | Qt.AlignRight)
else:
vlayout.addWidget(label_name)
vlayout.addWidget(self.message)
self.spacerItem = QSpacerItem(45 + 6, 45, QSizePolicy.Expanding, QSizePolicy.Minimum)
if is_send:
layout.addItem(self.spacerItem)
if display_name:
layout.addLayout(vlayout, 1)
else:
layout.addWidget(self.message, 1)
layout.addWidget(triangle, 0, Qt.AlignTop | Qt.AlignLeft)
layout.addWidget(self.avatar, 0, Qt.AlignTop | Qt.AlignLeft)
else:
layout.addWidget(self.avatar, 0, Qt.AlignTop | Qt.AlignRight)
layout.addWidget(triangle, 0, Qt.AlignTop | Qt.AlignRight)
if display_name:
layout.addLayout(vlayout, 1)
else:
layout.addWidget(self.message, 1)
layout.addItem(self.spacerItem)
self.setLayout(layout)
class ScrollAreaContent(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.adjustSize()
class ScrollArea(QScrollArea):
def __init__(self, parent=None):
super().__init__(parent)
self.setWidgetResizable(True)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setStyleSheet(
'''
border:none;
'''
)
class ChatWidget(QWidget):
def __init__(self):
super().__init__()
self.resize(500, 200)
layout = QVBoxLayout()
layout.setSpacing(0)
self.adjustSize()
# 生成滚动区域
self.scrollArea = ScrollArea(self)
scrollBar = ScrollBar()
self.scrollArea.setVerticalScrollBar(scrollBar)
# 生成滚动区域的内容部署层部件
self.scrollAreaWidgetContents = ScrollAreaContent(self.scrollArea)
self.scrollAreaWidgetContents.setMinimumSize(50, 100)
# 设置滚动区域的内容部署部件为前面生成的内容部署层部件
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
layout.addWidget(self.scrollArea)
self.layout0 = QVBoxLayout()
self.layout0.setSpacing(0)
self.scrollAreaWidgetContents.setLayout(self.layout0)
self.setLayout(layout)
def add_message_item(self, bubble_message, index=1):
if index:
self.layout0.addWidget(bubble_message)
else:
self.layout0.insertWidget(0, bubble_message)
# self.set_scroll_bar_last()
def set_scroll_bar_last(self):
self.scrollArea.verticalScrollBar().setValue(
self.scrollArea.verticalScrollBar().maximum()
)
def set_scroll_bar_value(self, val):
self.verticalScrollBar().setValue(val)
def verticalScrollBar(self):
return self.scrollArea.verticalScrollBar()
def update(self) -> None:
super().update()
self.scrollAreaWidgetContents.adjustSize()
self.scrollArea.update()
# self.scrollArea.repaint()
# self.verticalScrollBar().setMaximum(self.scrollAreaWidgetContents.height())

View File

@@ -0,0 +1,78 @@
import time
from datetime import datetime, timedelta
from PyQt5.QtCore import QTimer, QThread, pyqtSignal, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QDialog, QCheckBox, QMessageBox, QCalendarWidget, QWidget, QVBoxLayout, \
QToolButton
from app.ui.Icon import Icon
class CalendarDialog(QDialog):
selected_date_signal = pyqtSignal(int)
def __init__(self, date_range=None, parent=None):
"""
@param date_range: tuple[Union[QDate, datetime.date],Union[QDate, datetime.date]] #限定的可选择范围
@param parent:
"""
super().__init__(parent)
self.setWindowTitle('选择日期')
self.calendar = QCalendarWidget(self)
self.calendar.clicked.connect(self.onDateChanged)
prev_btn = self.calendar.findChild(QToolButton, "qt_calendar_prevmonth")
prev_btn.setIcon(Icon.Arrow_left_Icon)
next_btn = self.calendar.findChild(QToolButton, "qt_calendar_nextmonth")
next_btn.setIcon(Icon.Arrow_right_Icon)
self.date_range = date_range
if date_range:
self.calendar.setDateRange(*date_range)
# 从第一天开始,依次添加日期到列表,直到该月的最后一天
current_date = date_range[1]
while (current_date + timedelta(days=1)).month == date_range[1].month:
current_date += timedelta(days=1)
range_format = self.calendar.dateTextFormat(current_date)
range_format.setForeground(Qt.gray)
self.calendar.setDateTextFormat(current_date, range_format)
# 从第一天开始,依次添加日期到列表,直到该月的最后一天
current_date = date_range[0]
while (current_date - timedelta(days=1)).month == date_range[0].month:
current_date -= timedelta(days=1)
range_format = self.calendar.dateTextFormat(current_date)
range_format.setForeground(Qt.gray)
self.calendar.setDateTextFormat(current_date, range_format)
layout = QVBoxLayout(self)
layout.addWidget(self.calendar)
self.setLayout(layout)
def set_start_date(self):
if self.date_range:
self.calendar.setCurrentPage(self.date_range[0].year, self.date_range[0].month)
def set_end_date(self):
if self.date_range:
self.calendar.setCurrentPage(self.date_range[1].year, self.date_range[1].month)
def onDateChanged(self):
# 获取选择的日期
selected_date = self.calendar.selectedDate()
s_t = time.strptime(selected_date.toString("yyyy-MM-dd"), "%Y-%m-%d") # 返回元祖
mkt = int(time.mktime(s_t))
timestamp = mkt
self.selected_date_signal.emit(timestamp)
print("Selected Date:", selected_date.toString("yyyy-MM-dd"), timestamp)
self.close()
if __name__ == '__main__':
import sys
from datetime import datetime, timedelta
app = QApplication(sys.argv)
# 设置日期范围
start_date = datetime(2024, 1, 5)
end_date = datetime(2024, 1, 9)
date_range = (start_date.date(), end_date.date())
ex = CalendarDialog(date_range=date_range)
ex.show()
sys.exit(app.exec_())

View File

@@ -0,0 +1,104 @@
import sys
from PyQt5.Qt import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from .CAvatar import CAvatar
Stylesheet = """
QWidget{
background: rgb(238,244,249);
}
"""
Stylesheet_hover = """
QWidget,QLabel{
background: rgb(230, 235, 240);
}
"""
Stylesheet_clicked = """
QWidget,QLabel{
background: rgb(230, 235, 240);
}
"""
class QListWidgetItemWidget(QWidget):
def __init__(self):
super().__init__()
self.is_selected = False
def leaveEvent(self, e): # 鼠标离开label
if self.is_selected:
return
self.setStyleSheet(Stylesheet)
def enterEvent(self, e): # 鼠标移入label
self.setStyleSheet(Stylesheet_hover)
# 自定义的item 继承自QListWidgetItem
class ContactQListWidgetItem(QListWidgetItem):
def __init__(self, name, url, img_bytes=None):
super().__init__()
# 自定义item中的widget 用来显示自定义的内容
self.widget = QListWidgetItemWidget()
# 用来显示name
self.nameLabel = QLabel(self.widget)
self.nameLabel.setText(name)
# 用来显示avator(图像)
self.avatorLabel = CAvatar(parent=self.widget, shape=CAvatar.Rectangle, size=QSize(60, 60),
url=url, img_bytes=img_bytes)
# 设置布局用来对nameLabel和avatorLabel进行布局
hbox = QHBoxLayout()
hbox.addWidget(self.avatorLabel)
hbox.addWidget(self.nameLabel)
hbox.addStretch(1)
# 设置widget的布局
self.widget.setLayout(hbox)
self.widget.setStyleSheet(Stylesheet)
# 设置自定义的QListWidgetItem的sizeHint不然无法显示
self.setSizeHint(self.widget.sizeHint())
def select(self):
"""
设置选择后的事件
@return:
"""
self.widget.is_selected = True
self.widget.setStyleSheet(Stylesheet_clicked)
def dis_select(self):
"""
设置取消选择的事件
@return:
"""
self.widget.is_selected = False
self.widget.setStyleSheet(Stylesheet)
if __name__ == "__main__":
app = QApplication(sys.argv)
# 主窗口
w = QWidget()
w.setWindowTitle("QListWindow")
# 新建QListWidget
listWidget = QListWidget(w)
listWidget.resize(300, 300)
# 新建两个自定义的QListWidgetItem(customQListWidgetItem)
item1 = ContactQListWidgetItem("鲤鱼王", "liyuwang.jpg")
item2 = ContactQListWidgetItem("可达鸭", "kedaya.jpg")
# 在listWidget中加入两个自定义的item
listWidget.addItem(item1)
listWidget.setItemWidget(item1, item1.widget)
listWidget.addItem(item2)
listWidget.setItemWidget(item2, item2.widget)
# 绑定点击槽函数 点击显示对应item中的name
listWidget.itemClicked.connect(lambda item: print(item.nameLabel.text()))
w.show()
sys.exit(app.exec_())

View File

@@ -0,0 +1,127 @@
import sys
from PyQt5.Qt import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
try:
from .CAvatar import CAvatar
except:
from CAvatar import CAvatar
Stylesheet = """
QWidget{
background: rgb(238,244,249);
}
"""
Stylesheet_hover = """
QWidget,QLabel{
background: rgb(230, 235, 240);
}
"""
Stylesheet_clicked = """
QWidget,QLabel{
background: rgb(230, 235, 240);
}
"""
class QListWidgetItemWidget(QWidget):
def __init__(self):
super().__init__()
self.is_selected = False
def leaveEvent(self, e): # 鼠标离开label
if self.is_selected:
return
self.setStyleSheet(Stylesheet)
def enterEvent(self, e): # 鼠标移入label
self.setStyleSheet(Stylesheet_hover)
# 自定义的item 继承自QListWidgetItem
class ContactQListWidgetItem(QListWidgetItem):
def __init__(self, name, url, img_bytes=None):
super().__init__()
self.is_select = False
# 自定义item中的widget 用来显示自定义的内容
self.widget = QListWidgetItemWidget()
# 用来显示name
self.nameLabel = QLabel(self.widget)
self.nameLabel.setText(name)
# 用来显示avator(图像)
self.avatorLabel = CAvatar(parent=self.widget, shape=CAvatar.Rectangle, size=QSize(30, 30),
url=url, img_bytes=img_bytes)
# 设置布局用来对nameLabel和avatorLabel进行布局
hbox = QHBoxLayout(self.widget)
self.checkBox = QCheckBox(self.widget)
self.checkBox.clicked.connect(self.select)
hbox.addWidget(self.checkBox)
hbox.addWidget(self.avatorLabel)
hbox.addWidget(self.nameLabel)
hbox.addStretch(1)
# 设置widget的布局
self.widget.setLayout(hbox)
self.widget.setStyleSheet(Stylesheet)
# 设置自定义的QListWidgetItem的sizeHint不然无法显示
self.setSizeHint(self.widget.sizeHint())
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth())
self.widget.setSizePolicy(sizePolicy)
def select(self):
"""
设置选择后的事件
@return:
"""
self.widget.is_selected = True
self.is_select = not self.is_select
# print('选择',self.is_select)
self.checkBox.setChecked(self.is_select)
# self.widget.setStyleSheet(Stylesheet_clicked)
def force_select(self):
self.is_select = True
self.checkBox.setChecked(self.is_select)
def force_dis_select(self):
self.is_select = False
self.checkBox.setChecked(self.is_select)
def dis_select(self):
"""
设置取消选择的事件
@return:
"""
self.widget.is_selected = False
self.widget.setStyleSheet(Stylesheet)
if __name__ == "__main__":
app = QApplication(sys.argv)
# 主窗口
w = QWidget()
w.setWindowTitle("QListWindow")
# 新建QListWidget
listWidget = QListWidget(w)
listWidget.resize(300, 300)
# 新建两个自定义的QListWidgetItem(customQListWidgetItem)
item1 = ContactQListWidgetItem("鲤鱼王", "liyuwang.jpg")
item2 = ContactQListWidgetItem("可达鸭", "kedaya.jpg")
# 在listWidget中加入两个自定义的item
listWidget.addItem(item1)
listWidget.setItemWidget(item1, item1.widget)
listWidget.addItem(item2)
listWidget.setItemWidget(item2, item2.widget)
# 绑定点击槽函数 点击显示对应item中的name
listWidget.itemClicked.connect(lambda item: item.select())
w.show()
sys.exit(app.exec_())

View File

@@ -0,0 +1,39 @@
from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class PromptBar(QLabel):
def __init__(self, parent=None):
super().__init__(parent)
def paintEvent(self, e): # 绘图事件
qp = QPainter()
qp.begin(self)
self.drawRectangles1(qp) # 绘制线条矩形
self.drawRectangles2(qp) # 绘制填充矩形
self.drawRectangles3(qp) # 绘制线条+填充矩形
self.drawRectangles4(qp) # 绘制线条矩形2
qp.end()
def drawRectangles1(self, qp): # 绘制填充矩形
qp.setPen(QPen(Qt.black, 2, Qt.SolidLine)) # 颜色、线宽、线性
qp.drawRect(*self.data)
def drawRectangles2(self, qp): # 绘制填充矩形
qp.setPen(QPen(Qt.black, 2, Qt.NoPen))
qp.setBrush(QColor(200, 0, 0))
qp.drawRect(220, 15, 200, 100)
def drawRectangles3(self, qp): # 绘制线条+填充矩形
qp.setPen(QPen(Qt.black, 2, Qt.SolidLine))
qp.setBrush(QColor(200, 0, 0))
qp.drawRect(430, 15, 200, 100)
def drawRectangles4(self, qp): # 绘制线条矩形2
path = QtGui.QPainterPath()
qp.setPen(QPen(Qt.blue, 2, Qt.SolidLine))
qp.setBrush(QColor(0, 0, 0, 0)) # 设置画刷颜色透明
path.addRect(100, 200, 200, 100)
qp.drawPath(path)

View File

@@ -0,0 +1,48 @@
from PyQt5.QtWidgets import QScrollBar
class ScrollBar(QScrollBar):
def __init__(self):
super().__init__()
self.setStyleSheet(
'''
QScrollBar:vertical {
border-width: 0px;
border: none;
background:rgba(133, 135, 138, 0);
width:4px;
margin: 0px 0px 0px 0px;
}
QScrollBar::handle:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgb(133, 135, 138), stop: 0.5 rgb(133, 135, 138), stop:1 rgb(133, 135, 138));
min-height: 20px;
max-height: 20px;
margin: 0 0px 0 0px;
border-radius: 2px;
}
QScrollBar::add-line:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0));
height: 0px;
border: none;
subcontrol-position: bottom;
subcontrol-origin: margin;
}
QScrollBar::sub-line:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0));
height: 0 px;
border: none;
subcontrol-position: top;
subcontrol-origin: margin;
}
QScrollBar::sub-page:vertical {
background: rgba(133, 135, 138, 0);
}
QScrollBar::add-page:vertical {
background: rgba(133, 135, 138, 0);
}
'''
)

35
app/config.py Normal file
View File

@@ -0,0 +1,35 @@
import os
version = '2.0.5'
contact = '701805520'
github = 'https://github.com/LC044/WeChatMsg'
website = 'https://memotrace.cn/'
copyright = '© 2022-2024 SiYuan'
license = 'GPLv3'
description = [
'1. 支持获取个人信息<br>',
'2. 支持显示聊天界面<br>',
'3. 支持导出聊天记录<br>&nbsp;&nbsp;&nbsp;&nbsp;* csv<br>&nbsp;&nbsp;&nbsp;&nbsp;* html<br>&nbsp;&nbsp;&nbsp;&nbsp;* '
'txt<br>&nbsp;&nbsp;&nbsp;&nbsp;* docx<br>',
'4. 生成年度报告——圣诞特别版',
]
about = f'''
版本:{version}<br>
QQ交流群:请关注微信公众号回复:联系方式<br>
地址:<a href='{github}'>{github}</a><br>
官网:<a href='{website}'>{website}</a><br>
新特性:<br>{''.join(['' + i for i in description])}<br>
License <a href='https://github.com/LC044/WeChatMsg/blob/master/LICENSE' target='_blank'>{license}</a><br>
Copyright {copyright}
'''
# 数据存放文件路径
INFO_FILE_PATH = './app/data/info.json' # 个人信息文件
DB_DIR = './app/Database/Msg'
OUTPUT_DIR = './data/' # 输出文件夹
os.makedirs('./app/data', exist_ok=True)
os.makedirs(DB_DIR, exist_ok=True)
os.makedirs(OUTPUT_DIR, exist_ok=True)
# 全局参数
SEND_LOG_FLAG = True # 是否发送错误日志
SERVER_API_URL = 'http://api.lc044.love' # api接口

208
app/decrypt/decrypt.py Normal file
View File

@@ -0,0 +1,208 @@
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name: getwxinfo.py
# Description:
# Author: xaoyaoo
# Date: 2023/08/21
# License: https://github.com/xaoyaoo/PyWxDump/blob/3b794bcb47b0457d1245ce5b4cfec61b74524073/LICENSE MIT
# 微信数据库采用的加密算法是256位的AES-CBC。数据库的默认的页大小是4096字节即4KB其中每一个页都是被单独加解密的。
# 加密文件的每一个页都有一个随机的初始化向量,它被保存在每一页的末尾。
# 加密文件的每一页都存有着消息认证码算法使用的是HMAC-SHA1安卓数据库使用的是SHA512。它也被保存在每一页的末尾。
# 每一个数据库文件的开头16字节都保存了一段唯一且随机的盐值作为HMAC的验证和数据的解密。
# 用来计算HMAC的key与解密的key是不同的解密用的密钥是主密钥和之前提到的16字节的盐值通过PKCS5_PBKF2_HMAC1密钥扩展算法迭代64000次计算得到的。而计算HMAC的密钥是刚提到的解密密钥和16字节盐值异或0x3a的值通过PKCS5_PBKF2_HMAC1密钥扩展算法迭代2次计算得到的。
# 为了保证数据部分长度是16字节即AES块大小的整倍数每一页的末尾将填充一段空字节使得保留字段的长度为48字节。
# 综上加密文件结构为第一页4KB数据前16字节为盐值紧接着4032字节数据再加上16字节IV和20字节HMAC以及12字节空字节而后的页均是4048字节长度的加密数据段和48字节的保留段。
# -------------------------------------------------------------------------------
import argparse
import hmac
import hashlib
import os
from typing import Union, List
from Cryptodome.Cipher import AES
# from Crypto.Cipher import AES # 如果上面的导入失败,可以尝试使用这个
SQLITE_FILE_HEADER = "SQLite format 3\x00" # SQLite文件头
KEY_SIZE = 32
DEFAULT_PAGESIZE = 4096
DEFAULT_ITER = 64000
# 通过密钥解密数据库
def decrypt(key: str, db_path, out_path):
"""
通过密钥解密数据库
:param key: 密钥 64位16进制字符串
:param db_path: 待解密的数据库路径(必须是文件)
:param out_path: 解密后的数据库输出路径(必须是文件)
:return:
"""
if not os.path.exists(db_path) or not os.path.isfile(db_path):
return False, f"[-] db_path:'{db_path}' File not found!"
if not os.path.exists(os.path.dirname(out_path)):
return False, f"[-] out_path:'{out_path}' File not found!"
if len(key) != 64:
return False, f"[-] key:'{key}' Len Error!"
password = bytes.fromhex(key.strip())
with open(db_path, "rb") as file:
blist = file.read()
salt = blist[:16]
byteKey = hashlib.pbkdf2_hmac("sha1", password, salt, DEFAULT_ITER, KEY_SIZE)
first = blist[16:DEFAULT_PAGESIZE]
if len(salt) != 16:
return False, f"[-] db_path:'{db_path}' File Error!"
mac_salt = bytes([(salt[i] ^ 58) for i in range(16)])
mac_key = hashlib.pbkdf2_hmac("sha1", byteKey, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, first[:-32], hashlib.sha1)
hash_mac.update(b'\x01\x00\x00\x00')
if hash_mac.digest() != first[-32:-12]:
return False, f"[-] Key Error! (key:'{key}'; db_path:'{db_path}'; out_path:'{out_path}' )"
newblist = [blist[i:i + DEFAULT_PAGESIZE] for i in range(DEFAULT_PAGESIZE, len(blist), DEFAULT_PAGESIZE)]
with open(out_path, "wb") as deFile:
deFile.write(SQLITE_FILE_HEADER.encode())
t = AES.new(byteKey, AES.MODE_CBC, first[-48:-32])
decrypted = t.decrypt(first[:-48])
deFile.write(decrypted)
deFile.write(first[-48:])
for i in newblist:
t = AES.new(byteKey, AES.MODE_CBC, i[-48:-32])
decrypted = t.decrypt(i[:-48])
deFile.write(decrypted)
deFile.write(i[-48:])
return True, [db_path, out_path, key]
def batch_decrypt(key: str, db_path: Union[str, List[str]], out_path: str, is_logging: bool = False):
if not isinstance(key, str) or not isinstance(out_path, str) or not os.path.exists(out_path) or len(key) != 64:
error = f"[-] (key:'{key}' or out_path:'{out_path}') Error!"
if is_logging: print(error)
return False, error
process_list = []
if isinstance(db_path, str):
if not os.path.exists(db_path):
error = f"[-] db_path:'{db_path}' not found!"
if is_logging: print(error)
return False, error
if os.path.isfile(db_path):
inpath = db_path
outpath = os.path.join(out_path, 'de_' + os.path.basename(db_path))
process_list.append([key, inpath, outpath])
elif os.path.isdir(db_path):
for root, dirs, files in os.walk(db_path):
for file in files:
inpath = os.path.join(root, file)
rel = os.path.relpath(root, db_path)
outpath = os.path.join(out_path, rel, 'de_' + file)
if not os.path.exists(os.path.dirname(outpath)):
os.makedirs(os.path.dirname(outpath))
process_list.append([key, inpath, outpath])
else:
error = f"[-] db_path:'{db_path}' Error "
if is_logging: print(error)
return False, error
elif isinstance(db_path, list):
rt_path = os.path.commonprefix(db_path)
if not os.path.exists(rt_path):
rt_path = os.path.dirname(rt_path)
for inpath in db_path:
if not os.path.exists(inpath):
erreor = f"[-] db_path:'{db_path}' not found!"
if is_logging: print(erreor)
return False, erreor
inpath = os.path.normpath(inpath)
rel = os.path.relpath(os.path.dirname(inpath), rt_path)
outpath = os.path.join(out_path, rel, 'de_' + os.path.basename(inpath))
if not os.path.exists(os.path.dirname(outpath)):
os.makedirs(os.path.dirname(outpath))
process_list.append([key, inpath, outpath])
else:
error = f"[-] db_path:'{db_path}' Error "
if is_logging: print(error)
return False, error
result = []
for i in process_list:
result.append(decrypt(*i)) # 解密
# 删除空文件夹
for root, dirs, files in os.walk(out_path, topdown=False):
for dir in dirs:
if not os.listdir(os.path.join(root, dir)):
os.rmdir(os.path.join(root, dir))
if is_logging:
print("=" * 32)
success_count = 0
fail_count = 0
for code, ret in result:
if code == False:
print(ret)
fail_count += 1
else:
print(f'[+] "{ret[0]}" -> "{ret[1]}"')
success_count += 1
print("-" * 32)
print(f"[+] 共 {len(result)} 个文件, 成功 {success_count} 个, 失败 {fail_count}")
print("=" * 32)
return True, result
def encrypt(key: str, db_path, out_path):
"""
通过密钥加密数据库
:param key: 密钥 64位16进制字符串
:param db_path: 待加密的数据库路径(必须是文件)
:param out_path: 加密后的数据库输出路径(必须是文件)
:return:
"""
if not os.path.exists(db_path) or not os.path.isfile(db_path):
return False, f"[-] db_path:'{db_path}' File not found!"
if not os.path.exists(os.path.dirname(out_path)):
return False, f"[-] out_path:'{out_path}' File not found!"
if len(key) != 64:
return False, f"[-] key:'{key}' Len Error!"
password = bytes.fromhex(key.strip())
with open(db_path, "rb") as file:
blist = file.read()
salt = os.urandom(16) # 生成随机盐值
byteKey = hashlib.pbkdf2_hmac("sha1", password, salt, DEFAULT_ITER, KEY_SIZE)
# 计算消息认证码
mac_salt = bytes([(salt[i] ^ 58) for i in range(16)])
mac_key = hashlib.pbkdf2_hmac("sha1", byteKey, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, blist[:-32], hashlib.sha1)
hash_mac.update(b'\x01\x00\x00\x00')
mac_digest = hash_mac.digest()
newblist = [blist[i:i + DEFAULT_PAGESIZE] for i in range(DEFAULT_PAGESIZE, len(blist), DEFAULT_PAGESIZE)]
with open(out_path, "wb") as enFile:
enFile.write(salt) # 写入盐值
enFile.write(mac_digest) # 写入消息认证码
for i in newblist:
t = AES.new(byteKey, AES.MODE_CBC, os.urandom(16)) # 生成随机的初始向量
encrypted = t.encrypt(i) # 加密数据块
enFile.write(encrypted)
return True, [db_path, out_path, key]

View File

@@ -0,0 +1,259 @@
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name: get_base_addr.py
# Description:
# Author: xaoyaoo
# Date: 2023/08/22
# License: https://github.com/xaoyaoo/PyWxDump/blob/3b794bcb47b0457d1245ce5b4cfec61b74524073/LICENSE MIT
# -------------------------------------------------------------------------------
import argparse
import ctypes
import hashlib
import json
import multiprocessing
import os
import re
import sys
import psutil
from win32com.client import Dispatch
from pymem import Pymem
import pymem
import hmac
ReadProcessMemory = ctypes.windll.kernel32.ReadProcessMemory
void_p = ctypes.c_void_p
KEY_SIZE = 32
DEFAULT_PAGESIZE = 4096
DEFAULT_ITER = 64000
def validate_key(key, salt, first, mac_salt):
byteKey = hashlib.pbkdf2_hmac("sha1", key, salt, DEFAULT_ITER, KEY_SIZE)
mac_key = hashlib.pbkdf2_hmac("sha1", byteKey, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, first[:-32], hashlib.sha1)
hash_mac.update(b'\x01\x00\x00\x00')
if hash_mac.digest() == first[-32:-12]:
return True
else:
return False
def get_exe_bit(file_path):
"""
获取 PE 文件的位数: 32 位或 64 位
:param file_path: PE 文件路径(可执行文件)
:return: 如果遇到错误则返回 64
"""
try:
with open(file_path, 'rb') as f:
dos_header = f.read(2)
if dos_header != b'MZ':
print('get exe bit error: Invalid PE file')
return 64
# Seek to the offset of the PE signature
f.seek(60)
pe_offset_bytes = f.read(4)
pe_offset = int.from_bytes(pe_offset_bytes, byteorder='little')
# Seek to the Machine field in the PE header
f.seek(pe_offset + 4)
machine_bytes = f.read(2)
machine = int.from_bytes(machine_bytes, byteorder='little')
if machine == 0x14c:
return 32
elif machine == 0x8664:
return 64
else:
print('get exe bit error: Unknown architecture: %s' % hex(machine))
return 64
except IOError:
print('get exe bit error: File not found or cannot be opened')
return 64
def get_exe_version(file_path):
"""
获取 PE 文件的版本号
:param file_path: PE 文件路径(可执行文件)
:return: 如果遇到错误则返回
"""
file_version = Dispatch("Scripting.FileSystemObject").GetFileVersion(file_path)
return file_version
def find_all(c: bytes, string: bytes, base_addr=0):
"""
查找字符串中所有子串的位置
:param c: 子串 b'123'
:param string: 字符串 b'123456789123'
:return:
"""
return [base_addr + m.start() for m in re.finditer(re.escape(c), string)]
class BiasAddr:
def __init__(self, account, mobile, name, key, db_path):
self.account = account.encode("utf-8")
self.mobile = mobile.encode("utf-8")
self.name = name.encode("utf-8")
self.key = bytes.fromhex(key) if key else b""
self.db_path = db_path if db_path and os.path.exists(db_path) else ""
self.process_name = "WeChat.exe"
self.module_name = "WeChatWin.dll"
self.pm = None # Pymem 对象
self.is_WoW64 = None # True: 32位进程运行在64位系统上 False: 64位进程运行在64位系统上
self.process_handle = None # 进程句柄
self.pid = None # 进程ID
self.version = None # 微信版本号
self.process = None # 进程对象
self.exe_path = None # 微信路径
self.address_len = None # 4 if self.bits == 32 else 8 # 4字节或8字节
self.bits = 64 if sys.maxsize > 2 ** 32 else 32 # 系统32位或64位
def get_process_handle(self):
try:
self.pm = Pymem(self.process_name)
self.pm.check_wow64()
self.is_WoW64 = self.pm.is_WoW64
self.process_handle = self.pm.process_handle
self.pid = self.pm.process_id
self.process = psutil.Process(self.pid)
self.exe_path = self.process.exe()
self.version = get_exe_version(self.exe_path)
version_nums = list(map(int, self.version.split("."))) # 将版本号拆分为数字列表
if version_nums[0] <= 3 and version_nums[1] <= 9 and version_nums[2] <= 2:
self.address_len = 4
else:
self.address_len = 8
return True, ""
except pymem.exception.ProcessNotFound:
return False, "[-] WeChat No Run"
def search_memory_value(self, value: bytes, module_name="WeChatWin.dll"):
# 创建 Pymem 对象
module = pymem.process.module_from_name(self.pm.process_handle, module_name)
ret = self.pm.pattern_scan_module(value, module, return_multiple=True)
ret = ret[-1] - module.lpBaseOfDll if len(ret) > 0 else 0
return ret
def get_key_bias1(self):
try:
byteLen = self.address_len # 4 if self.bits == 32 else 8 # 4字节或8字节
keyLenOffset = 0x8c if self.bits == 32 else 0xd0
keyWindllOffset = 0x90 if self.bits == 32 else 0xd8
module = pymem.process.module_from_name(self.process_handle, self.module_name)
keyBytes = b'-----BEGIN PUBLIC KEY-----\n...'
publicKeyList = pymem.pattern.pattern_scan_all(self.process_handle, keyBytes, return_multiple=True)
keyaddrs = []
for addr in publicKeyList:
keyBytes = addr.to_bytes(byteLen, byteorder="little", signed=True) # 低位在前
may_addrs = pymem.pattern.pattern_scan_module(self.process_handle, module, keyBytes,
return_multiple=True)
if may_addrs != 0 and len(may_addrs) > 0:
for addr in may_addrs:
keyLen = self.pm.read_uchar(addr - keyLenOffset)
if keyLen != 32:
continue
keyaddrs.append(addr - keyWindllOffset)
return keyaddrs[-1] - module.lpBaseOfDll if len(keyaddrs) > 0 else 0
except:
return 0
def search_key(self, key: bytes):
key = re.escape(key) # 转义特殊字符
key_addr = self.pm.pattern_scan_all(key, return_multiple=False)
key = key_addr.to_bytes(self.address_len, byteorder='little', signed=True)
result = self.search_memory_value(key, self.module_name)
return result
def get_key_bias2(self, wx_db_path):
addr_len = get_exe_bit(self.exe_path) // 8
db_path = wx_db_path
def read_key_bytes(h_process, address, address_len=8):
array = ctypes.create_string_buffer(address_len)
if ReadProcessMemory(h_process, void_p(address), array, address_len, 0) == 0: return "None"
address = int.from_bytes(array, byteorder='little') # 逆序转换为int地址key地址
key = ctypes.create_string_buffer(32)
if ReadProcessMemory(h_process, void_p(address), key, 32, 0) == 0: return "None"
key_bytes = bytes(key)
return key_bytes
def verify_key(key, wx_db_path):
KEY_SIZE = 32
DEFAULT_PAGESIZE = 4096
DEFAULT_ITER = 64000
with open(wx_db_path, "rb") as file:
blist = file.read(5000)
salt = blist[:16]
byteKey = hashlib.pbkdf2_hmac("sha1", key, salt, DEFAULT_ITER, KEY_SIZE)
first = blist[16:DEFAULT_PAGESIZE]
mac_salt = bytes([(salt[i] ^ 58) for i in range(16)])
mac_key = hashlib.pbkdf2_hmac("sha1", byteKey, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, first[:-32], hashlib.sha1)
hash_mac.update(b'\x01\x00\x00\x00')
if hash_mac.digest() != first[-32:-12]:
return False
return True
phone_type1 = "iphone\x00"
phone_type2 = "android\x00"
phone_type3 = "ipad\x00"
pm = pymem.Pymem("WeChat.exe")
module_name = "WeChatWin.dll"
MicroMsg_path = os.path.join(db_path, "MSG", "MicroMsg.db")
module = pymem.process.module_from_name(pm.process_handle, module_name)
type1_addrs = pm.pattern_scan_module(phone_type1.encode(), module, return_multiple=True)
type2_addrs = pm.pattern_scan_module(phone_type2.encode(), module, return_multiple=True)
type3_addrs = pm.pattern_scan_module(phone_type3.encode(), module, return_multiple=True)
type_addrs = type1_addrs if len(type1_addrs) >= 2 else type2_addrs if len(
type2_addrs) >= 2 else type3_addrs if len(type3_addrs) >= 2 else "None"
if type_addrs == "None":
return 0
for i in type_addrs[::-1]:
for j in range(i, i - 2000, -addr_len):
key_bytes = read_key_bytes(pm.process_handle, j, addr_len)
if key_bytes == "None":
continue
if verify_key(key_bytes, MicroMsg_path):
return j - module.lpBaseOfDll
return 0
def run(self, logging_path=False, version_list_path=None):
if not self.get_process_handle()[0]:
return {}
mobile_bias = self.search_memory_value(self.mobile, self.module_name)
name_bias = self.search_memory_value(self.name, self.module_name)
account_bias = self.search_memory_value(self.account, self.module_name)
key_bias = 0
key_bias = self.get_key_bias1()
key_bias = self.search_key(self.key) if key_bias <= 0 and self.key else key_bias
key_bias = self.get_key_bias2(self.db_path) if key_bias <= 0 and self.db_path else key_bias
rdata = {self.version: [name_bias, account_bias, mobile_bias, 0, key_bias]}
return rdata
def get_info_without_key(h_process, address, n_size=64):
array = ctypes.create_string_buffer(n_size)
if ReadProcessMemory(h_process, void_p(address), array, n_size, 0) == 0: return "None"
array = bytes(array).split(b"\x00")[0] if b"\x00" in array else bytes(array)
text = array.decode('utf-8', errors='ignore')
return text.strip() if text.strip() != "" else "None"

468
app/decrypt/get_wx_info.py Normal file
View File

@@ -0,0 +1,468 @@
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name: getwxinfo.py
# Description:
# Author: xaoyaoo
# Date: 2023/08/21
# -------------------------------------------------------------------------------
import hmac
import hashlib
import ctypes
import winreg
import pymem
from win32com.client import Dispatch
import psutil
ReadProcessMemory = ctypes.windll.kernel32.ReadProcessMemory
void_p = ctypes.c_void_p
import binascii
import pymem.process
from pymem import Pymem
from win32api import GetFileVersionInfo, HIWORD, LOWORD
"""
class Wechat来源https://github.com/SnowMeteors/GetWeChatKey
"""
class Wechat:
def __init__(self, pm):
module = pymem.process.module_from_name(pm.process_handle, "WeChatWin.dll")
self.pm = pm
self.dllBase = module.lpBaseOfDll
self.sizeOfImage = module.SizeOfImage
self.bits = self.GetPEBits()
# 通过解析PE来获取位数
def GetPEBits(self):
address = self.dllBase + self.pm.read_int(self.dllBase + 60) + 4 + 16
SizeOfOptionalHeader = self.pm.read_short(address)
# 0XF0 64bit
if SizeOfOptionalHeader == 0xF0:
return 64
return 32
def GetInfo(self):
version = self.GetVersion()
if not version:
print("Get WeChatWin.dll Failed")
return
print(f"WeChat Version{version}")
print(f"WeChat Bits: {self.bits}")
keyBytes = b'-----BEGIN PUBLIC KEY-----\n...'
# 从内存中查找 BEGIN PUBLIC KEY 的地址
publicKeyList = pymem.pattern.pattern_scan_all(self.pm.process_handle, keyBytes, return_multiple=True)
if len(publicKeyList) == 0:
print("Failed to find PUBLIC KEY")
return
keyAddr = self.GetKeyAddr(publicKeyList)
if keyAddr is None:
print("Failed to find key")
return
keyLenOffset = 0x8c if self.bits == 32 else 0xd0
for addr in keyAddr:
try:
keyLen = self.pm.read_uchar(addr - keyLenOffset)
if self.bits == 32:
key = self.pm.read_bytes(self.pm.read_int(addr - 0x90), keyLen)
else:
key = self.pm.read_bytes(self.pm.read_longlong(addr - 0xd8), keyLen)
key = binascii.b2a_hex(key).decode()
if self.CheckKey(key):
print(f"key is {key}")
return key
except:
pass
print("Find the end of the key")
@staticmethod
def CheckKey(key):
# 目前key位数是32位
if key is None or len(key) != 64:
return False
return True
# 内存搜索特征码
@staticmethod
def SearchMemory(parent, child):
offset = []
index = -1
while True:
index = parent.find(child, index + 1)
if index == -1:
break
offset.append(index)
return offset
# 获取key的地址
def GetKeyAddr(self, publicKeyList):
# 存放真正的key地址
keyAddr = []
# 读取整个 WeChatWin.dll 的内容
buffer = self.pm.read_bytes(self.dllBase, self.sizeOfImage)
byteLen = 4 if self.bits == 32 else 8
for publicKeyAddr in publicKeyList:
keyBytes = publicKeyAddr.to_bytes(byteLen, byteorder="little", signed=True)
offset = self.SearchMemory(buffer, keyBytes)
if not offset or len(offset) == 0:
continue
offset[:] = [x + self.dllBase for x in offset]
keyAddr += offset
if len(keyAddr) == 0:
return None
return keyAddr
# 获取微信版本
def GetVersion(self):
WeChatWindll_path = ""
for m in list(self.pm.list_modules()):
path = m.filename
if path.endswith("WeChatWin.dll"):
WeChatWindll_path = path
break
if not WeChatWindll_path:
return False
version = GetFileVersionInfo(WeChatWindll_path, "\\")
msv = version['FileVersionMS']
lsv = version['FileVersionLS']
version = f"{str(HIWORD(msv))}.{str(LOWORD(msv))}.{str(HIWORD(lsv))}.{str(LOWORD(lsv))}"
return version
# 获取exe文件的位数
def get_exe_bit(file_path):
"""
获取 PE 文件的位数: 32 位或 64 位
:param file_path: PE 文件路径(可执行文件)
:return: 如果遇到错误则返回 64
"""
try:
with open(file_path, 'rb') as f:
dos_header = f.read(2)
if dos_header != b'MZ':
print('get exe bit error: Invalid PE file')
return 64
# Seek to the offset of the PE signature
f.seek(60)
pe_offset_bytes = f.read(4)
pe_offset = int.from_bytes(pe_offset_bytes, byteorder='little')
# Seek to the Machine field in the PE header
f.seek(pe_offset + 4)
machine_bytes = f.read(2)
machine = int.from_bytes(machine_bytes, byteorder='little')
if machine == 0x14c:
return 32
elif machine == 0x8664:
return 64
else:
print('get exe bit error: Unknown architecture: %s' % hex(machine))
return 64
except IOError:
print('get exe bit error: File not found or cannot be opened')
return 64
# 读取内存中的字符串(非key部分)
def get_info_without_key(h_process, address, n_size=64):
array = ctypes.create_string_buffer(n_size)
if ReadProcessMemory(h_process, void_p(address), array, n_size, 0) == 0: return "None"
array = bytes(array).split(b"\x00")[0] if b"\x00" in array else bytes(array)
text = array.decode('utf-8', errors='ignore')
return text.strip() if text.strip() != "" else "None"
def pattern_scan_all(handle, pattern, *, return_multiple=False, find_num=100):
next_region = 0
found = []
user_space_limit = 0x7FFFFFFF0000 if sys.maxsize > 2 ** 32 else 0x7fff0000
while next_region < user_space_limit:
try:
next_region, page_found = pymem.pattern.scan_pattern_page(
handle,
next_region,
pattern,
return_multiple=return_multiple
)
except Exception as e:
print(e)
break
if not return_multiple and page_found:
return page_found
if page_found:
found += page_found
if len(found) > find_num:
break
return found
def get_info_wxid(h_process):
find_num = 100
addrs = pattern_scan_all(h_process, br'\\Msg\\FTSContact', return_multiple=True, find_num=find_num)
wxids = []
for addr in addrs:
array = ctypes.create_string_buffer(80)
if ReadProcessMemory(h_process, void_p(addr - 30), array, 80, 0) == 0: return "None"
array = bytes(array) # .split(b"\\")[0]
array = array.split(b"\\Msg")[0]
array = array.split(b"\\")[-1]
wxids.append(array.decode('utf-8', errors='ignore'))
wxid = max(wxids, key=wxids.count) if wxids else "None"
return wxid
def get_info_filePath(wxid="all"):
if not wxid:
return "None"
w_dir = "MyDocument:"
is_w_dir = False
try:
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Tencent\WeChat", 0, winreg.KEY_READ)
value, _ = winreg.QueryValueEx(key, "FileSavePath")
winreg.CloseKey(key)
w_dir = value
is_w_dir = True
except Exception as e:
w_dir = "MyDocument:"
if not is_w_dir:
try:
user_profile = os.environ.get("USERPROFILE")
path_3ebffe94 = os.path.join(user_profile, "AppData", "Roaming", "Tencent", "WeChat", "All Users", "config",
"3ebffe94.ini")
with open(path_3ebffe94, "r", encoding="utf-8") as f:
w_dir = f.read()
is_w_dir = True
except Exception as e:
w_dir = "MyDocument:"
if w_dir == "MyDocument:":
try:
# 打开注册表路径
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders")
documents_path = winreg.QueryValueEx(key, "Personal")[0] # 读取文档实际目录路径
winreg.CloseKey(key) # 关闭注册表
documents_paths = os.path.split(documents_path)
if "%" in documents_paths[0]:
w_dir = os.environ.get(documents_paths[0].replace("%", ""))
w_dir = os.path.join(w_dir, os.path.join(*documents_paths[1:]))
# print(1, w_dir)
else:
w_dir = documents_path
except Exception as e:
profile = os.environ.get("USERPROFILE")
w_dir = os.path.join(profile, "Documents")
msg_dir = os.path.join(w_dir, "WeChat Files")
if wxid == "all" and os.path.exists(msg_dir):
return msg_dir
filePath = os.path.join(msg_dir, wxid)
return filePath if os.path.exists(filePath) else "None"
def get_key(db_path, addr_len):
def read_key_bytes(h_process, address, address_len=8):
array = ctypes.create_string_buffer(address_len)
if ReadProcessMemory(h_process, void_p(address), array, address_len, 0) == 0: return "None"
address = int.from_bytes(array, byteorder='little') # 逆序转换为int地址key地址
key = ctypes.create_string_buffer(32)
if ReadProcessMemory(h_process, void_p(address), key, 32, 0) == 0: return "None"
key_bytes = bytes(key)
return key_bytes
def verify_key(key, wx_db_path):
if not wx_db_path or wx_db_path.lower() == "none":
return True
KEY_SIZE = 32
DEFAULT_PAGESIZE = 4096
DEFAULT_ITER = 64000
with open(wx_db_path, "rb") as file:
blist = file.read(5000)
salt = blist[:16]
byteKey = hashlib.pbkdf2_hmac("sha1", key, salt, DEFAULT_ITER, KEY_SIZE)
first = blist[16:DEFAULT_PAGESIZE]
mac_salt = bytes([(salt[i] ^ 58) for i in range(16)])
mac_key = hashlib.pbkdf2_hmac("sha1", byteKey, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, first[:-32], hashlib.sha1)
hash_mac.update(b'\x01\x00\x00\x00')
if hash_mac.digest() != first[-32:-12]:
return False
return True
phone_type1 = "iphone\x00"
phone_type2 = "android\x00"
phone_type3 = "ipad\x00"
pm = pymem.Pymem("WeChat.exe")
module_name = "WeChatWin.dll"
MicroMsg_path = os.path.join(db_path, "MSG", "MicroMsg.db")
type1_addrs = pm.pattern_scan_module(phone_type1.encode(), module_name, return_multiple=True)
type2_addrs = pm.pattern_scan_module(phone_type2.encode(), module_name, return_multiple=True)
type3_addrs = pm.pattern_scan_module(phone_type3.encode(), module_name, return_multiple=True)
type_addrs = type1_addrs if len(type1_addrs) >= 2 else type2_addrs if len(type2_addrs) >= 2 else type3_addrs if len(
type3_addrs) >= 2 else "None"
# print(type_addrs)
if type_addrs == "None":
return "None"
for i in type_addrs[::-1]:
for j in range(i, i - 2000, -addr_len):
key_bytes = read_key_bytes(pm.process_handle, j, addr_len)
if key_bytes == "None":
continue
if db_path != "None" and verify_key(key_bytes, MicroMsg_path):
return key_bytes.hex()
return "None"
# 读取微信信息(account,mobile,name,mail,wxid,key)
def read_info(version_list, is_logging=False):
wechat_process = []
result = []
error = ""
for process in psutil.process_iter(['name', 'exe', 'pid']):
if process.name() == 'WeChat.exe':
wechat_process.append(process)
if len(wechat_process) == 0:
error = "[-] WeChat No Run"
if is_logging: print(error)
return -1
for process in wechat_process:
tmp_rd = {}
tmp_rd['pid'] = process.pid
tmp_rd['version'] = Dispatch("Scripting.FileSystemObject").GetFileVersion(process.exe())
wechat_base_address = 0
for module in process.memory_maps(grouped=False):
if module.path and 'WeChatWin.dll' in module.path:
wechat_base_address = int(module.addr, 16)
break
if wechat_base_address == 0:
error = f"[-] WeChat WeChatWin.dll Not Found"
if is_logging: print(error)
return -1
Handle = ctypes.windll.kernel32.OpenProcess(0x1F0FFF, False, process.pid)
bias_list = version_list.get(tmp_rd['version'], None)
if not isinstance(bias_list, list) or len(bias_list) <= 4:
error = f"[-] WeChat Current Version Is Not Supported(maybe not get account,mobile,name,mail)"
if is_logging: print(error)
tmp_rd['account'] = "None"
tmp_rd['mobile'] = "None"
tmp_rd['name'] = "None"
tmp_rd['mail'] = "None"
return tmp_rd['version']
else:
name_baseaddr = wechat_base_address + bias_list[0]
account__baseaddr = wechat_base_address + bias_list[1]
mobile_baseaddr = wechat_base_address + bias_list[2]
mail_baseaddr = wechat_base_address + bias_list[3]
# key_baseaddr = wechat_base_address + bias_list[4]
tmp_rd['account'] = get_info_without_key(Handle, account__baseaddr, 32) if bias_list[1] != 0 else "None"
tmp_rd['mobile'] = get_info_without_key(Handle, mobile_baseaddr, 64) if bias_list[2] != 0 else "None"
tmp_rd['name'] = get_info_without_key(Handle, name_baseaddr, 64) if bias_list[0] != 0 else "None"
tmp_rd['mail'] = get_info_without_key(Handle, mail_baseaddr, 64) if bias_list[3] != 0 else "None"
addrLen = get_exe_bit(process.exe()) // 8
tmp_rd['wxid'] = get_info_wxid(Handle)
tmp_rd['filePath'] = get_info_filePath(tmp_rd['wxid']) if tmp_rd['wxid'] != "None" else "None"
tmp_rd['key'] = "None"
tmp_rd['key'] = get_key(tmp_rd['filePath'], addrLen)
if tmp_rd['key'] == 'None':
wechat = Pymem("WeChat.exe")
key = Wechat(wechat).GetInfo()
if key:
tmp_rd['key'] = key
result.append(tmp_rd)
if is_logging:
print("=" * 32)
if isinstance(result, str): # 输出报错
print(result)
else: # 输出结果
for i, rlt in enumerate(result):
for k, v in rlt.items():
print(f"[+] {k:>8}: {v}")
print(end="-" * 32 + "\n" if i != len(result) - 1 else "")
print("=" * 32)
return result
import os
import sys
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
return os.path.join(base_path, relative_path)
def get_info(VERSION_LIST):
result = read_info(VERSION_LIST, True) # 读取微信信息
return result
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--vlfile", type=str, help="手机号", required=False)
parser.add_argument("--vldict", type=str, help="微信昵称", required=False)
args = parser.parse_args()
# 读取微信各版本偏移
if args.vlfile:
VERSION_LIST_PATH = args.vlfile
with open(VERSION_LIST_PATH, "r", encoding="utf-8") as f:
VERSION_LIST = json.load(f)
if args.vldict:
VERSION_LIST = json.loads(args.vldict)
if not args.vlfile and not args.vldict:
VERSION_LIST_PATH = "../version_list.json"
with open(VERSION_LIST_PATH, "r", encoding="utf-8") as f:
VERSION_LIST = json.load(f)
result = read_info(VERSION_LIST, True) # 读取微信信息

File diff suppressed because it is too large Load Diff

3
app/log/__init__.py Normal file
View File

@@ -0,0 +1,3 @@
from .logger import log, logger
__all__ = ["logger", "log"]

View File

@@ -0,0 +1,75 @@
import sqlite3
import sys
import traceback
import requests
from app.person import Me
class ExceptionHanding:
def __init__(self, exc_type, exc_value, traceback_):
self.exc_type = exc_type
self.exc_value = exc_value
self.traceback = traceback_
self.error_message = ''.join(traceback.format_exception(exc_type, exc_value, traceback_))
def parser_exc(self):
if isinstance(self.exc_value, PermissionError):
return f'权限错误,请使用管理员身份运行并将文件夹设置为可读写'
elif isinstance(self.exc_value, sqlite3.DatabaseError):
return '数据库错误请删除app文件夹后重启电脑再运行软件'
elif isinstance(self.exc_value, OSError) and self.exc_value.errno == 28:
return '空间磁盘不足,请预留足够多的磁盘空间以供软件正常运行'
elif isinstance(self.exc_value, TypeError) and 'NoneType' in str(self.exc_value) and 'not iterable' in str(
self.exc_value):
return '数据库错误请删除app文件夹后重启电脑再运行软件'
elif isinstance(self.exc_value,KeyboardInterrupt):
return ''
else:
return '未知错误类型,可参考 https://blog.lc044.love/post/7 解决该问题\n温馨提示重启电脑可解决80%的问题'
def __str__(self):
errmsg = f'{self.error_message}\n{self.parser_exc()}'
return errmsg
def excepthook(exc_type, exc_value, traceback_):
# 将异常信息转为字符串
# 在这里处理全局异常
error_message = ExceptionHanding(exc_type, exc_value, traceback_)
txt = '您可添加QQ群发送log文件以便解决该问题'
msg = f"Exception Type: {exc_type.__name__}\nException Value: {exc_value}\ndetails: {error_message}\n\n{txt}"
print(msg)
# 调用原始的 excepthook以便程序正常退出
sys.__excepthook__(exc_type, exc_value, traceback_)
def send_error_msg( 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': '客户端错误'
}

36
app/log/logger.py Normal file
View File

@@ -0,0 +1,36 @@
import logging
import os
import time
import traceback
from functools import wraps
filename = time.strftime("%Y-%m-%d", time.localtime(time.time()))
logger = logging.getLogger('test')
logger.setLevel(level=logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
try:
if not os.path.exists('./app/log/logs'):
os.mkdir('./app/log/logs')
file_handler = logging.FileHandler(f'./app/log/logs/{filename}-log.log')
except:
file_handler = logging.FileHandler(f'{filename}-log.log')
file_handler.setLevel(level=logging.INFO)
file_handler.setFormatter(formatter)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.DEBUG)
stream_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.addHandler(stream_handler)
def log(func):
@wraps(func)
def log_(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
logger.error(
f"\n{func.__qualname__} is error,params:{(args, kwargs)},here are details:\n{traceback.format_exc()}")
return log_

152
app/person.py Normal file
View File

@@ -0,0 +1,152 @@
"""
定义各种联系人
"""
import json
import os.path
import re
from typing import Dict
from PyQt5.QtGui import QPixmap
from app.config import INFO_FILE_PATH
from app.ui.Icon import Icon
def singleton(cls):
_instance = {}
def inner():
if cls not in _instance:
_instance[cls] = cls()
return _instance[cls]
return inner
class Person:
def __init__(self):
self.avatar_path = None
self.avatar = None
self.avatar_path_qt = Icon.Default_avatar_path
self.detail = {}
def set_avatar(self, img_bytes):
if not img_bytes:
self.avatar.load(Icon.Default_avatar_path)
return
if img_bytes[:4] == b'\x89PNG':
self.avatar.loadFromData(img_bytes, format='PNG')
else:
self.avatar.loadFromData(img_bytes, format='jfif')
def save_avatar(self, path=None):
if not self.avatar:
return
if path:
save_path = path
if os.path.exists(save_path):
self.avatar_path = save_path
return save_path
else:
os.makedirs('./data/avatar', exist_ok=True)
save_path = os.path.join(f'data/avatar/', self.wxid + '.png')
self.avatar_path = save_path
if not os.path.exists(save_path):
self.avatar.save(save_path)
print('保存头像', save_path)
@singleton
class Me(Person):
def __init__(self):
super().__init__()
self.avatar = QPixmap(Icon.Default_avatar_path)
self.avatar_path = ':/icons/icons/default_avatar.svg'
self.wxid = 'wxid_00112233'
self.wx_dir = ''
self.name = ''
self.mobile = ''
self.smallHeadImgUrl = ''
self.nickName = self.name
self.remark = self.nickName
self.token = ''
def save_info(self):
if os.path.exists(INFO_FILE_PATH):
with open(INFO_FILE_PATH, 'r', encoding='utf-8') as f:
info_data = json.loads(f.read())
info_data['name'] = self.name
info_data['mobile'] = self.mobile
with open(INFO_FILE_PATH, 'w', encoding='utf-8') as f:
json.dump(info_data, f, ensure_ascii=False, indent=4)
class Contact(Person):
def __init__(self, contact_info: Dict):
super().__init__()
self.wxid = contact_info.get('UserName')
self.remark = contact_info.get('Remark')
# Alias,Type,Remark,NickName,PYInitial,RemarkPYInitial,ContactHeadImgUrl.smallHeadImgUrl,ContactHeadImgUrl,bigHeadImgUrl
self.alias = contact_info.get('Alias')
self.nickName = contact_info.get('NickName')
if not self.remark:
self.remark = self.nickName
self.remark = re.sub(r'[\\/:*?"<>|\s\.]', '_', self.remark)
self.smallHeadImgUrl = contact_info.get('smallHeadImgUrl')
self.smallHeadImgBLOG = b''
self.avatar = QPixmap()
self.avatar_path = Icon.Default_avatar_path
self.is_chatroom = self.wxid.__contains__('@chatroom')
self.detail: Dict = contact_info.get('detail')
self.label_name = contact_info.get('label_name') # 联系人的标签分类
"""
detail存储了联系人的详细信息是个字典
{
'region': tuple[国家,省份,市], # 地区三元组
'signature': str, # 个性签名
'telephone': str, # 电话号码,自己写的备注才会显示
'gender': int, # 性别 0未知12
}
"""
class ContactDefault(Person):
def __init__(self, wxid=""):
super().__init__()
self.avatar = QPixmap(Icon.Default_avatar_path)
self.avatar_path = ':/icons/icons/default_avatar.svg'
self.wxid = wxid
self.remark = wxid
self.alias = wxid
self.nickName = wxid
self.smallHeadImgUrl = ""
self.smallHeadImgBLOG = b''
self.is_chatroom = False
self.detail = {}
class Contacts:
def __init__(self):
self.contacts: Dict[str:Contact] = {}
def add(self, wxid, contact: Contact):
if wxid not in contact:
self.contacts[wxid] = contact
def get(self, wxid: str) -> Contact:
return self.contacts.get(wxid)
def remove(self, wxid: str):
return self.contacts.pop(wxid)
def save_avatar(self, avatar_dir: str = './data/avatar/'):
for wxid, contact in self.contacts.items():
avatar_path = os.path.join(avatar_dir, wxid + '.png')
if os.path.exists(avatar_path):
continue
contact.save_avatar(avatar_path)
if __name__ == '__main__':
p1 = Me()
p2 = Me()
print(p1 == p2)

View File

BIN
app/resources/icons/404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1700491390268" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5035"
width="128" height="128">
<path d="M965.138204 0.016004L964.962163 0H59.373916l-0.176041 0.016004C26.486208 0.12803 0 25.798046 0 57.517481v907.092599a59.373916 59.373916 0 0 0 59.373916 59.373916h905.588247a59.373916 59.373916 0 0 0 59.373916-59.373916V57.517481c0-31.719434-26.486208-57.389451-59.197875-57.501477z"
fill="#CCCCCC" p-id="5036"></path>
<path d="M928.313573 191.932984h-864.202547V928.089521a32.007502 32.007502 0 0 0 32.007502 32.023505h832.195045a32.007502 32.007502 0 0 0 32.007502-32.023505V191.932984h-32.007502z"
fill="#FFFFFF" p-id="5037"></path>
<path d="M736.268563 63.918981l-0.160038 0.016004H96.118528a32.007502 32.007502 0 0 0 0 64.015003h640.150035a32.007502 32.007502 0 0 0 0-64.031007z m96.022505 0a32.007502 32.007502 0 1 0 0.032008 64.047011 32.007502 32.007502 0 0 0-0.032008-64.047011z m96.022505 0a32.007502 32.007502 0 1 0 0.032008 64.047011 32.007502 32.007502 0 0 0-0.032008-64.047011z"
fill="#FFFFFF" p-id="5038"></path>
<path d="M359.188185 568.085145H312.073142v39.225193h-31.111292l74.465453-127.66192h-53.42052l-78.226334 132.783121v38.264968H312.073142v53.67658h47.115043v-53.67658h24.821817v-43.386169h-24.821817v-39.225193z m153.203907-88.53275c-32.119528 0-56.141158 10.210393-72.080894 30.583168-15.95574 20.372775-23.925608 47.611159-23.925608 81.61913 0 34.039978 7.969868 61.262358 23.925608 81.651136 15.939736 20.372775 39.961366 30.567164 72.080894 30.567165s56.141158-10.194389 72.080894-30.567165c15.95574-20.372775 23.925608-47.611159 23.925607-81.651136 0-34.007971-7.969868-61.230351-23.925607-81.61913-15.95574-20.372775-39.97737-30.583168-72.080894-30.583168z m34.200016 164.82263c-7.29771 13.235102-18.708385 19.860655-34.21602 19.860655s-26.918309-6.625553-34.216019-19.860655c-7.313714-13.251106-10.978573-30.727202-10.978573-52.444291s3.664859-39.193186 10.978573-52.460296c7.29771-13.235102 18.708385-19.844651 34.216019-19.844651s26.918309 6.609549 34.21602 19.844651c7.313714 13.267109 10.978573 30.743205 10.978573 52.460296s-3.664859 39.193186-10.978573 52.444291z m228.645588-37.064687v-39.225193h-47.115042v39.225193h-31.111292l74.465453-127.66192h-53.420521l-78.226334 132.783121v38.264968h88.292694v53.67658h47.115042v-53.67658h24.821818v-43.386169h-24.821818z"
fill="#ED7161" p-id="5039"></path>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699701989845" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9279"
width="16" height="16">
<path d="M500.32 59.84a8 8 0 0 1 8 6.4v352a89.6 89.6 0 0 0 89.6 89.6h350.4a8.16 8.16 0 0 1 8.16 8.16v12.8A448 448 0 1 1 487.04 60.32h11.52zM441.44 132.8l-5.92 1.12a380.96 380.96 0 1 0 446.88 448l1.12-6.24H598.24a156.96 156.96 0 0 1-156.8-151.84V132.8z m142.56-66.56l8.64 1.6 6.56 1.28h2.72a448 448 0 0 1 346.08 350.56l2.08 11.36a8.32 8.32 0 0 1-6.72 9.44H620.64a44.96 44.96 0 0 1-44.8-41.6V74.4a8.16 8.16 0 0 1 8.16-8.16z m59.2 89.6a4.48 4.48 0 0 0 0 1.44v212a4.16 4.16 0 0 0 4 4.16h211.84a4.16 4.16 0 0 0 4.16-4.16 4.64 4.64 0 0 0 0-1.44 382.72 382.72 0 0 0-214.4-214.4 4.16 4.16 0 0 0-5.28 2.4z"
p-id="9280"></path>
</svg>

After

Width:  |  Height:  |  Size: 932 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562308255" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14206" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M160 184h512v256H160z" fill="#FFD740" p-id="14207"></path><path d="M672 448H160a8 8 0 0 1-8-8v-256a8 8 0 0 1 8-8h512a8 8 0 0 1 8 8v256a8 8 0 0 1-8 8z m-504-16h496V192h-496v240z" fill="#263238" p-id="14208"></path><path d="M704 944H128c-26.464 0-48-21.536-48-48V144c0-26.464 21.536-48 48-48h576c26.464 0 48 21.536 48 48v752c0 26.464-21.536 48-48 48zM128 112c-17.648 0-32 14.352-32 32v752c0 17.648 14.352 32 32 32h576c17.648 0 32-14.352 32-32V144c0-17.648-14.352-32-32-32H128z" fill="#263238" p-id="14209"></path><path d="M784 1024H192c-26.464 0-48-21.536-48-48v-8a8 8 0 0 1 16 0v8c0 17.648 14.352 32 32 32h592c17.648 0 32-14.352 32-32V224c0-17.648-14.352-32-32-32h-8a8 8 0 0 1 0-16h8c26.464 0 48 21.536 48 48v752c0 26.464-21.536 48-48 48zM848 48h-64a8 8 0 0 1 0-16h64a8 8 0 0 1 0 16z" fill="#263238" p-id="14210"></path><path d="M816 80a8 8 0 0 1-8-8v-64a8 8 0 0 1 16 0v64a8 8 0 0 1-8 8zM936 136h-64a8 8 0 0 1 0-16h64a8 8 0 0 1 0 16z" fill="#263238" p-id="14211"></path><path d="M904 168a8 8 0 0 1-8-8V96a8 8 0 0 1 16 0v64a8 8 0 0 1-8 8zM240 392a8 8 0 0 1-6.304-12.896l112-144a8 8 0 0 1 6.048-3.088 7.472 7.472 0 0 1 6.24 2.688l121.616 136.816 106.096-136.4a8 8 0 1 1 12.624 9.808l-112 144a8 8 0 0 1-12.288 0.4l-121.616-136.816-106.096 136.4A8 8 0 0 1 240 392z" fill="#263238" p-id="14212"></path><path d="M240 384m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="14213"></path><path d="M240 416c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z" fill="#263238" p-id="14214"></path><path d="M480 384m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="14215"></path><path d="M480 416c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z" fill="#263238" p-id="14216"></path><path d="M352 240m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="14217"></path><path d="M352 272c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z" fill="#263238" p-id="14218"></path><path d="M592 240m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="14219"></path><path d="M592 272c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32zM576 864c-57.344 0-104-46.656-104-104S518.656 656 576 656s104 46.656 104 104S633.344 864 576 864z m0-192c-48.528 0-88 39.488-88 88S527.472 848 576 848s88-39.488 88-88S624.528 672 576 672zM608 528H224a8 8 0 0 1 0-16h384a8 8 0 0 1 0 16zM608 608H224a8 8 0 0 1 0-16h384a8 8 0 0 1 0 16z" fill="#263238" p-id="14220"></path><path d="M643.872 827.872l0.032-0.016A96 96 0 0 0 576 664v96l67.872 67.872z" fill="#40C4FF" p-id="14221"></path><path d="M643.888 835.856a8 8 0 0 1-5.664-2.336l-67.872-67.872a7.936 7.936 0 0 1-2.352-5.648v-96a8 8 0 0 1 8-8c57.344 0 104 46.656 104 104a103.328 103.328 0 0 1-30.432 73.52 8 8 0 0 1-5.68 2.336zM584 756.688l59.632 59.632A87.36 87.36 0 0 0 664 760a88.128 88.128 0 0 0-80-87.648v84.336z" fill="#263238" p-id="14222"></path><path d="M576 856a95.68 95.68 0 0 0 67.904-28.144L576 760h-96a96 96 0 0 0 96 96z" fill="#FF5252" p-id="14223"></path><path d="M576 864a104.128 104.128 0 0 1-104-104 8 8 0 0 1 8-8h96c2.112 0 4.16 0.848 5.664 2.336l67.904 67.856a8 8 0 0 1 0 11.328A103.424 103.424 0 0 1 576 864z m-87.648-96c4.048 44.8 41.808 80 87.648 80a87.36 87.36 0 0 0 56.336-20.384L572.688 768h-84.336z" fill="#263238" p-id="14224"></path><path d="M368 688h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="14225"></path><path d="M368 768h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="14226"></path><path d="M368 848h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="14227"></path><path d="M904 944a8 8 0 0 1-8-8v-32a8 8 0 0 1 16 0v32a8 8 0 0 1-8 8z" fill="#263238" p-id="14228"></path><path d="M904 880a8 8 0 0 1-8-8v-288a8 8 0 0 1 16 0v288a8 8 0 0 1-8 8z" fill="#263238" p-id="14229"></path></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699702054249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="11802"
width="16" height="16">
<path d="M919.647 118.99h-812c-11.046 0-20 8.954-20 20v72.793c0 11.045 8.954 20 20 20h50.648V833c0 11.046 8.954 20 20 20h670.703c11.046 0 20-8.954 20-20V231.784h50.648c11.046 0 20-8.955 20-20V138.99c0.001-11.046-8.953-20-19.999-20zM828.999 813H198.296V236.83h630.703V813z m70.648-621.216h-772V158.99h772v32.794z"
fill="" p-id="11803"></path>
<path d="M302.595 450.354c0 0.98 0.143 24.284 12.584 48.336 11.725 22.665 36.626 50.413 88.675 53.889 2.038 0.136 4.103 0.205 6.136 0.205 26.113 0 50.696-11.051 69.221-31.116 17.731-19.206 27.9-45.199 27.9-71.313 0-52.737-28.235-77.924-51.921-89.768-24.697-12.349-49.302-12.491-50.337-12.491-8.284 0-15 6.716-15 15v72.258h-72.258c-8.284 0-15 6.716-15 15z m102.258 15c8.284 0 15-6.716 15-15v-70.377c6.425 1.328 14.214 3.589 21.921 7.443 23.448 11.724 35.337 32.898 35.337 62.935 0 39.261-30.738 72.43-67.122 72.43-1.369 0-2.761-0.047-4.137-0.139-30.175-2.015-51.556-14.405-63.548-36.826-3.857-7.212-6.183-14.436-7.585-20.465h70.134z"
fill="" p-id="11804"></path>
<path d="M371.63 418.105V291.102s-39.842-5.032-88.183 39.508c-51.748 47.679-38.82 87.495-38.82 87.495H371.63zM575.922 327.976h198.527c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5H575.922c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5zM575.922 390.76h198.527c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5H575.922c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5zM620.038 520.799l44.902 34.716c7.245 5.602 17.579 4.671 23.706-2.131l63.284-70.245 14.989 14.484a9.142 9.142 0 0 0 12.926-0.221l9.379-65.614c1.119-6.864-0.319-8.253-1.262-9.164-3.166-3.059-4.193-4.052-10.544-2.244L712.165 432a9.142 9.142 0 0 0 0.221 12.926l14.36 13.877-53.24 59.095-43.373-33.534a17.503 17.503 0 0 0-22.138 0.596l-107.33 92.622c-7.317 6.314-8.13 17.365-1.816 24.683a17.457 17.457 0 0 0 13.257 6.066c4.05 0 8.119-1.398 11.426-4.251l96.506-83.281zM461.45 667.977H262.922c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5H461.45c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5zM461.45 736.76H262.922c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5H461.45c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5zM772.722 736.76v-33.941c0-9.665-7.835-17.5-17.5-17.5s-17.5 7.835-17.5 17.5v33.941h-14.993v-85.383c0-9.665-7.835-17.5-17.5-17.5s-17.5 7.835-17.5 17.5v85.383h-14.993v-59.383c0-9.665-7.835-17.5-17.5-17.5s-17.5 7.835-17.5 17.5v59.383h-14.993V607.332c0-9.665-7.835-17.5-17.5-17.5s-17.5 7.835-17.5 17.5V736.76H572.75v-46.907c0-9.665-7.835-17.5-17.5-17.5s-17.5 7.835-17.5 17.5v46.907h-4.794c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5h247.851c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5h-8.085zM328.595 877.5h-58.522c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5h58.522c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5zM417.674 877.5h-31.341c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5h31.341c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5zM753.675 877.5H480.077c-9.665 0-17.5 7.835-17.5 17.5s7.835 17.5 17.5 17.5h273.598c9.665 0 17.5-7.835 17.5-17.5s-7.835-17.5-17.5-17.5z"
fill="" p-id="11805"></path>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699702047342" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="11637" width="16" height="16">
<path d="M160 184h512v256H160z" fill="#FFD740" p-id="11638"></path>
<path d="M672 448H160a8 8 0 0 1-8-8v-256a8 8 0 0 1 8-8h512a8 8 0 0 1 8 8v256a8 8 0 0 1-8 8z m-504-16h496V192h-496v240z"
fill="#263238" p-id="11639"></path>
<path d="M704 944H128c-26.464 0-48-21.536-48-48V144c0-26.464 21.536-48 48-48h576c26.464 0 48 21.536 48 48v752c0 26.464-21.536 48-48 48zM128 112c-17.648 0-32 14.352-32 32v752c0 17.648 14.352 32 32 32h576c17.648 0 32-14.352 32-32V144c0-17.648-14.352-32-32-32H128z"
fill="#263238" p-id="11640"></path>
<path d="M784 1024H192c-26.464 0-48-21.536-48-48v-8a8 8 0 0 1 16 0v8c0 17.648 14.352 32 32 32h592c17.648 0 32-14.352 32-32V224c0-17.648-14.352-32-32-32h-8a8 8 0 0 1 0-16h8c26.464 0 48 21.536 48 48v752c0 26.464-21.536 48-48 48zM848 48h-64a8 8 0 0 1 0-16h64a8 8 0 0 1 0 16z"
fill="#263238" p-id="11641"></path>
<path d="M816 80a8 8 0 0 1-8-8v-64a8 8 0 0 1 16 0v64a8 8 0 0 1-8 8zM936 136h-64a8 8 0 0 1 0-16h64a8 8 0 0 1 0 16z"
fill="#263238" p-id="11642"></path>
<path d="M904 168a8 8 0 0 1-8-8V96a8 8 0 0 1 16 0v64a8 8 0 0 1-8 8zM240 392a8 8 0 0 1-6.304-12.896l112-144a8 8 0 0 1 6.048-3.088 7.472 7.472 0 0 1 6.24 2.688l121.616 136.816 106.096-136.4a8 8 0 1 1 12.624 9.808l-112 144a8 8 0 0 1-12.288 0.4l-121.616-136.816-106.096 136.4A8 8 0 0 1 240 392z"
fill="#263238" p-id="11643"></path>
<path d="M240 384m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="11644"></path>
<path d="M240 416c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z"
fill="#263238" p-id="11645"></path>
<path d="M480 384m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="11646"></path>
<path d="M480 416c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z"
fill="#263238" p-id="11647"></path>
<path d="M352 240m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="11648"></path>
<path d="M352 272c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32z"
fill="#263238" p-id="11649"></path>
<path d="M592 240m-24 0a24 24 0 1 0 48 0 24 24 0 1 0-48 0Z" fill="#FFFFFF" p-id="11650"></path>
<path d="M592 272c-17.648 0-32-14.352-32-32s14.352-32 32-32 32 14.352 32 32-14.352 32-32 32z m0-48a16.016 16.016 0 0 0 0 32 16.016 16.016 0 0 0 0-32zM576 864c-57.344 0-104-46.656-104-104S518.656 656 576 656s104 46.656 104 104S633.344 864 576 864z m0-192c-48.528 0-88 39.488-88 88S527.472 848 576 848s88-39.488 88-88S624.528 672 576 672zM608 528H224a8 8 0 0 1 0-16h384a8 8 0 0 1 0 16zM608 608H224a8 8 0 0 1 0-16h384a8 8 0 0 1 0 16z"
fill="#263238" p-id="11651"></path>
<path d="M643.872 827.872l0.032-0.016A96 96 0 0 0 576 664v96l67.872 67.872z" fill="#40C4FF" p-id="11652"></path>
<path d="M643.888 835.856a8 8 0 0 1-5.664-2.336l-67.872-67.872a7.936 7.936 0 0 1-2.352-5.648v-96a8 8 0 0 1 8-8c57.344 0 104 46.656 104 104a103.328 103.328 0 0 1-30.432 73.52 8 8 0 0 1-5.68 2.336zM584 756.688l59.632 59.632A87.36 87.36 0 0 0 664 760a88.128 88.128 0 0 0-80-87.648v84.336z"
fill="#263238" p-id="11653"></path>
<path d="M576 856a95.68 95.68 0 0 0 67.904-28.144L576 760h-96a96 96 0 0 0 96 96z" fill="#FF5252"
p-id="11654"></path>
<path d="M576 864a104.128 104.128 0 0 1-104-104 8 8 0 0 1 8-8h96c2.112 0 4.16 0.848 5.664 2.336l67.904 67.856a8 8 0 0 1 0 11.328A103.424 103.424 0 0 1 576 864z m-87.648-96c4.048 44.8 41.808 80 87.648 80a87.36 87.36 0 0 0 56.336-20.384L572.688 768h-84.336z"
fill="#263238" p-id="11655"></path>
<path d="M368 688h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="11656"></path>
<path d="M368 768h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="11657"></path>
<path d="M368 848h-128a8 8 0 0 1 0-16h128a8 8 0 0 1 0 16z" fill="#263238" p-id="11658"></path>
<path d="M904 944a8 8 0 0 1-8-8v-32a8 8 0 0 1 16 0v32a8 8 0 0 1-8 8z" fill="#263238" p-id="11659"></path>
<path d="M904 880a8 8 0 0 1-8-8v-288a8 8 0 0 1 16 0v288a8 8 0 0 1-8 8z" fill="#263238" p-id="11660"></path>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704887643791" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6156" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M803.342997 87.013896a47.908827 47.908827 0 0 0 0-70.993102A61.421574 61.421574 0 0 0 723.904429 13.256823l-3.173448 2.763971L241.23323 470.949915l-2.405678 1.842647c-1.637909 1.228431-3.173448 2.559232-4.606618 3.941218-20.013196 18.938319-20.985704 48.113566-2.86634 68.075577l2.815155 2.917525 484.820954 459.945216c22.521244 21.343997 60.090773 21.343997 82.612016 0 20.013196-18.938319 20.985704-48.113566 2.86634-68.075577l-2.86634-2.968709-446.893132-423.911227L803.342997 87.013896z" fill="#303133" p-id="6157"></path></svg>

After

Width:  |  Height:  |  Size: 863 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704887684029" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7130" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M240.871694 97.117314a56.39844 56.39844 0 0 1 0-80.461775 58.110393 58.110393 0 0 1 81.469746 0l460.787257 455.107414a56.39844 56.39844 0 0 1 0 80.445775L322.34144 1007.332141a58.110393 58.110393 0 0 1-81.469746 0 56.39844 56.39844 0 0 1 0-80.461775L660.956076 511.98584 240.871694 97.117314z" fill="#111111" p-id="7131"></path></svg>

After

Width:  |  Height:  |  Size: 665 B

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699273771059" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="12579"
width="16" height="16">
<path d="M700.371228 394.525472 174.028569 394.525472l255.952416-227.506551c12.389168-11.011798 13.505595-29.980825 2.492774-42.369993-11.011798-12.386098-29.977755-13.506619-42.367947-2.492774L76.425623 400.975371c-6.960529 5.496178-11.434423 14.003945-11.434423 23.561625 0 0.013303 0.001023 0.026606 0.001023 0.039909 0 0.01228-0.001023 0.025583-0.001023 0.037862 0 0.473791 0.01535 0.946558 0.037862 1.418302 0.001023 0.016373 0.001023 0.032746 0.001023 0.049119 0.39295 8.030907 3.992941 15.595186 10.034541 20.962427l315.040163 280.028764c5.717212 5.083785 12.83533 7.580652 19.925818 7.580652 8.274454 0 16.514115-3.403516 22.442128-10.07445 11.011798-12.387122 9.896394-31.357172-2.492774-42.367947l-256.128425-227.665163 526.518668 0c109.219517 0 198.075241 88.855724 198.075241 198.075241s-88.855724 198.075241-198.075241 198.075241L354.324888 850.696955c-16.57449 0-30.011524 13.437034-30.011524 30.011524s13.437034 30.011524 30.011524 30.011524l346.046341 0c142.31631 0 258.098289-115.783003 258.098289-258.098289S842.686515 394.525472 700.371228 394.525472z"
fill="#272636" p-id="12580"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562131578" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6431" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M624.5 534.5m-325.5 0a325.5 325.5 0 1 0 651 0 325.5 325.5 0 1 0-651 0Z" fill="#C1E6DE" p-id="6432"></path><path d="M159.534 684.536c46.494-44.727 85.552-62.297 123.134-46.118 16.58 7.137 34.97 12.832 55.177 17.058a39.27 39.27 0 0 1 30.333 30.086c20.969 96.321 92.259 142.26 223.295 142.26 51.56 0 94.224-7.407 127.845-21.876 32.295-13.897 64.764-1.552 102.148 31.796v-220.63c0-94.239-30.647-152.84-90.93-183.574a39.273 39.273 0 0 1-21.42-33.974C704.862 235.03 616.634 159.545 434.403 159.545c-186.515 0-274.87 79.078-274.87 252.468v272.523z m92.085 26.028c2.48 1.067 0.207 1.546-7.93 6.597-14.267 8.859-32.893 25.731-55.043 50.436a61.702 61.702 0 0 1-45.94 20.514C108.625 788.111 81 760.481 81 726.397V412.013C81 193.18 206.34 81 434.404 81c214.652 0 338.605 99.388 352.16 294.146C861.73 422.736 900 504.862 900 617.113v269.384C900 918.81 873.806 945 841.5 945a58.5 58.5 0 0 1-43.55-19.441c-18.66-20.807-34.259-34.932-45.962-42.196-2.558-1.588-4.655-2.678-6.209-3.344-43.357 17.76-94.866 26.35-154.306 26.35-154.92 0-257.22-59.794-293.718-179.782-16.21-4.427-31.593-9.763-46.136-16.023z m70.156 21.795c-21.228-4.438-34.84-25.247-30.401-46.478 4.437-21.23 25.243-34.844 46.471-30.405 28.64 5.988 60.848 9.005 96.56 9.005 186.514 0 274.869-79.078 274.869-252.468 0-4.205-0.053-8.355-0.159-12.449-0.56-21.682 16.56-39.714 38.24-40.274 21.679-0.56 39.708 16.562 40.268 38.244 0.124 4.775 0.185 9.6 0.185 14.479 0 218.833-125.34 331.013-353.404 331.013-40.883 0-78.435-3.517-112.63-10.667z" fill="#0A0B0C" p-id="6433"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699701643250" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4091"
width="16" height="16">
<path d="M767.424 130.032 256.576 130.032c-70.4 0-128 57.6-128 128l0 335.632c0 70.4 57.6 128 128 128l118.352 0 0 172.288 213.328-172.288 179.152 0c70.4 0 128-57.6 128-128L895.408 258.032C895.424 187.632 837.824 130.032 767.424 130.032zM815.424 593.664c0 26.016-21.984 48-48 48L588.272 641.664 560 641.664l-22 17.76-83.056 67.088 0-4.848 0-80-80 0-118.352 0c-26.016 0-48-21.984-48-48L208.592 258.032c0-26.016 21.984-48 48-48l510.848 0c26.016 0 48 21.984 48 48L815.44 593.664z"
p-id="4092"></path>
<path d="M347.888 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="4093"></path>
<path d="M512 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="4094"></path>
<path d="M676.096 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="4095"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712632579720" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4260" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-0.3 1.5-0.4 3-0.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-0.1 4.4-0.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390z m468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z" p-id="4261" fill="#13227a"></path></svg>

After

Width:  |  Height:  |  Size: 842 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704807621521" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11539" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M0 30.72h960v960H0z" fill="#000000" fill-opacity="0" p-id="11540"></path><path d="M274.28864 716.43136c27.42272-13.71136 47.99488-58.28608 65.13664-65.13664 10.2912-3.4304 51.43552-24.00256 27.43296-85.7088-54.85568-54.86592-92.5696-106.2912-92.5696-226.304h411.42272c0 116.5824-37.71392 171.43808-92.5696 226.304-24.00256 68.56704 13.7216 85.7088 20.57216 85.7088 24.00256 6.8608 82.28864 54.85568 106.2912 65.13664 3.42016 0-133.72416 37.71392-240.00512 34.29376-68.56704 0-137.14432-13.7216-205.7216-34.29376z" fill="#FFE58F" p-id="11541"></path><path d="M480 37.5808c-65.14688 0-202.28096 47.99488-219.43296 164.56704h442.28608C682.2912 92.43648 545.14688 37.5808 480 37.5808z m226.28352 198.8608s-3.4304 0 0 0H253.71648c-10.2912 10.28096-37.71392 17.13152-48.00512 68.56704h548.57728c-17.14176-51.43552-41.14432-58.28608-48.00512-68.57728z" fill="#FAAD14" p-id="11542"></path><path d="M702.85312 236.4416s3.4304 0 0 0v-10.2912c0-6.8608 0-17.14176-3.42016-24.00256H260.56704c0 6.8608-3.42016 17.14176-3.42016 24.00256 0 3.4304-3.4304 6.8608-3.4304 10.28096h449.13664z" fill="#D46B08" p-id="11543"></path><path d="M850.28864 843.29472l-17.14176-34.29376c-24.00256-51.42528-65.14688-85.7088-113.152-109.71136-20.56192-10.28096-44.56448-17.14176-68.56704-20.57216-20.57216-3.4304-37.71392-3.4304-58.28608 0-37.71392 3.4304-71.99744 6.8608-106.2912 6.8608-37.70368 0-75.4176-3.4304-116.56192-6.8608-20.5824-3.4304-41.14432 0-58.28608 0-24.00256 3.4304-48.00512 10.2912-68.57728 20.5824-47.99488 23.99232-89.1392 58.27584-113.14176 109.70112l-17.14176 34.29376c-10.28096 13.71136-13.7216 27.42272-13.7216 44.56448 0 58.28608 44.58496 102.8608 102.8608 102.8608h555.43808c17.14176 0 30.85312-3.4304 44.56448-10.28096 54.85568-27.43296 75.42784-89.14944 48.00512-137.14432z" fill="#FFC53D" p-id="11544"></path><path d="M651.42784 678.71744v106.2912c0 37.71392-30.85312 68.56704-68.56704 68.56704H377.1392c-37.71392 0-68.56704-30.85312-68.56704-68.56704V675.28704c-24.00256 3.4304-48.00512 10.2912-68.57728 20.5824V990.72h480.01024V695.8592c-20.5824-6.8608-44.57472-13.71136-68.57728-17.14176z" fill="#FAAD14" p-id="11545"></path></svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1698328334260" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4724"
width="200" height="200">
<path d="M332.799002 686.081014m-332.799002 0a332.799002 332.799002 0 1 0 665.598003 0 332.799002 332.799002 0 1 0-665.598003 0Z"
fill="#F4EFC9" p-id="4725"></path>
<path d="M883.19735 1024h-639.99808A141.055577 141.055577 0 0 1 102.399693 883.200422v-742.397772A141.055577 141.055577 0 0 1 243.19927 0.003072h516.350451a89.087733 89.087733 0 0 1 63.231811 25.599923l189.695431 189.695431A38.399885 38.399885 0 0 1 1023.996928 243.202342v639.99808a141.055577 141.055577 0 0 1-140.799578 140.799578zM243.19927 76.802842A63.999808 63.999808 0 0 0 179.199462 140.80265v742.397772A63.999808 63.999808 0 0 0 243.19927 947.20023h639.99808a63.999808 63.999808 0 0 0 63.999808-63.999808V259.074295l-179.199462-179.199463a12.799962 12.799962 0 0 0-8.447975-3.07199z"
fill="#434260" p-id="4726"></path>
<path d="M292.095124 512.001536c0-73.727779 44.799866-118.015646 102.399693-118.015646a87.039739 87.039739 0 0 1 64.255807 28.671914l-19.455942 22.783932a60.15982 60.15982 0 0 0-44.287867-20.22394c-38.911883 0-66.047802 32.511902-66.047802 85.759743s25.599923 86.52774 65.023805 86.52774a65.791803 65.791803 0 0 0 51.199846-24.063927l18.943944 22.527932a89.087733 89.087733 0 0 1-70.399789 32.511903c-58.111826 0.767998-101.631695-41.727875-101.631695-116.479651zM478.206565 595.969284l20.991937-25.599923a87.551737 87.551737 0 0 0 60.15982 25.599923c27.391918 0 42.751872-12.799962 42.751872-31.999904s-15.359954-27.135919-36.351891-36.351891l-31.231907-13.567959a65.023805 65.023805 0 0 1-46.079861-59.135823A67.071799 67.071799 0 0 1 563.19831 394.753888a96.76771 96.76771 0 0 1 68.351795 28.671914l-18.687944 22.783931a72.191783 72.191783 0 0 0-49.663851-20.223939c-23.039931 0-38.143886 11.007967-38.143885 29.183912s18.175945 25.599923 36.60789 34.047898l30.975907 13.31196A63.23181 63.23181 0 0 1 638.206085 563.201382c0 36.351891-29.95191 65.791803-79.615761 65.791803a112.639662 112.639662 0 0 1-80.383759-33.023901zM650.750048 399.105875h37.887886l33.535899 116.991649c7.679977 25.599923 12.543962 47.871856 20.479939 73.983778h1.535995c7.679977-25.599923 13.31196-48.127856 20.479939-73.983778l33.535899-116.991649h36.351891l-70.655788 226.047322h-42.239873z"
fill="#434260" p-id="4727"></path>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702563339699" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28057" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M512.4096 509.696m-432.3328 0a432.3328 432.3328 0 1 0 864.6656 0 432.3328 432.3328 0 1 0-864.6656 0Z" fill="#B688FF" p-id="28058"></path><path d="M287.4368 415.5904c-85.0432 0-160.4096 41.3696-207.104 105.0624 4.5568 182.7328 122.368 337.3056 285.952 396.032 103.2192-33.28 177.92-130.048 177.92-244.3776 0-141.7728-114.944-256.7168-256.768-256.7168z" fill="#C3A4FF" p-id="28059"></path><path d="M639.8976 358.7584c21.504 0 36.4032-21.7088 28.3648-41.6768-16.5888-41.216-56.9856-70.4-104.0384-70.4H460.544c-61.9008 0-112.0768 50.176-112.0768 112.0768v64.0512h61.44V358.7584c0-27.9552 22.6816-50.6368 50.6368-50.6368h103.68c20.9408 0 38.9632 12.8 46.6432 30.976 4.9664 11.6736 15.8208 19.712 28.5184 19.712h0.512z" fill="#D7C7FF" p-id="28060"></path><path d="M670.0032 395.2128H354.7648c-48.9472 0-88.6272 39.68-88.6272 88.6272v186.0608c0 48.9472 39.68 88.6272 88.6272 88.6272h315.2384c48.9472 0 88.6272-39.68 88.6272-88.6272V483.84c0-48.9472-39.68-88.6272-88.6272-88.6272z m-130.1504 188.2112v64.512a27.4432 27.4432 0 0 1-54.8864 0v-64.512a55.31648 55.31648 0 0 1-27.9552-48.0768c0-30.6176 24.7808-55.3984 55.3984-55.3984s55.3984 24.7808 55.3984 55.3984c0 20.6336-11.264 38.5536-27.9552 48.0768z" fill="#FFFFFF" p-id="28061"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,134 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg height="64" node-id="1" sillyvg="true" template-height="64" template-width="64" version="1.1"
viewBox="0 0 1024 1024" width="64" xmlns="http://www.w3.org/2000/svg">
<defs node-id="53">
<linearGradient gradientUnits="objectBoundingBox" id="linearGradient-3" node-id="6" spreadMethod="pad" x1="0"
x2="0.5" y1="-0.11715827" y2="0.75683814">
<stop offset="0" stop-color="#d08787"></stop>
<stop offset="1" stop-color="#a34f4f"></stop>
</linearGradient>
</defs>
<g node-id="90">
<path d="M 664.65 903.49 L 678.50 910.89 L 690.64 918.02 L 701.23 924.89 L 710.39 931.49 L 718.26 937.84 L 724.95 943.95 L 730.58 949.84 L 735.26 955.52 L 739.06 961.02 L 742.09 966.35 L 749.88 982.25 L 756.95 997.59 L 763.31 1012.40 L 769.00 1026.70 L 186.18 1024.93 L 191.95 1008.02 L 197.69 992.69 L 203.40 978.83 L 209.07 966.35 L 211.83 960.38 L 215.15 954.60 L 219.06 948.99 L 223.59 943.53 L 228.77 938.21 L 234.66 933.04 L 241.31 928.00 L 248.77 923.10 L 257.12 918.36 L 266.42 913.77 L 276.74 909.36 L 288.18 905.14 L 305.23 902.23 L 320.30 900.19 L 333.55 898.92 L 345.15 898.33 L 355.26 898.33 L 364.03 898.85 L 371.60 899.80 L 378.33 901.18 L 385.40 903.18 L 392.84 905.85 L 400.68 909.25 L 408.97 913.43 L 417.73 918.48 L 426.99 924.46 L 436.80 931.44 L 454.78 922.87 L 471.54 915.47 L 487.14 909.14 L 501.66 903.82 L 515.15 899.43 L 527.69 895.90 L 539.33 893.16 L 550.13 891.14 L 560.16 889.80 L 574.26 889.15 L 587.66 889.11 L 600.39 889.63 L 612.48 890.71 L 623.98 892.30 L 634.92 894.39 L 645.32 896.96 L 655.22 899.99 L 664.65 903.49 Z"
fill="#4d80cf" fill-rule="evenodd" group-id="1" id="蒙版" node-id="11" stroke="none"
target-height="137.59656" target-width="582.81976" target-x="186.18182" target-y="889.1063"></path>
<path d="M 579.84 996.41 L 579.84 1026.13 L 370.12 1025.49 L 370.12 996.41 L 405.64 998.66 L 434.00 1000.11 L 456.25 1000.88 L 473.32 1001.13 L 474.03 1001.13 L 491.09 1000.90 L 513.68 1000.14 L 542.87 998.69 L 579.84 996.41 L 579.84 996.41 Z"
fill="#7facf1" fill-rule="evenodd" group-id="1" id="形状结合" node-id="12" stroke="none"
target-height="29.71997" target-width="209.71558" target-x="370.12415" target-y="996.407"></path>
<path d="M 702.12 925.50 L 702.15 925.77 L 704.57 946.05 L 706.21 963.66 L 707.18 978.85 L 707.55 991.86 L 707.41 1002.92 L 706.86 1012.25 L 705.95 1020.05 L 704.75 1026.51 L 663.92 1026.38 L 697.04 922.09 L 702.12 925.50 Z M 254.45 919.80 L 287.93 1025.24 L 247.16 1025.12 L 246.04 1018.42 L 245.20 1010.36 L 244.74 1000.75 L 244.70 989.40 L 245.18 976.08 L 246.25 960.57 L 248.01 942.64 L 250.56 922.03 L 254.45 919.80 Z"
fill="#3c6db8" fill-rule="evenodd" group-id="1" id="形状结合" node-id="13" stroke="none"
target-height="106.70648" target-width="462.84723" target-x="244.69966" target-y="919.80096"></path>
<path d="M 695.53 918.30 L 697.95 945.08 L 699.44 967.20 L 700.14 985.24 L 700.21 999.74 L 699.77 1011.22 L 698.93 1020.13 L 697.80 1026.89 L 696.48 1031.91 L 617.02 1031.96 L 617.02 898.80 L 618.40 896.82 L 620.18 895.19 L 622.40 893.89 L 625.16 892.92 L 628.58 892.34 L 632.78 892.22 L 637.93 892.66 L 642.61 893.59 L 648.78 895.46 L 656.78 898.55 L 666.96 903.16 L 679.73 909.62 L 695.53 918.30 Z M 256.68 918.30 L 254.27 945.08 L 252.78 967.20 L 252.07 985.24 L 252.00 999.74 L 252.45 1011.22 L 253.29 1020.13 L 254.41 1026.89 L 255.73 1031.91 L 335.19 1031.96 L 335.19 898.80 L 333.81 896.82 L 332.04 895.19 L 329.81 893.89 L 327.05 892.92 L 323.64 892.34 L 319.43 892.22 L 314.28 892.66 L 309.60 893.59 L 303.43 895.46 L 295.44 898.55 L 285.25 903.16 L 272.48 909.62 L 256.68 918.30 Z"
fill="#90623d" fill-rule="evenodd" group-id="1" id="形状结合" node-id="14" stroke="none"
target-height="139.7398" target-width="448.20587" target-x="252.00452" target-y="892.2155"></path>
<path d="M 625.87 900.54 L 626.11 916.18 L 626.37 937.63 L 626.47 962.41 L 626.27 988.04 L 626.00 1000.57 L 625.59 1012.04 L 625.00 1022.98 L 624.27 1031.94 L 617.02 1031.96 L 617.02 898.80 L 618.25 897.00 L 619.79 895.49 L 621.68 894.24 L 623.98 893.27 L 624.91 896.49 L 625.87 900.54 Z M 326.34 900.54 L 326.10 916.18 L 325.85 937.63 L 325.74 962.41 L 325.94 988.04 L 326.22 1000.57 L 326.62 1012.04 L 327.21 1022.98 L 327.94 1031.94 L 335.19 1031.96 L 335.19 898.80 L 333.97 897.00 L 332.43 895.49 L 330.53 894.24 L 328.23 893.27 L 327.31 896.49 L 326.34 900.54 Z"
fill="#604630" fill-rule="evenodd" group-id="1" id="形状结合" node-id="15" stroke="none"
target-height="138.68903" target-width="300.73462" target-x="325.7401" target-y="893.2663"></path>
</g>
<path d="M 523.03 871.40 C 511.28 892.05 492.75 910.25 467.41 926.00 C 435.36 901.73 420.84 881.40 423.86 865.02 C 418.79 856.74 418.79 839.65 423.86 813.76 C 390.08 822.23 363.98 830.64 345.57 838.98 C 317.94 851.49 270.34 881.75 296.88 907.65 C 301.30 911.44 308.91 906.59 315.73 906.32 C 329.12 905.04 339.04 906.32 344.08 908.22 C 383.27 920.97 417.14 938.81 459.00 977.36 C 466.17 983.30 473.98 983.30 482.44 977.36 C 526.40 931.68 573.24 906.06 622.99 900.50 C 629.88 899.71 641.99 900.66 654.98 902.25 C 663.53 905.06 665.21 906.78 668.95 902.25 C 686.06 875.99 626.80 835.96 578.39 828.50 C 546.12 823.53 514.55 818.43 483.69 813.22 C 512.62 832.27 525.73 851.66 523.03 871.40 Z"
fill="#5a8cd9" fill-rule="evenodd" id="蒙版" node-id="16" stroke="none" target-height="170.07861"
target-width="415.71912" target-x="270.3369" target-y="813.2206"></path>
<path d="M 303.97 900.40 L 305.72 900.29 C 312.73 899.73 323.17 901.81 337.04 906.53 C 332.28 905.82 326.03 905.55 318.58 906.08 L 315.73 906.32 C 314.37 906.37 312.97 906.61 311.58 906.92 L 306.07 908.35 C 302.50 909.24 299.24 909.67 296.88 907.65 C 292.24 903.13 289.86 898.46 289.25 893.79 C 291.68 898.45 296.59 900.65 303.97 900.40 Z M 670.10 883.45 C 672.78 890.05 672.71 896.48 668.95 902.25 C 666.53 905.18 664.97 905.50 661.86 904.59 L 659.99 903.99 L 659.99 903.99 L 656.42 902.73 C 655.96 902.57 655.48 902.41 654.98 902.25 L 649.48 901.61 C 648.58 901.51 647.68 901.42 646.79 901.33 L 641.60 900.84 C 640.75 900.77 639.92 900.71 639.11 900.65 L 634.38 900.36 C 629.85 900.14 625.94 900.16 622.99 900.50 C 614.49 901.44 606.08 902.98 597.76 905.10 C 622.98 896.01 641.40 892.74 653.03 895.28 L 654.58 895.66 C 661.49 897.59 666.47 894.14 669.51 885.29 L 670.10 883.45 Z"
fill="#5a8cd9" fill-opacity="0.5" fill-rule="evenodd" group-id="2" id="形状" node-id="17" stroke="none"
target-height="26.223694" target-width="383.52795" target-x="289.25232" target-y="883.4491"></path>
<path d="M 523.01 916.13 C 523.01 918.25 521.00 919.97 518.53 919.97 C 516.06 919.97 514.05 918.25 514.05 916.13 C 514.05 914.01 516.06 912.29 518.53 912.29 C 521.00 912.29 523.01 914.01 523.01 916.13 Z"
fill="#2a3547" fill-rule="evenodd" id="椭圆形" node-id="18" stroke="none" target-height="7.6762085"
target-width="8.955566" target-x="514.05194" target-y="912.2909"></path>
<path d="M 515.61 915.33 L 515.61 1010.94 L 521.88 1010.94 L 521.88 915.33 C 521.88 914.36 520.83 913.87 518.75 913.87 C 516.66 913.87 515.61 914.36 515.61 915.33 Z"
fill="#2b4d82" fill-rule="evenodd" id="路径-41" node-id="19" stroke="none" target-height="97.07422"
target-width="6.265808" target-x="515.61304" target-y="913.8698"></path>
<path d="M 517.38 1006.75 L 520.06 1006.75 L 520.06 1022.10 L 517.38 1022.10 Z" fill="#2a3547" fill-rule="evenodd"
id="矩形" node-id="20" stroke="none" target-height="15.352417" target-width="2.6866455" target-x="517.3775"
target-y="1006.74524"></path>
<path d="M 525.43 1007.44 C 525.43 1011.68 522.43 1015.12 518.72 1015.12 C 515.01 1015.12 512.00 1011.68 512.00 1007.44 C 512.00 1003.20 515.01 999.76 518.72 999.76 C 522.43 999.76 525.43 1003.20 525.43 1007.44 Z"
fill="#2b4d82" fill-rule="evenodd" id="椭圆形" node-id="21" stroke="none" target-height="15.352417"
target-width="13.43335" target-x="512" target-y="999.76337"></path>
<path d="M 420.61 916.13 C 420.61 918.25 418.60 919.97 416.13 919.97 C 413.66 919.97 411.65 918.25 411.65 916.13 C 411.65 914.01 413.66 912.29 416.13 912.29 C 418.60 912.29 420.61 914.01 420.61 916.13 Z"
fill="#2a3547" fill-rule="evenodd" id="椭圆形" node-id="22" stroke="none" target-height="7.6762085"
target-width="8.955597" target-x="411.65195" target-y="912.2909"></path>
<path d="M 413.21 915.33 L 413.21 1010.94 L 419.48 1010.94 L 419.48 915.33 C 419.48 914.36 418.43 913.87 416.35 913.87 C 414.26 913.87 413.21 914.36 413.21 915.33 Z"
fill="#2b4d82" fill-rule="evenodd" id="路径-41" node-id="23" stroke="none" target-height="97.07422"
target-width="6.2657776" target-x="413.21307" target-y="913.8698"></path>
<path d="M 414.98 1006.75 L 417.66 1006.75 L 417.66 1022.10 L 414.98 1022.10 Z" fill="#2a3547" fill-rule="evenodd"
id="矩形" node-id="24" stroke="none" target-height="15.352417" target-width="2.686676" target-x="414.9775"
target-y="1006.74524"></path>
<path d="M 423.03 1007.44 C 423.03 1011.68 420.03 1015.12 416.32 1015.12 C 412.61 1015.12 409.60 1011.68 409.60 1007.44 C 409.60 1003.20 412.61 999.76 416.32 999.76 C 420.03 999.76 423.03 1003.20 423.03 1007.44 Z"
fill="#2b4d82" fill-rule="evenodd" id="椭圆形" node-id="25" stroke="none" target-height="15.352417"
target-width="13.43338" target-x="409.6" target-y="999.76337"></path>
<path d="M 423.82 843.00 C 372.06 845.09 313.93 863.64 327.94 882.15 C 341.91 893.70 367.74 872.62 396.02 890.10 C 412.95 900.57 416.42 903.75 431.97 918.81 C 439.72 926.33 454.31 949.93 467.53 949.52 C 480.74 949.11 493.24 929.21 503.56 919.36 C 509.65 913.54 530.02 889.51 549.31 882.81 C 570.09 875.59 582.18 882.30 612.56 881.45 C 642.94 880.59 610.28 845.75 526.14 843.00 C 492.68 838.82 480.87 833.81 423.82 843.00 Z"
fill="#3c6db8" fill-rule="evenodd" id="路径-28" node-id="26" stroke="none" target-height="116.123474"
target-width="329.01477" target-x="313.92572" target-y="833.80615"></path>
<path d="M 400.29 828.14 C 399.61 845.83 400.03 857.11 401.57 861.97 C 407.94 886.07 435.30 925.47 462.60 924.05 C 492.70 924.74 521.69 884.07 526.18 861.97 C 529.93 851.11 524.86 835.38 526.87 828.14 C 531.72 823.52 511.92 825.15 467.47 833.03 L 400.29 828.14 Z"
fill="#ffb5a1" fill-rule="evenodd" id="蒙版" node-id="27" stroke="none" target-height="101.95264"
target-width="132.11285" target-x="399.6089" target-y="823.51654"></path>
<path d="M 505.70 899.61 C 494.43 912.75 479.80 923.41 464.75 924.03 L 462.60 924.05 C 448.77 924.77 434.93 915.02 423.80 902.08 C 450.76 908.58 477.52 907.93 504.06 900.12 L 505.70 899.61 Z"
fill="#ffffff" fill-rule="evenodd" id="路径" node-id="28" stroke="none" target-height="25.157288"
target-width="81.895996" target-x="423.80438" target-y="899.6133"></path>
<path d="M 430.64 830.34 L 467.47 833.03 L 479.23 830.99 L 479.23 830.99 L 489.72 829.28 L 489.72 829.28 L 498.92 827.89 L 498.92 827.89 L 504.99 827.06 L 504.99 827.06 L 510.33 826.42 L 510.33 826.42 L 514.96 825.95 L 514.96 825.95 L 517.64 825.75 L 517.64 825.75 L 520.00 825.62 L 520.00 825.62 L 522.95 825.58 C 523.24 825.59 523.51 825.60 523.77 825.61 L 525.17 825.73 L 525.17 825.73 L 526.26 825.93 C 527.80 826.33 528.00 827.06 526.87 828.14 C 526.25 830.40 526.31 833.49 526.58 837.01 L 527.18 843.70 C 527.73 849.89 528.05 856.54 526.18 861.97 C 525.23 866.62 523.21 872.08 520.32 877.81 C 518.83 877.94 517.30 878.01 515.72 878.01 C 490.06 878.01 454.02 864.55 407.57 837.62 L 400.12 833.25 L 400.15 832.34 L 400.15 832.34 L 430.64 830.34 Z"
fill="#f5987f" fill-rule="evenodd" id="路径" node-id="29" stroke="none" target-height="52.422913"
target-width="127.934906" target-x="400.11972" target-y="825.584"></path>
<path d="M 845.22 356.52 L 840.88 364.18 L 836.34 371.23 L 831.60 377.69 L 826.66 383.61 L 821.32 389.28 L 815.79 394.51 L 810.07 399.31 L 804.17 403.70 L 795.92 409.07 L 787.38 413.88 L 778.51 418.14 L 769.42 421.92 L 760.08 425.32 L 750.47 428.33 L 735.83 432.24 L 720.81 435.61 L 705.63 438.60 L 690.31 441.38 L 659.73 446.99 L 642.92 450.55 L 625.26 454.75 L 606.73 459.64 L 587.29 465.25 L 566.89 471.61 L 545.51 478.77 L 523.11 486.76 L 499.63 495.63 L 501.76 478.77 L 504.26 463.37 L 507.10 449.35 L 510.24 436.61 L 513.66 425.07 L 517.32 414.62 L 521.20 405.21 L 525.29 396.74 L 529.57 389.15 L 534.02 382.36 L 538.63 376.33 L 543.41 370.99 L 548.36 366.29 L 553.48 362.20 L 558.78 358.67 L 560.77 357.24 L 562.24 355.73 L 563.28 354.14 L 563.94 352.46 L 564.35 350.02 L 564.29 347.31 L 563.71 344.27 L 562.23 339.69 L 560.01 334.48 L 554.74 323.44 L 552.12 317.58 L 549.81 311.52 L 548.55 307.40 L 547.65 303.26 L 547.10 299.09 L 547.02 294.91 L 547.49 290.73 L 548.54 286.50 L 549.70 283.49 L 551.31 280.43 L 553.40 277.32 L 556.03 274.12 L 558.84 271.29 L 562.29 268.39 L 566.46 265.39 L 571.45 262.32 L 576.38 259.68 L 582.17 256.99 L 588.92 254.24 L 596.73 251.45 L 607.04 248.27 L 619.31 245.08 L 633.76 241.89 L 649.95 237.91 L 665.08 234.59 L 679.20 231.88 L 692.37 229.76 L 704.64 228.16 L 717.66 226.90 L 729.71 226.15 L 740.86 225.87 L 751.16 226.02 L 760.65 226.57 L 770.67 227.61 L 779.85 229.01 L 788.24 230.73 L 795.91 232.75 L 802.90 235.06 L 810.08 237.93 L 816.57 241.02 L 822.43 244.33 L 827.71 247.84 L 832.44 251.55 L 837.01 255.75 L 841.06 260.08 L 844.62 264.56 L 847.72 269.20 L 850.36 274.00 L 852.65 279.06 L 854.52 284.20 L 855.99 289.46 L 857.07 294.84 L 857.75 300.35 L 858.07 307.27 L 857.83 314.26 L 857.04 321.34 L 855.67 328.54 L 853.81 335.59 L 851.46 342.60 L 848.60 349.57 L 845.22 356.52 Z"
fill="#edb41f" fill-rule="evenodd" group-id="3" node-id="88" stroke="none" target-height="269.75473"
target-width="358.43317" target-x="499.63354" target-y="225.87112"></path>
<path d="M 843.38 374.87 L 838.15 382.19 L 832.77 388.86 L 827.24 394.90 L 821.57 400.35 L 815.51 405.50 L 809.30 410.17 L 802.95 414.38 L 796.44 418.15 L 789.72 421.57 L 782.85 424.65 L 775.84 427.39 L 768.67 429.81 L 758.98 432.57 L 749.06 434.93 L 738.93 436.86 L 732.48 437.91 L 732.48 437.91 L 725.97 438.83 L 725.97 438.83 L 719.43 439.65 L 716.14 440.03 L 709.53 440.71 L 709.53 440.71 L 728.65 426.69 L 741.24 424.47 L 752.98 421.80 L 763.91 418.71 L 774.09 415.22 L 783.56 411.35 L 792.37 407.11 L 800.55 402.51 L 808.14 397.57 L 815.18 392.27 L 821.69 386.62 L 827.69 380.61 L 833.21 374.23 L 838.26 367.47 L 842.86 360.30 L 847.00 352.71 L 850.70 344.67 L 853.94 336.14 L 856.72 327.10 L 859.02 317.51 L 860.82 307.34 L 861.48 312.95 L 861.73 318.60 L 861.57 324.31 L 860.99 330.10 L 860.03 335.81 L 858.71 341.52 L 857.01 347.24 L 854.93 352.97 L 851.68 360.39 L 847.83 367.68 L 843.38 374.87 Z"
fill="#d19800" fill-rule="evenodd" group-id="4" id="路径" node-id="33" stroke="none" target-height="133.37094"
target-width="152.19409" target-x="709.53314" target-y="307.34015"></path>
<path d="M 697.32 580.06 C 721.81 522.64 754.53 502.60 795.47 519.96 C 856.87 545.99 793.27 671.78 722.41 656.93 C 675.18 647.03 666.81 621.41 697.32 580.06 Z"
fill="#ffb5a1" fill-rule="evenodd" id="路径-24" node-id="34" stroke="none" target-height="169.17953"
target-width="190.05817" target-x="666.8143" target-y="502.60294"></path>
<path d="M 715.48 615.05 C 729.33 588.93 745.82 575.01 764.97 573.28" fill="none" id="路径-42" node-id="35"
stroke="#c26b6b" stroke-linecap="round" stroke-width="11.0529785" target-height="41.77179"
target-width="49.489807" target-x="715.4849" target-y="573.2826"></path>
<path d="M 735.51 589.57 C 748.14 592.28 756.51 599.24 760.61 610.44" fill="none" id="路径-43" node-id="36"
stroke="#c26b6b" stroke-linecap="round" stroke-width="11.0529785" target-height="20.875305"
target-width="25.101196" target-x="735.5066" target-y="589.5652"></path>
<path d="M 253.24 587.28 L 248.26 576.35 L 243.23 566.72 L 238.19 558.29 L 233.12 550.95 L 228.05 544.61 L 222.96 539.18 L 217.86 534.58 L 212.73 530.74 L 207.57 527.60 L 202.35 525.11 L 197.05 523.24 L 191.65 521.97 L 186.11 521.28 L 180.39 521.17 L 174.47 521.67 L 168.31 522.81 L 161.86 524.63 L 155.09 527.18 L 151.06 529.15 L 147.48 531.34 L 144.31 533.75 L 141.53 536.37 L 139.09 539.22 L 136.45 543.15 L 134.28 547.35 L 132.60 551.85 L 131.38 556.68 L 130.66 561.58 L 130.34 566.68 L 130.45 572.00 L 131.00 577.56 L 132.31 584.86 L 134.29 592.30 L 136.96 599.90 L 140.18 607.30 L 143.96 614.57 L 148.31 621.72 L 153.14 628.56 L 158.39 634.99 L 164.07 641.03 L 168.63 645.28 L 173.35 649.16 L 178.23 652.69 L 183.28 655.86 L 188.55 658.67 L 193.92 660.99 L 199.38 662.84 L 204.96 664.23 L 210.63 665.09 L 216.36 665.37 L 222.19 665.06 L 228.15 664.16 L 236.37 662.16 L 243.42 659.93 L 249.40 657.50 L 254.45 654.90 L 258.67 652.15 L 262.17 649.26 L 265.01 646.24 L 267.28 643.06 L 269.01 639.73 L 270.24 636.19 L 270.97 632.42 L 271.19 628.36 L 270.87 623.97 L 269.95 619.18 L 268.35 613.95 L 265.99 608.20 L 262.77 601.89 L 258.56 594.93 L 253.24 587.28 Z"
fill="#ffb5a1" fill-rule="evenodd" group-id="5" id="路径-24备份" node-id="37" stroke="none"
target-height="144.19855" target-width="140.85565" target-x="130.33887" target-y="521.17175"></path>
<path d="M 223.70 616.14 L 219.32 608.43 L 214.92 601.71 L 210.51 595.91 L 206.10 590.95 L 201.67 586.73 L 197.23 583.21 L 192.76 580.33 L 188.24 578.03 L 183.66 576.28 L 178.99 575.07 L 174.21 574.37"
fill="none" group-id="6" id="路径-42" node-id="38" stroke="#c26b6b" stroke-linecap="round"
stroke-width="11.0529785" target-height="41.77179" target-width="49.48979" target-x="174.20847"
target-y="574.37256"></path>
<path d="M 206.00 593.38 L 201.25 594.67 L 197.06 596.34 L 193.36 598.37 L 190.11 600.75 L 187.25 603.51 L 184.77 606.65 L 182.65 610.22 L 180.90 614.26"
fill="none" group-id="7" id="路径-43" node-id="39" stroke="#c26b6b" stroke-linecap="round"
stroke-width="11.0529785" target-height="20.875305" target-width="25.101166" target-x="180.89645"
target-y="593.3819"></path>
<path d="M 464.88 224.32 L 474.50 224.32 C 616.34 224.32 731.32 339.30 731.32 481.14 C 731.32 482.52 731.31 483.91 731.29 485.29 L 729.42 600.34 C 727.27 733.77 623.28 843.31 490.15 852.41 L 466.68 854.01 L 466.68 854.01 L 451.40 852.90 C 321.54 843.45 219.31 738.31 213.49 608.24 L 208.31 492.62 C 201.97 350.93 311.70 230.92 453.39 224.58 C 457.22 224.40 461.05 224.32 464.88 224.32 Z"
fill="#ffcdbc" fill-rule="evenodd" id="蒙版" node-id="40" stroke="none" target-height="629.6952"
target-width="529.3472" target-x="201.97139" target-y="224.31845"></path>
<path d="M 256.94 620.13 C 290.54 620.13 317.78 647.36 317.78 680.96 C 317.78 713.83 291.71 740.61 259.12 741.76 L 258.07 741.77 C 236.77 710.67 222.14 674.66 216.20 635.79 C 226.98 626.05 241.27 620.13 256.94 620.13 Z M 682.79 612.52 C 700.21 612.52 715.93 619.85 727.02 631.59 C 721.89 668.76 708.80 703.45 689.48 733.83 C 687.28 734.07 685.05 734.19 682.79 734.19 C 649.19 734.19 621.95 706.96 621.95 673.36 C 621.95 639.76 649.19 612.52 682.79 612.52 Z"
fill="#ffb5a1" fill-opacity="0.43815103" fill-rule="evenodd" group-id="8" id="形状结合" node-id="41"
stroke="none" target-height="129.2508" target-width="510.81848" target-x="216.20026"
target-y="612.52246"></path>
<path d="M 184.62 390.84 C 170.31 426.29 170.31 458.76 184.62 488.25 C 206.07 532.48 276.25 503.25 308.21 477.29 C 364.49 494.48 408.74 487.94 440.97 457.67 C 480.24 481.11 521.00 487.62 563.25 477.21 C 602.14 498.43 642.55 499.53 684.47 480.52 C 702.80 520.72 721.57 531.50 740.77 512.86 C 755.70 492.61 759.67 452.85 752.67 393.58 C 617.22 268.88 517.41 206.29 453.25 205.79 C 389.09 205.28 305.84 266.45 203.50 389.28 L 184.62 390.84 Z"
fill="#382222" fill-rule="evenodd" id="蒙版" node-id="42" stroke="none" target-height="327.1981"
target-width="589.3591" target-x="170.31012" target-y="205.2833"></path>
<path d="M 690.60 456.12 C 704.84 491.52 718.65 512.59 732.02 519.34 C 715.86 527.53 700.01 514.60 684.47 480.52 C 642.55 499.53 602.14 498.43 563.25 477.21 C 526.31 486.31 490.51 482.48 455.85 465.71 L 448.19 456.12 C 491.08 469.49 532.03 471.98 571.02 463.58 C 609.49 489.56 649.35 487.07 690.60 456.12 Z M 282.03 463.58 L 307.83 477.59 C 301.15 482.98 292.83 488.49 283.67 493.45 L 279.02 495.88 C 250.73 510.14 215.93 518.38 195.51 502.14 C 223.62 515.11 251.80 503.13 280.06 466.20 L 282.03 463.58 Z M 562.12 266.61 C 563.23 266.61 564.19 267.84 565.02 270.32 L 565.50 271.95 L 565.50 271.95 L 565.95 273.88 L 565.95 273.88 L 566.37 276.11 L 566.37 276.11 L 566.75 278.63 L 566.75 278.63 L 567.11 281.45 L 567.11 281.45 L 567.43 284.57 L 567.43 284.57 L 567.71 287.98 L 567.71 287.98 L 568.08 293.66 L 568.08 293.66 L 568.29 297.82 L 568.29 297.82 L 568.53 304.61 L 568.53 304.61 L 568.66 309.51 L 568.66 309.51 L 568.81 320.20 L 568.81 320.20 L 568.84 329.00 L 568.84 329.00 L 568.79 338.46 L 568.79 338.46 L 568.61 352.12 L 568.61 352.12 L 568.40 363.14 L 568.40 363.14 L 568.11 374.83 L 568.11 374.83 C 544.41 344.52 504.44 329.36 448.19 329.36 C 392.82 329.36 370.29 365.41 380.59 437.49 L 381.10 440.95 L 300.98 450.98 L 313.99 326.36 L 313.99 326.36 L 317.36 291.67 L 317.36 291.67 L 317.96 284.52 L 317.96 284.52 L 318.15 281.22 C 318.15 281.10 318.16 281.01 318.16 280.92 C 318.16 280.40 319.04 279.89 320.70 279.40 L 322.30 278.97 C 322.60 278.90 322.92 278.83 323.25 278.76 L 325.40 278.35 L 325.40 278.35 L 329.26 277.73 L 329.26 277.73 L 333.85 277.13 L 333.85 277.13 L 341.00 276.35 L 341.00 276.35 L 351.43 275.40 L 351.43 275.40 L 368.43 274.15 L 368.43 274.15 L 384.77 273.14 L 384.77 273.14 L 411.44 271.73 L 411.44 271.73 L 426.94 271.02 L 426.94 271.02 L 461.97 269.59 L 461.97 269.59 L 517.70 267.73 L 517.70 267.73 L 561.21 266.61 L 561.21 266.61 L 562.12 266.61 Z"
fill="#221010" fill-rule="evenodd" id="形状" node-id="43" stroke="none" target-height="260.92984"
target-width="536.51874" target-x="195.50623" target-y="266.605"></path>
<path d="M 480.70 93.09 C 495.01 93.09 507.16 103.37 511.50 117.64 C 686.18 141.11 769.14 248.09 760.41 438.57 C 680.93 455.25 580.75 463.58 459.88 463.58 C 339.00 463.58 243.67 458.54 173.89 448.44 C 166.16 235.26 258.37 124.37 450.51 115.76 L 450.52 115.77 C 455.31 102.48 467.02 93.09 480.70 93.09 Z M 459.88 302.54 C 374.41 303.89 334.04 346.51 338.76 430.41 C 417.49 442.31 492.50 442.31 563.78 430.41 C 582.91 400.91 544.85 302.31 459.88 302.54 Z"
fill="#ffc631" fill-rule="evenodd" id="蒙版" node-id="44" stroke="none" target-height="370.4926"
target-width="602.9802" target-x="166.16113" target-y="93.09091"></path>
<path d="M 518.08 119.96 L 514.12 118.00 L 521.87 119.15 C 689.46 145.42 768.97 251.89 760.41 438.57 C 687.04 453.96 596.04 462.25 487.40 463.44 L 469.13 463.57 C 466.06 463.58 462.98 463.58 459.88 463.58 L 439.71 463.54 C 433.06 463.50 426.50 463.46 420.02 463.39 L 400.82 463.15 L 400.82 463.15 L 382.11 462.82 L 382.11 462.82 L 363.88 462.38 C 360.89 462.30 357.91 462.22 354.95 462.13 L 337.45 461.56 L 337.45 461.56 L 320.44 460.88 L 320.44 460.88 C 326.04 446.18 332.05 432.64 338.39 420.16 C 338.44 423.51 338.56 426.92 338.76 430.41 C 417.49 442.31 492.50 442.31 563.78 430.41 C 582.91 400.91 544.85 302.31 459.88 302.54 C 453.03 302.65 446.48 303.02 440.21 303.66 C 462.85 288.92 485.47 278.73 506.35 270.49 L 514.60 267.29 L 514.60 267.29 L 522.65 264.27 L 522.65 264.27 L 541.68 257.21 L 541.68 257.21 L 548.80 254.50 C 556.92 251.34 564.39 248.19 571.02 244.80 C 614.63 222.49 609.03 190.43 578.08 160.52 L 575.01 157.63 C 573.96 156.67 572.89 155.72 571.78 154.76 L 568.41 151.91 C 567.84 151.43 567.26 150.96 566.67 150.49 L 563.08 147.67 L 563.08 147.67 L 559.36 144.87 L 559.36 144.87 L 555.50 142.10 C 554.84 141.64 554.19 141.18 553.52 140.72 L 549.48 138.00 C 548.11 137.10 546.72 136.20 545.31 135.30 L 541.03 132.65 C 540.31 132.21 539.58 131.77 538.85 131.33 L 534.41 128.73 C 533.66 128.30 532.90 127.87 532.15 127.44 L 527.55 124.90 L 527.55 124.90 L 522.86 122.41 L 522.86 122.41 L 518.08 119.96 L 518.08 119.96 Z M 510.92 115.88 L 511.38 117.21 L 507.76 116.54 C 501.86 115.51 493.97 114.50 485.81 115.16 C 489.86 109.17 489.50 101.91 484.72 93.38 C 496.04 94.92 505.57 102.94 510.19 114.00 L 510.92 115.88 Z"
fill="#e9a900" fill-rule="evenodd" id="形状" node-id="45" stroke="none" target-height="370.206"
target-width="448.5272" target-x="320.43954" target-y="93.37752"></path>
<path d="M 621.57 601.80 C 621.57 621.75 608.63 637.92 592.67 637.92 C 576.71 637.92 563.78 621.75 563.78 601.80 C 563.78 581.85 576.71 565.68 592.67 565.68 C 608.63 565.68 621.57 581.85 621.57 601.80 Z"
fill="#623d3d" fill-rule="evenodd" id="椭圆形备份-3" node-id="46" stroke="none" target-height="72.24164"
target-width="57.793335" target-x="563.7774" target-y="565.67773"></path>
<path d="M 375.95 601.80 C 375.95 621.75 363.01 637.92 347.05 637.92 C 331.09 637.92 318.16 621.75 318.16 601.80 C 318.16 581.85 331.09 565.68 347.05 565.68 C 363.01 565.68 375.95 581.85 375.95 601.80 Z"
fill="#623d3d" fill-rule="evenodd" id="椭圆形备份-4" node-id="47" stroke="none" target-height="72.24164"
target-width="57.793335" target-x="318.15567" target-y="565.67773"></path>
<path d="M 562.13 525.88 L 568.75 524.10 L 577.10 522.36 L 587.46 520.70 L 600.13 519.16 L 609.30 518.52 L 620.65 518.40 L 634.53 518.91 L 651.31 520.20 L 671.37 522.41 L 663.95 517.06 L 656.64 512.46 L 649.42 508.56 L 642.29 505.31 L 635.22 502.69 L 628.20 500.66 L 621.21 499.22 L 614.23 498.33 L 607.23 498.00 L 600.20 498.22 L 593.11 499.00 L 586.97 500.46 L 581.73 502.24 L 577.27 504.29 L 573.51 506.60 L 570.36 509.14 L 567.76 511.91 L 565.65 514.94 L 564.02 518.25 L 562.84 521.88 L 562.13 525.88 Z"
fill="#623d3d" fill-rule="evenodd" group-id="9" id="路径-27" node-id="48" stroke="none"
target-height="27.882507" target-width="109.242676" target-x="562.12537" target-y="497.99805"></path>
<path d="M 384.47 525.88 L 377.84 524.10 L 369.49 522.36 L 359.13 520.70 L 346.46 519.16 L 337.30 518.52 L 325.94 518.40 L 312.06 518.91 L 295.29 520.20 L 275.23 522.41 L 282.65 517.06 L 289.96 512.46 L 297.17 508.56 L 304.30 505.31 L 311.37 502.69 L 318.39 500.66 L 325.38 499.22 L 332.37 498.33 L 339.37 498.00 L 346.40 498.22 L 353.49 499.00 L 359.62 500.46 L 364.87 502.24 L 369.32 504.29 L 373.08 506.60 L 376.23 509.14 L 378.84 511.91 L 380.94 514.94 L 382.58 518.25 L 383.76 521.88 L 384.47 525.88 Z"
fill="#623d3d" fill-rule="evenodd" group-id="10" id="路径-27备份" node-id="49" stroke="none"
target-height="27.882507" target-width="109.242676" target-x="275.2269" target-y="497.99805"></path>
<path d="M 464.50 545.81 C 465.57 542.96 468.84 541.48 471.81 542.51 C 474.78 543.53 476.32 546.67 475.25 549.52 L 473.18 555.10 C 451.65 613.75 447.74 644.74 456.74 646.78 L 456.87 646.80 L 458.66 646.77 C 468.20 646.39 477.91 643.58 487.83 638.27 L 490.12 637.00 C 492.83 635.45 496.34 636.30 497.95 638.90 C 499.57 641.50 498.68 644.86 495.97 646.41 C 483.62 653.48 471.25 657.28 458.92 657.72 L 456.46 657.77 L 455.75 657.73 C 432.67 654.94 437.39 618.12 464.50 545.81 Z"
fill="#f28080" fill-rule="nonzero" id="路径-30" node-id="50" stroke="none" target-height="116.28613"
target-width="66.89816" target-x="432.67035" target-y="541.4824"></path>
<path d="M 417.05 701.46 L 515.68 687.01 C 515.68 727.18 502.75 750.36 476.90 756.54 C 451.05 762.71 431.10 744.36 417.05 701.46 Z"
fill="url(#linearGradient-3)" fill-rule="evenodd" id="路径-31" node-id="51" stroke="none"
target-height="75.70325" target-width="98.63388" target-x="417.04727" target-y="687.0109"></path>
</svg>

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706096167224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7281" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M907.1 299.9c-14.6-14.6-38.4-14.6-53 0L513 640.5 172 299.9c-14.6-14.6-38.4-14.6-53 0-14.6 14.6-14.6 38.4 0 53l364.7 364.2c0.8 1 1.7 2 2.7 3 7.3 7.3 17 11 26.7 10.9 9.7 0 19.3-3.6 26.7-10.9 1-1 1.8-1.9 2.7-3l364.7-364.2c14.4-14.6 14.4-38.4-0.1-53z" fill="" p-id="7282"></path></svg>

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699702358744" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="12880"
width="16" height="16">
<path d="M903 929.5H132.5c-20.1 0-36.5-16.4-36.5-36.6V119.5c0-13.8 11.2-25 25-25s25 11.2 25 25v760h757c13.8 0 25 11.2 25 25s-11.2 25-25 25z"
p-id="12881"></path>
<path d="M241 536.7h50V796h-50zM417.7 458.5h50V796h-50zM594.3 536.7h50V796h-50zM771 411h50v385h-50zM246.9 467.2L217 426.8l218.9-156.9 185.8 114.3 182.8-150.4 32.5 38.4-211 173.6-187.9-115.7z"
p-id="12882"></path>
<path d="M715.2 184.2l194.6-3.9-43.9 187" p-id="12883"></path>
</svg>

After

Width:  |  Height:  |  Size: 776 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562737910" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25002" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M0.853333 129.706667c0-28.16 22.186667-51.2 49.493334-51.2h336.213333c19.626667 0 37.546667 11.946667 45.226667 30.72l23.893333 58.88h438.613333c12.8 0 25.6 5.12 34.133334 15.36 9.386667 9.386667 14.506667 22.186667 14.506666 35.84v674.133333c0 13.653333-5.12 26.453333-14.506666 35.84s-21.333333 15.36-34.133334 15.36H50.346667c-12.8 0-25.6-5.12-34.133334-15.36-9.386667-9.386667-14.506667-23.04-14.506666-35.84-0.853333 0.853333-0.853333-763.733333-0.853334-763.733333z" fill="#FFA000" p-id="25003"></path><path d="M95.573333 213.333333h750.933334c34.133333 0 52.053333 17.92 52.053333 52.906667v477.866667c0 35.84-17.066667 52.906667-52.053333 52.906666h-750.933334c-34.133333 0-52.053333-17.92-52.053333-52.906666v-477.866667c0-35.84 17.92-52.906667 52.053333-52.906667z" fill="#FFFFFF" p-id="25004"></path><path d="M131.413333 293.546667h750.933334c34.133333 0 49.493333 17.066667 44.373333 51.2l-66.56 459.946666c-5.12 34.133333-24.746667 51.2-59.733333 51.2h-733.866667c-34.133333 0-49.493333-17.066667-44.373333-51.2l49.493333-459.946666c5.12-34.986667 25.6-51.2 59.733333-51.2z" fill="#EFC99A" opacity=".9" p-id="25005"></path><path d="M139.946667 315.733333h750.933333c34.133333 0 49.493333 17.066667 44.373333 51.2l-66.56 459.946667c-5.12 34.133333-24.746667 51.2-59.733333 51.2h-742.4c-34.133333 0-49.493333-17.066667-44.373333-51.2L80.213333 366.933333c5.12-34.986667 25.6-51.2 59.733334-51.2z" fill="#FFFFFF" p-id="25006"></path><path d="M131.413333 448.853333h843.946667c32.426667 0 49.493333 11.093333 49.493333 34.133334l-81.92 427.52c0 22.186667-16.213333 34.133333-49.493333 34.133333H49.493333c-32.426667 0-49.493333-11.093333-49.493333-34.133333l81.92-427.52c0-23.04 16.213333-34.133333 49.493333-34.133334z" fill="#FFCA28" p-id="25007"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562636844" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22977" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M508.534154 342.646154m-306.727385 0a306.727385 306.727385 0 1 0 613.454769 0 306.727385 306.727385 0 1 0-613.454769 0Z" fill="#FFDC64" p-id="22978"></path><path d="M508.534154 667.490462a325.001846 325.001846 0 1 1 325.001846-324.844308 325.316923 325.316923 0 0 1-325.001846 324.844308z m0-613.45477A288.610462 288.610462 0 1 0 797.144615 342.646154 288.925538 288.925538 0 0 0 508.534154 54.035692z" fill="" p-id="22979"></path><path d="M508.534154 479.547077m-24.260923 0a24.260923 24.260923 0 1 0 48.521846 0 24.260923 24.260923 0 1 0-48.521846 0Z" fill="" p-id="22980"></path><path d="M508.534154 342.646154m-223.547077 0a223.547077 223.547077 0 1 0 447.094154 0 223.547077 223.547077 0 1 0-447.094154 0Z" fill="#DDDDDD" p-id="22981"></path><path d="M508.534154 584.310154a241.664 241.664 0 1 1 241.821538-241.664 241.979077 241.979077 0 0 1-241.821538 241.664z m0-447.094154a204.8 204.8 0 1 0 204.8 204.8 204.8 204.8 0 0 0-204.8-204.8z" fill="" p-id="22982"></path><path d="M480.964923 301.056h46.788923v192.354462h-46.788923z" fill="" p-id="22983"></path><path d="M527.753846 498.609231h-47.261538a5.198769 5.198769 0 0 1-5.19877-5.198769V301.056a5.198769 5.198769 0 0 1 5.19877-5.198769h47.261538a5.198769 5.198769 0 0 1 5.198769 5.198769v192.354462a5.198769 5.198769 0 0 1-5.198769 5.198769zM486.163692 488.369231h36.391385V306.254769h-36.391385z" fill="" p-id="22984"></path><path d="M504.438154 222.916923m-48.679385 0a48.679385 48.679385 0 1 0 97.358769 0 48.679385 48.679385 0 1 0-97.358769 0Z" fill="" p-id="22985"></path><path d="M899.544615 398.729846a48.836923 48.836923 0 0 0-48.836923 48.836923v129.024a48.836923 48.836923 0 0 0-81.762461-22.528L597.700923 724.676923a145.723077 145.723077 0 0 0-43.008 103.660308v160.216615h212.676923l150.606769-276.795077a250.171077 250.171077 0 0 0 30.247385-119.099077v-145.092923a48.836923 48.836923 0 0 0-48.679385-48.836923zM426.299077 724.676923L255.054769 554.220308A48.836923 48.836923 0 0 0 173.292308 576.590769v-129.024a48.836923 48.836923 0 1 0-97.673846 0v145.092923a250.013538 250.013538 0 0 0 30.247384 119.099077l150.606769 276.795077h212.676923V829.124923A145.723077 145.723077 0 0 0 426.299077 724.676923z" fill="#FFD29F" p-id="22986"></path><path d="M899.544615 381.085538a66.638769 66.638769 0 0 0-66.48123 66.481231v81.447385a66.481231 66.481231 0 0 0-76.563693 12.603077L585.255385 712.861538a163.367385 163.367385 0 0 0-48.20677 116.263385v159.428923a17.801846 17.801846 0 0 0 17.801847 17.801846h60.494769a17.801846 17.801846 0 1 0 0-35.446154h-42.850462v-141.784615a128.078769 128.078769 0 0 1 37.809231-91.214769L781.390769 567.138462a31.507692 31.507692 0 0 1 43.953231 0 26.308923 26.308923 0 0 1 7.561846 12.445538 48.521846 48.521846 0 0 1 0 17.329231 31.507692 31.507692 0 0 1-8.034461 14.020923L654.257231 781.863385a66.323692 66.323692 0 0 0-19.534769 47.261538 17.801846 17.801846 0 0 0 35.446153 0 31.507692 31.507692 0 0 1 9.137231-22.212923L850.707692 635.667692a66.481231 66.481231 0 0 0 17.959385-60.967384v-127.133539a31.507692 31.507692 0 1 1 62.070154 0v145.092923a232.369231 232.369231 0 0 1-28.199385 110.276923L756.184615 970.909538h-38.281846a17.801846 17.801846 0 1 0 0 35.446154h49.624616a17.644308 17.644308 0 0 0 15.753846-9.294769l150.606769-276.795077a267.815385 267.815385 0 0 0 32.452923-127.606154v-145.092923a66.638769 66.638769 0 0 0-66.796308-66.481231zM438.744615 712.861538L267.815385 541.617231a66.481231 66.481231 0 0 0-76.563693-12.603077v-81.447385a66.481231 66.481231 0 1 0-133.12 0v145.092923a267.815385 267.815385 0 0 0 32.452923 127.606154l150.449231 276.795077a17.644308 17.644308 0 0 0 15.753846 9.294769h49.624616a17.801846 17.801846 0 1 0 0-35.446154H267.815385l-145.565539-267.815384a232.369231 232.369231 0 0 1-28.199384-110.276923v-145.250462a31.507692 31.507692 0 1 1 62.070153 0v127.133539A66.481231 66.481231 0 0 0 173.292308 635.667692l171.401846 171.244308a31.507692 31.507692 0 0 1 9.137231 22.212923 17.801846 17.801846 0 0 0 35.446153 0 66.481231 66.481231 0 0 0-19.534769-47.261538L198.656 610.619077A31.507692 31.507692 0 1 1 242.609231 567.138462l171.086769 170.771692a128.078769 128.078769 0 0 1 37.809231 91.214769v141.784615h-42.850462a17.801846 17.801846 0 0 0 0 35.446154h60.494769a17.801846 17.801846 0 0 0 17.801847-17.644307V829.124923a163.367385 163.367385 0 0 0-48.20677-116.263385zM537.363692 327.837538h-65.851077a18.274462 18.274462 0 0 1 0-36.391384h65.851077a18.274462 18.274462 0 0 1 0 36.391384zM537.363692 501.129846h-65.851077a18.274462 18.274462 0 0 1 0-36.391384h65.851077a18.274462 18.274462 0 0 1 0 36.391384z" fill="" p-id="22987"></path></svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562909327" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="27021" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M942.08 1024H81.92A81.92 81.92 0 0 1 0 942.08V81.92A81.92 81.92 0 0 1 81.92 0h860.16A81.92 81.92 0 0 1 1024 81.92v860.16A81.92 81.92 0 0 1 942.08 1024zM81.92 68.498286a13.421714 13.421714 0 0 0-13.458286 13.421714v860.16c0 7.424 6.034286 13.421714 13.458286 13.421714h860.16a13.458286 13.458286 0 0 0 13.421714-13.421714V81.92a13.458286 13.458286 0 0 0-13.421714-13.421714H81.92z" fill="#C50935" p-id="27022"></path><path d="M452.388571 607.085714c-2.194286-22.820571-1.097143-42.24 3.291429-58.258285 4.388571-16.018286 10.386286-29.842286 18.066286-41.472 7.68-11.629714 16.457143-21.723429 26.331428-30.281143 9.874286-8.557714 19.090286-16.822857 27.648-24.685715a137.874286 137.874286 0 0 0 21.394286-24.685714c5.705143-8.557714 8.557714-18.761143 8.557714-30.610286 0-15.36-4.278857-27.648-12.8-36.864-8.594286-9.216-23.844571-13.824-45.787428-13.824-7.021714 0-14.482286 0.731429-22.381715 2.304a159.195429 159.195429 0 0 0-23.698285 6.582858 191.707429 191.707429 0 0 0-42.130286 21.394285l-32.914286-63.195428c16.676571-11.410286 35.876571-20.845714 57.6-28.306286 21.723429-7.460571 47.945143-11.190857 78.665143-11.190857 41.252571 0 73.508571 9.984 96.768 29.952 23.259429 19.968 34.889143 46.811429 34.889143 80.64 0 22.381714-2.925714 40.923429-8.886857 55.588571a135.497143 135.497143 0 0 1-22.052572 37.558857c-8.777143 10.313143-18.432 19.382857-28.964571 27.318858a249.490286 249.490286 0 0 0-28.964571 25.344c-8.777143 8.996571-16.237714 19.382857-22.381715 31.268571-6.144 11.849143-9.216 26.989714-9.216 45.421714H452.388571z m-13.165714 93.476572c0-15.36 4.790857-27.538286 14.445714-36.571429 9.654857-8.96 22.381714-13.458286 38.180572-13.458286 16.676571 0 29.842286 4.498286 39.497143 13.494858 9.654857 8.996571 14.482286 21.174857 14.482285 36.534857 0 15.36-4.827429 27.648-14.482285 36.864s-22.820571 13.824-39.497143 13.824c-15.798857 0-28.525714-4.608-38.180572-13.824s-14.482286-21.504-14.482285-36.864z" fill="#5584FF" p-id="27023"></path></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562226298" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12795" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M384 128V16h-128v112" fill="#D73636" p-id="12796"></path><path d="M336 128V16h-80v112" fill="#F73B2F" p-id="12797"></path><path d="M48 416v528h928V416" fill="#FFE183" p-id="12798"></path><path d="M976 416v528h-64V480H48v-64h928z" fill="#D9BF6F" p-id="12799"></path><path d="M577.408 352H16v64h488.288" fill="#F73B2F" p-id="12800"></path><path d="M833.232 416H1008v-64H768.784" fill="#F73B2F" p-id="12801"></path><path d="M368 656a96.048 96.048 0 0 0-28.112-67.888A96 96 0 0 0 176 656v96h192v-96z" fill="#FFFFFF" p-id="12802"></path><path d="M320 592h32v160h-32z" fill="#D9D9D9" p-id="12803"></path><path d="M256 352v64c0 12.736-5.056 24.944-14.064 33.936a47.936 47.936 0 0 1-67.872 0A47.936 47.936 0 0 1 160 416v-64H32L128 128h18.736a48.032 48.032 0 0 1 90.528 0h201.408A80.048 80.048 0 0 1 512 80a80.048 80.048 0 0 1 72.32 45.792A63.712 63.712 0 0 1 624 112c16.208 0 31.024 6.048 42.32 16h49.824A71.92 71.92 0 0 1 776 96c24.944 0 46.944 12.704 59.856 32H896l96 224H400v56a40 40 0 1 1-80 0V352h-64z" fill="#CBE9EA" p-id="12804"></path><path d="M896 128l96 224H416c324.768 19.904 531.216-28.112 480-224z" fill="#ADC6C7" p-id="12805"></path><path d="M496 528l176-176 176 176v352H496V528" fill="#FFD140" p-id="12806"></path><path d="M464 880h416v64H464z" fill="#5AB947" p-id="12807"></path><path d="M768 656a96.048 96.048 0 0 0-28.112-67.888 96.048 96.048 0 0 0-135.776 0A96.048 96.048 0 0 0 576 656v224h192V656z" fill="#D73636" p-id="12808"></path><path d="M648 563.44a92.4 92.4 0 0 1 43.888 24.672A96.048 96.048 0 0 1 720 656v224h-144V656c0-25.456 10.112-49.872 28.112-67.888a92.4 92.4 0 0 1 43.888-24.672z" fill="#F73B2F" p-id="12809"></path><path d="M496 528v64l176-176 144 144v320h32V512L672 352 496 528z" fill="#D9B236" p-id="12810"></path><path d="M640 720m-16 0a16 16 0 1 0 32 0 16 16 0 1 0-32 0Z" fill="#F73B2F" p-id="12811"></path><path d="M672.064 261.584v-0.016l242.624 234.688a32 32 0 0 1 0.768 45.232l-0.016 0.016a32 32 0 0 1-45.248 0.784L672.064 350.96 474.496 541.744a31.936 31.936 0 0 1-45.248-0.8l-0.016-0.016a32 32 0 0 1 0.768-45.232l242.064-234.112z" fill="#F73B2F" p-id="12812"></path><path d="M40.32 960.784A104.064 104.064 0 0 1 136 816a103.68 103.68 0 0 1 71.6 28.592 79.584 79.584 0 0 0 71.312 20.864A108.944 108.944 0 0 1 296 864c48.576 0 88 39.424 88 88" fill="#CBE9EA" p-id="12813"></path><path d="M16 944h992v64H16z" fill="#5AB947" p-id="12814"></path></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1701352359188" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7279" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M96 480c-9.6 0-19.2-3.2-25.6-12.8-12.8-12.8-9.6-35.2 3.2-44.8l377.6-310.4c35.2-25.6 86.4-25.6 118.4 0l377.6 307.2c12.8 9.6 16 32 3.2 44.8-12.8 12.8-32 16-44.8 3.2L531.2 166.4c-9.6-6.4-28.8-6.4-38.4 0L115.2 473.6c-6.4 6.4-12.8 6.4-19.2 6.4zM816 928H608c-19.2 0-32-12.8-32-32v-150.4c0-22.4-38.4-44.8-67.2-44.8-28.8 0-64 19.2-64 44.8V896c0 19.2-12.8 32-32 32H211.2C163.2 928 128 892.8 128 848V544c0-19.2 12.8-32 32-32s32 12.8 32 32v304c0 9.6 6.4 16 19.2 16H384v-118.4c0-64 67.2-108.8 128-108.8s131.2 44.8 131.2 108.8V864h176c9.6 0 16 0 16-19.2V544c0-19.2 12.8-32 32-32s32 12.8 32 32v304C896 896 864 928 816 928z" fill="#666666" p-id="7280"></path></svg>

After

Width:  |  Height:  |  Size: 981 B

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1698328353112" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5767"
width="16" height="16">
<path d="M112 16h736v992H112z" fill="#AED796" p-id="5768"></path>
<path d="M392.176 846.08c8.032 4.544 18.208 2.032 22.704-5.616l159.344-256.496c4.496-7.648 1.648-17.504-6.384-22.048s-18.208-2.032-22.704 5.616l-159.344 256.496c-4.512 7.632-1.648 17.504 6.384 22.048z m204.416-50.672a15.84 15.84 0 0 0 22.464 0l79.344-79.344c0.336-0.288 0.752-0.384 1.056-0.704a15.776 15.776 0 0 0 4.592-11.52 15.808 15.808 0 0 0-4.656-11.264c-0.224-0.224-0.512-0.304-0.752-0.496l-79.552-79.552a15.872 15.872 0 1 0-22.464 22.464l68.944 68.944-68.992 68.992a15.888 15.888 0 0 0 0.016 22.48zM261.6 716.064l79.328 79.344a15.84 15.84 0 0 0 22.464 0 15.84 15.84 0 0 0 0-22.464L294.4 703.952l68.944-68.944a15.872 15.872 0 1 0-22.464-22.464l-79.552 79.552c-0.224 0.208-0.528 0.288-0.736 0.496a15.744 15.744 0 0 0-4.656 11.264 15.808 15.808 0 0 0 4.592 11.52c0.32 0.288 0.736 0.4 1.072 0.688zM896 128h-32V32a32 32 0 0 0-32-32H128a32 32 0 0 0-32 32v960a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32V416h32a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32z m-64 0H352a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h480v576H128V32h704v96z"
fill="#2B3139" p-id="5769"></path>
<path d="M352 160h544v224H352z" fill="#FFFFFF" p-id="5770"></path>
<path d="M387.696 213.824h35.184v39.664h32.944v-39.664h35.184V328h-35.184v-45.264H422.88V328h-35.184v-114.176zM535.856 243.088h-31.984v-29.264h99.136v29.264h-31.984V328h-35.168v-84.912zM615.872 213.824h50.048l16.32 67.168h0.32l16.32-67.168h50.064V328H715.68v-73.248h-0.336l-19.84 73.248H669.28l-19.824-73.248h-0.336V328h-33.248v-114.176zM767.056 213.824h35.184v84.912h50.528V328h-85.712v-114.176z"
fill="#2B3139" p-id="5771"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1698592095496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5243"
width="16" height="16">
<path d="M217.9 356.5c-14.1 0-25.5 11.4-25.5 25.5s11.4 25.5 25.5 25.5 25.5-11.4 25.5-25.5-11.4-25.5-25.5-25.5zM217.4 433.7c-11.2 0-20.4 9.2-20.4 20.4v174.4c0 11.2 9.2 20.4 20.4 20.4s20.4-9.2 20.4-20.4V454.1c0-11.2-9.2-20.4-20.4-20.4z"
fill="#6B400D" p-id="5244"></path>
<path d="M878.7 379.5v-86c0-96.3-57.5-153.7-153.7-153.7H218c-96.3 0-153.7 57.5-153.7 153.7v320.7C64.3 710.5 121.8 768 218 768h45.8v120.4L449.9 768h11.2c17.2 11.3 39 17.5 64.6 17.5h161.6l130.7 85v-85.1h33.5c66.6 0 107.9-41.3 107.9-107.9V484.8c-0.1-56.9-30.3-95.3-80.7-105.3zM417.8 484.8v192.8c0 16.2 2.5 31 7.2 44l-106.1 70.1v-74.9h-101c-67.7-0.3-102.2-34.8-102.5-102.5V293.5c0.3-67.7 34.8-102.2 102.5-102.5H725c67.7 0.3 102.2 34.8 102.5 102.5v83.3H525.7c-66.5 0.1-107.9 41.4-107.9 108z m490.4 192.7c-0.2 38.6-18.2 56.6-56.7 56.7h-87.2v40.3l-61-40.3H525.7c-38.5-0.2-56.6-18.2-56.7-56.7V484.8c0.2-38.6 18.2-56.6 56.7-56.7h325.7c38.5 0.2 56.6 18.2 56.7 56.7v192.7z"
fill="#6B400D" p-id="5245"></path>
<path d="M851.4 428.1H525.7c-38.5 0.2-56.6 18.2-56.7 56.7v192.8c0.2 38.5 18.2 56.6 56.7 56.7h177.5l61 40.3v-40.3h87.2c38.5-0.2 56.6-18.2 56.7-56.7V484.8c-0.1-38.6-18.1-56.6-56.7-56.7zM567 627.4c-21.1 0-38.3-17.2-38.3-38.3 0-21.1 17.2-38.3 38.3-38.3 21.1 0 38.3 17.2 38.3 38.3 0 21.1-17.2 38.3-38.3 38.3z m122.2 0c-21.1 0-38.3-17.2-38.3-38.3 0-21.1 17.2-38.3 38.3-38.3 21.1 0 38.3 17.2 38.3 38.3 0 21.1-17.2 38.3-38.3 38.3z m122.3 0c-21.1 0-38.3-17.2-38.3-38.3 0-21.1 17.2-38.3 38.3-38.3 21.1 0 38.3 17.2 38.3 38.3 0 21.1-17.2 38.3-38.3 38.3z"
fill="#FFD524" p-id="5246"></path>
<path d="M567 550.8c-21.1 0-38.3 17.2-38.3 38.3 0 21.1 17.2 38.3 38.3 38.3 21.1 0 38.3-17.2 38.3-38.3 0-21.1-17.2-38.3-38.3-38.3zM689.2 550.8c-21.1 0-38.3 17.2-38.3 38.3 0 21.1 17.2 38.3 38.3 38.3 21.1 0 38.3-17.2 38.3-38.3 0-21.1-17.2-38.3-38.3-38.3zM811.5 550.8c-21.1 0-38.3 17.2-38.3 38.3 0 21.1 17.2 38.3 38.3 38.3 21.1 0 38.3-17.2 38.3-38.3 0-21.1-17.2-38.3-38.3-38.3z"
fill="#6B400D" p-id="5247"></path>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704295160809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4268" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M922.344176 152.209186v-0.050575c0-0.765851-0.0867-1.517251-0.130051-2.283101-0.036125-0.67915-0.04335-1.365526-0.108375-2.037452-0.0867-0.794751-0.2312-1.553376-0.36125-2.333676-0.07225-0.455175-0.122825-0.917576-0.209525-1.379976l-0.04335-0.296226-0.050575-0.281775c-0.15895-0.794751-0.397375-1.553376-0.599676-2.333677-0.15895-0.6069-0.289-1.228251-0.469625-1.820701-0.2601-0.816426-0.585225-1.618401-0.888676-2.420377l-0.27455-0.758625-0.166175-0.455176-0.13005-0.325125c-0.354025-0.830876-0.758626-1.625626-1.163226-2.427602-0.223975-0.455175-0.41905-0.917576-0.6647-1.358301-0.4335-0.801976-0.924801-1.553376-1.401651-2.319226-0.1445-0.223975-0.267325-0.4624-0.411826-0.671926-0.0867-0.13005-0.151725-0.267325-0.238425-0.397375l-0.1156-0.1734c-0.50575-0.751401-1.062076-1.445001-1.611176-2.153052-0.30345-0.39015-0.578-0.801976-0.888676-1.184901-0.556325-0.6647-1.163226-1.293276-1.755676-1.929076-0.354025-0.382925-0.67915-0.780301-1.040401-1.141551l-0.065025-0.065025-0.01445-0.021675-0.07225-0.0578c-0.527425-0.527425-1.098201-1.004276-1.668976-1.510026-0.426275-0.3757-0.823651-0.780301-1.271601-1.148776-0.599675-0.4913-1.249926-0.932026-1.878501-1.401651-0.484075-0.36125-0.953701-0.744176-1.452226-1.083751a5.086404 5.086404 0 0 1-0.332351-0.2023l-0.53465-0.310675a26.70362 26.70362 0 0 0-1.141551-0.693601c-0.5202-0.3179-1.025951-0.657475-1.567826-0.9537-0.67915-0.368475-1.394426-0.671925-2.095252-1.004276-0.56355-0.267325-1.112651-0.570775-1.690651-0.809201-0.151725-0.07225-0.325125-0.122825-0.4913-0.180625-0.18785-0.079475-0.39015-0.137275-0.578001-0.223975l-1.018725-0.368475c-0.628575-0.223975-1.242701-0.484075-1.892952-0.693601-0.643025-0.18785-1.307726-0.325125-1.965201-0.4913-0.729726-0.195075-1.445001-0.41905-2.189177-0.563551-0.151725-0.036125-0.310675-0.036125-0.4624-0.065025l-0.426275-0.07225c-0.527425-0.10115-1.069301-0.166175-1.618402-0.238425-0.599675-0.093925-1.184901-0.21675-1.784576-0.281775a42.772031 42.772031 0 0 0-4.428928-0.223975h-0.151725l-343.079377 1.235476a43.350032 43.350032 0 0 0 0.151726 86.700063h0.151725l238.417949-0.867-156.76094 157.895265c-53.710689-42.179581-121.170564-67.467099-194.150342-67.467099l-4.219403 0.021675c-174.093728 2.290327-313.85423 145.786157-311.563903 319.858209 2.261427 171.817851 143.849855 311.592803 315.631581 311.592803l4.219403-0.0289c84.330262-1.105426 163.18397-34.983476 222.031638-95.39897 58.854893-60.415494 90.644916-140.136203 89.532265-224.452014-0.881451-67.82835-23.553517-130.613646-61.159669-181.831708l157.61349-158.747816V495.418613a43.350032 43.350032 0 0 0 86.700064 0V152.346462v-0.050575-0.086701zM577.198448 751.978551c-39.990404 41.06693-93.585494 64.085797-150.901461 64.844422l-2.890002 0.01445c-116.73441 0-212.957031-95.001595-214.495957-211.77213C207.357652 486.748607 302.352021 389.23271 420.668708 387.672109l2.890002-0.007225c116.741636 0 212.971481 94.99437 214.488732 211.779355 0.758626 57.301517-20.851365 111.474607-60.848994 152.534312z" fill="#1296db" p-id="4269"></path></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699701710499" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7220"
width="16" height="16">
<path d="M956 807.2 657.6 807.2c-16.8 0-29.6-13.6-29.6-29.6 0-16.8 13.6-29.6 29.6-29.6l299.2 0c16.8 0 29.6 13.6 29.6 29.6C986.4 793.6 972.8 807.2 956 807.2zM956 627.2 657.6 627.2c-16.8 0-29.6-13.6-29.6-29.6 0-16.8 13.6-29.6 29.6-29.6l299.2 0c16.8 0 29.6 13.6 29.6 29.6C986.4 614.4 972.8 627.2 956 627.2zM508 564.8 508 568c-198.4 0-358.4 173.6-358.4 388.8 0 10.4 0.8 20 1.6 29.6l-1.6 0L31.2 986.4c-0.8-9.6-1.6-20-1.6-29.6 0-201.6 110.4-375.2 270.4-456.8-55.2-49.6-91.2-120-91.2-200 0-148.8 120.8-268.8 268.8-268.8 148.8 0 268.8 120.8 268.8 268.8C747.2 436.8 642.4 549.6 508 564.8zM478.4 149.6c-82.4 0-149.6 67.2-149.6 149.6S396 448 478.4 448s149.6-67.2 149.6-149.6S560.8 149.6 478.4 149.6zM657.6 926.4l299.2 0c16.8 0 29.6 13.6 29.6 29.6 0 16.8-13.6 29.6-29.6 29.6L657.6 985.6c-16.8 0-29.6-13.6-29.6-29.6C627.2 940 640.8 926.4 657.6 926.4z"
p-id="7221"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562413637" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21315" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M781.28 425.28v377.12H290.4V445.12c0-10.88 10.88-19.68 24.32-19.68h466.56z" fill="#B3C8FE" p-id="21316"></path><path d="M561.44 361.76h171.2v185.76h48.64V337.44c0-13.44-10.88-24.32-24.32-24.32H533.92l-78.4-88.32c-4.64-5.28-11.2-8.16-18.24-8.16H204.96c-13.44 0-24.32 10.88-24.32 24.32v537.28c0 13.44 10.88 24.32 24.32 24.32h278.08v-48.64H229.28V265.12h197.12l78.4 88.32c4.64 5.28 11.2 8.16 18.24 8.16l38.4 0.16z" fill="#5186F5" p-id="21317"></path><path d="M804.32 695.2l-77.92-77.92-34.4 34.4L728.16 688h-152.32v-95.04h-48.64v119.36c0 13.44 10.88 24.32 24.32 24.32h176.64l-36.32 36.32 34.4 34.4 77.92-77.92c9.6-9.28 9.6-24.8 0.16-34.24z" fill="#5186F5" p-id="21318"></path></svg>

After

Width:  |  Height:  |  Size: 1011 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1699272892992" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4188"
width="16" height="16">
<path d="M182.857143 146.285714h360.594286L768 370.834286V438.857143h146.285714V310.125714L604.16 0H36.571429v1024h877.714285v-146.285714H182.857143V146.285714z"
fill="#272536" p-id="4189"></path>
<path d="M987.428571 658.285714l-219.428571-146.285714v73.142857H475.428571v146.285714h292.571429v73.142858l219.428571-146.285715z"
fill="#272536" p-id="4190"></path>
</svg>

After

Width:  |  Height:  |  Size: 692 B

View File

@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/icons">
<file>logo.svg</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,202 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x09\x14\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\x6e\
\x6f\x22\x3f\x3e\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\x76\
\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\x43\
\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\x45\
\x4e\x22\x0d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22\x68\x74\x74\
\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x47\
\x72\x61\x70\x68\x69\x63\x73\x2f\x53\x56\x47\x2f\x31\x2e\x31\x2f\
\x44\x54\x44\x2f\x73\x76\x67\x31\x31\x2e\x64\x74\x64\x22\x3e\x0d\
\x0a\x3c\x73\x76\x67\x20\x74\x3d\x22\x31\x36\x39\x38\x35\x39\x32\
\x30\x39\x35\x34\x39\x36\x22\x20\x63\x6c\x61\x73\x73\x3d\x22\x69\
\x63\x6f\x6e\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
\x30\x20\x31\x30\x32\x34\x20\x31\x30\x32\x34\x22\x20\x76\x65\x72\
\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x78\x6d\x6c\x6e\x73\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\
\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x70\x2d\
\x69\x64\x3d\x22\x35\x32\x34\x33\x22\x0d\x0a\x20\x20\x20\x20\x20\
\x77\x69\x64\x74\x68\x3d\x22\x31\x36\x22\x20\x68\x65\x69\x67\x68\
\x74\x3d\x22\x31\x36\x22\x3e\x0d\x0a\x20\x20\x20\x20\x3c\x70\x61\
\x74\x68\x20\x64\x3d\x22\x4d\x32\x31\x37\x2e\x39\x20\x33\x35\x36\
\x2e\x35\x63\x2d\x31\x34\x2e\x31\x20\x30\x2d\x32\x35\x2e\x35\x20\
\x31\x31\x2e\x34\x2d\x32\x35\x2e\x35\x20\x32\x35\x2e\x35\x73\x31\
\x31\x2e\x34\x20\x32\x35\x2e\x35\x20\x32\x35\x2e\x35\x20\x32\x35\
\x2e\x35\x20\x32\x35\x2e\x35\x2d\x31\x31\x2e\x34\x20\x32\x35\x2e\
\x35\x2d\x32\x35\x2e\x35\x2d\x31\x31\x2e\x34\x2d\x32\x35\x2e\x35\
\x2d\x32\x35\x2e\x35\x2d\x32\x35\x2e\x35\x7a\x4d\x32\x31\x37\x2e\
\x34\x20\x34\x33\x33\x2e\x37\x63\x2d\x31\x31\x2e\x32\x20\x30\x2d\
\x32\x30\x2e\x34\x20\x39\x2e\x32\x2d\x32\x30\x2e\x34\x20\x32\x30\
\x2e\x34\x76\x31\x37\x34\x2e\x34\x63\x30\x20\x31\x31\x2e\x32\x20\
\x39\x2e\x32\x20\x32\x30\x2e\x34\x20\x32\x30\x2e\x34\x20\x32\x30\
\x2e\x34\x73\x32\x30\x2e\x34\x2d\x39\x2e\x32\x20\x32\x30\x2e\x34\
\x2d\x32\x30\x2e\x34\x56\x34\x35\x34\x2e\x31\x63\x30\x2d\x31\x31\
\x2e\x32\x2d\x39\x2e\x32\x2d\x32\x30\x2e\x34\x2d\x32\x30\x2e\x34\
\x2d\x32\x30\x2e\x34\x7a\x22\x0d\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x66\x69\x6c\x6c\x3d\x22\x23\x36\x42\x34\x30\x30\x44\
\x22\x20\x70\x2d\x69\x64\x3d\x22\x35\x32\x34\x34\x22\x3e\x3c\x2f\
\x70\x61\x74\x68\x3e\x0d\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\
\x20\x64\x3d\x22\x4d\x38\x37\x38\x2e\x37\x20\x33\x37\x39\x2e\x35\
\x76\x2d\x38\x36\x63\x30\x2d\x39\x36\x2e\x33\x2d\x35\x37\x2e\x35\
\x2d\x31\x35\x33\x2e\x37\x2d\x31\x35\x33\x2e\x37\x2d\x31\x35\x33\
\x2e\x37\x48\x32\x31\x38\x63\x2d\x39\x36\x2e\x33\x20\x30\x2d\x31\
\x35\x33\x2e\x37\x20\x35\x37\x2e\x35\x2d\x31\x35\x33\x2e\x37\x20\
\x31\x35\x33\x2e\x37\x76\x33\x32\x30\x2e\x37\x43\x36\x34\x2e\x33\
\x20\x37\x31\x30\x2e\x35\x20\x31\x32\x31\x2e\x38\x20\x37\x36\x38\
\x20\x32\x31\x38\x20\x37\x36\x38\x68\x34\x35\x2e\x38\x76\x31\x32\
\x30\x2e\x34\x4c\x34\x34\x39\x2e\x39\x20\x37\x36\x38\x68\x31\x31\
\x2e\x32\x63\x31\x37\x2e\x32\x20\x31\x31\x2e\x33\x20\x33\x39\x20\
\x31\x37\x2e\x35\x20\x36\x34\x2e\x36\x20\x31\x37\x2e\x35\x68\x31\
\x36\x31\x2e\x36\x6c\x31\x33\x30\x2e\x37\x20\x38\x35\x76\x2d\x38\
\x35\x2e\x31\x68\x33\x33\x2e\x35\x63\x36\x36\x2e\x36\x20\x30\x20\
\x31\x30\x37\x2e\x39\x2d\x34\x31\x2e\x33\x20\x31\x30\x37\x2e\x39\
\x2d\x31\x30\x37\x2e\x39\x56\x34\x38\x34\x2e\x38\x63\x2d\x30\x2e\
\x31\x2d\x35\x36\x2e\x39\x2d\x33\x30\x2e\x33\x2d\x39\x35\x2e\x33\
\x2d\x38\x30\x2e\x37\x2d\x31\x30\x35\x2e\x33\x7a\x4d\x34\x31\x37\
\x2e\x38\x20\x34\x38\x34\x2e\x38\x76\x31\x39\x32\x2e\x38\x63\x30\
\x20\x31\x36\x2e\x32\x20\x32\x2e\x35\x20\x33\x31\x20\x37\x2e\x32\
\x20\x34\x34\x6c\x2d\x31\x30\x36\x2e\x31\x20\x37\x30\x2e\x31\x76\
\x2d\x37\x34\x2e\x39\x68\x2d\x31\x30\x31\x63\x2d\x36\x37\x2e\x37\
\x2d\x30\x2e\x33\x2d\x31\x30\x32\x2e\x32\x2d\x33\x34\x2e\x38\x2d\
\x31\x30\x32\x2e\x35\x2d\x31\x30\x32\x2e\x35\x56\x32\x39\x33\x2e\
\x35\x63\x30\x2e\x33\x2d\x36\x37\x2e\x37\x20\x33\x34\x2e\x38\x2d\
\x31\x30\x32\x2e\x32\x20\x31\x30\x32\x2e\x35\x2d\x31\x30\x32\x2e\
\x35\x48\x37\x32\x35\x63\x36\x37\x2e\x37\x20\x30\x2e\x33\x20\x31\
\x30\x32\x2e\x32\x20\x33\x34\x2e\x38\x20\x31\x30\x32\x2e\x35\x20\
\x31\x30\x32\x2e\x35\x76\x38\x33\x2e\x33\x48\x35\x32\x35\x2e\x37\
\x63\x2d\x36\x36\x2e\x35\x20\x30\x2e\x31\x2d\x31\x30\x37\x2e\x39\
\x20\x34\x31\x2e\x34\x2d\x31\x30\x37\x2e\x39\x20\x31\x30\x38\x7a\
\x20\x6d\x34\x39\x30\x2e\x34\x20\x31\x39\x32\x2e\x37\x63\x2d\x30\
\x2e\x32\x20\x33\x38\x2e\x36\x2d\x31\x38\x2e\x32\x20\x35\x36\x2e\
\x36\x2d\x35\x36\x2e\x37\x20\x35\x36\x2e\x37\x68\x2d\x38\x37\x2e\
\x32\x76\x34\x30\x2e\x33\x6c\x2d\x36\x31\x2d\x34\x30\x2e\x33\x48\
\x35\x32\x35\x2e\x37\x63\x2d\x33\x38\x2e\x35\x2d\x30\x2e\x32\x2d\
\x35\x36\x2e\x36\x2d\x31\x38\x2e\x32\x2d\x35\x36\x2e\x37\x2d\x35\
\x36\x2e\x37\x56\x34\x38\x34\x2e\x38\x63\x30\x2e\x32\x2d\x33\x38\
\x2e\x36\x20\x31\x38\x2e\x32\x2d\x35\x36\x2e\x36\x20\x35\x36\x2e\
\x37\x2d\x35\x36\x2e\x37\x68\x33\x32\x35\x2e\x37\x63\x33\x38\x2e\
\x35\x20\x30\x2e\x32\x20\x35\x36\x2e\x36\x20\x31\x38\x2e\x32\x20\
\x35\x36\x2e\x37\x20\x35\x36\x2e\x37\x76\x31\x39\x32\x2e\x37\x7a\
\x22\x0d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x69\x6c\
\x6c\x3d\x22\x23\x36\x42\x34\x30\x30\x44\x22\x20\x70\x2d\x69\x64\
\x3d\x22\x35\x32\x34\x35\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x0d\
\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x38\
\x35\x31\x2e\x34\x20\x34\x32\x38\x2e\x31\x48\x35\x32\x35\x2e\x37\
\x63\x2d\x33\x38\x2e\x35\x20\x30\x2e\x32\x2d\x35\x36\x2e\x36\x20\
\x31\x38\x2e\x32\x2d\x35\x36\x2e\x37\x20\x35\x36\x2e\x37\x76\x31\
\x39\x32\x2e\x38\x63\x30\x2e\x32\x20\x33\x38\x2e\x35\x20\x31\x38\
\x2e\x32\x20\x35\x36\x2e\x36\x20\x35\x36\x2e\x37\x20\x35\x36\x2e\
\x37\x68\x31\x37\x37\x2e\x35\x6c\x36\x31\x20\x34\x30\x2e\x33\x76\
\x2d\x34\x30\x2e\x33\x68\x38\x37\x2e\x32\x63\x33\x38\x2e\x35\x2d\
\x30\x2e\x32\x20\x35\x36\x2e\x36\x2d\x31\x38\x2e\x32\x20\x35\x36\
\x2e\x37\x2d\x35\x36\x2e\x37\x56\x34\x38\x34\x2e\x38\x63\x2d\x30\
\x2e\x31\x2d\x33\x38\x2e\x36\x2d\x31\x38\x2e\x31\x2d\x35\x36\x2e\
\x36\x2d\x35\x36\x2e\x37\x2d\x35\x36\x2e\x37\x7a\x4d\x35\x36\x37\
\x20\x36\x32\x37\x2e\x34\x63\x2d\x32\x31\x2e\x31\x20\x30\x2d\x33\
\x38\x2e\x33\x2d\x31\x37\x2e\x32\x2d\x33\x38\x2e\x33\x2d\x33\x38\
\x2e\x33\x20\x30\x2d\x32\x31\x2e\x31\x20\x31\x37\x2e\x32\x2d\x33\
\x38\x2e\x33\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x32\x31\
\x2e\x31\x20\x30\x20\x33\x38\x2e\x33\x20\x31\x37\x2e\x32\x20\x33\
\x38\x2e\x33\x20\x33\x38\x2e\x33\x20\x30\x20\x32\x31\x2e\x31\x2d\
\x31\x37\x2e\x32\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x33\
\x38\x2e\x33\x7a\x20\x6d\x31\x32\x32\x2e\x32\x20\x30\x63\x2d\x32\
\x31\x2e\x31\x20\x30\x2d\x33\x38\x2e\x33\x2d\x31\x37\x2e\x32\x2d\
\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x30\x2d\x32\x31\x2e\x31\
\x20\x31\x37\x2e\x32\x2d\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x2d\
\x33\x38\x2e\x33\x20\x32\x31\x2e\x31\x20\x30\x20\x33\x38\x2e\x33\
\x20\x31\x37\x2e\x32\x20\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x20\
\x30\x20\x32\x31\x2e\x31\x2d\x31\x37\x2e\x32\x20\x33\x38\x2e\x33\
\x2d\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x7a\x20\x6d\x31\x32\x32\
\x2e\x33\x20\x30\x63\x2d\x32\x31\x2e\x31\x20\x30\x2d\x33\x38\x2e\
\x33\x2d\x31\x37\x2e\x32\x2d\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\
\x20\x30\x2d\x32\x31\x2e\x31\x20\x31\x37\x2e\x32\x2d\x33\x38\x2e\
\x33\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x32\x31\x2e\x31\
\x20\x30\x20\x33\x38\x2e\x33\x20\x31\x37\x2e\x32\x20\x33\x38\x2e\
\x33\x20\x33\x38\x2e\x33\x20\x30\x20\x32\x31\x2e\x31\x2d\x31\x37\
\x2e\x32\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x33\x38\x2e\
\x33\x7a\x22\x0d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\
\x69\x6c\x6c\x3d\x22\x23\x46\x46\x44\x35\x32\x34\x22\x20\x70\x2d\
\x69\x64\x3d\x22\x35\x32\x34\x36\x22\x3e\x3c\x2f\x70\x61\x74\x68\
\x3e\x0d\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\
\x4d\x35\x36\x37\x20\x35\x35\x30\x2e\x38\x63\x2d\x32\x31\x2e\x31\
\x20\x30\x2d\x33\x38\x2e\x33\x20\x31\x37\x2e\x32\x2d\x33\x38\x2e\
\x33\x20\x33\x38\x2e\x33\x20\x30\x20\x32\x31\x2e\x31\x20\x31\x37\
\x2e\x32\x20\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x20\x33\x38\x2e\
\x33\x20\x32\x31\x2e\x31\x20\x30\x20\x33\x38\x2e\x33\x2d\x31\x37\
\x2e\x32\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x20\x30\x2d\x32\
\x31\x2e\x31\x2d\x31\x37\x2e\x32\x2d\x33\x38\x2e\x33\x2d\x33\x38\
\x2e\x33\x2d\x33\x38\x2e\x33\x7a\x4d\x36\x38\x39\x2e\x32\x20\x35\
\x35\x30\x2e\x38\x63\x2d\x32\x31\x2e\x31\x20\x30\x2d\x33\x38\x2e\
\x33\x20\x31\x37\x2e\x32\x2d\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\
\x20\x30\x20\x32\x31\x2e\x31\x20\x31\x37\x2e\x32\x20\x33\x38\x2e\
\x33\x20\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x20\x32\x31\x2e\x31\
\x20\x30\x20\x33\x38\x2e\x33\x2d\x31\x37\x2e\x32\x20\x33\x38\x2e\
\x33\x2d\x33\x38\x2e\x33\x20\x30\x2d\x32\x31\x2e\x31\x2d\x31\x37\
\x2e\x32\x2d\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x2d\x33\x38\x2e\
\x33\x7a\x4d\x38\x31\x31\x2e\x35\x20\x35\x35\x30\x2e\x38\x63\x2d\
\x32\x31\x2e\x31\x20\x30\x2d\x33\x38\x2e\x33\x20\x31\x37\x2e\x32\
\x2d\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\x20\x30\x20\x32\x31\x2e\
\x31\x20\x31\x37\x2e\x32\x20\x33\x38\x2e\x33\x20\x33\x38\x2e\x33\
\x20\x33\x38\x2e\x33\x20\x32\x31\x2e\x31\x20\x30\x20\x33\x38\x2e\
\x33\x2d\x31\x37\x2e\x32\x20\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\
\x20\x30\x2d\x32\x31\x2e\x31\x2d\x31\x37\x2e\x32\x2d\x33\x38\x2e\
\x33\x2d\x33\x38\x2e\x33\x2d\x33\x38\x2e\x33\x7a\x22\x0d\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x69\x6c\x6c\x3d\x22\x23\
\x36\x42\x34\x30\x30\x44\x22\x20\x70\x2d\x69\x64\x3d\x22\x35\x32\
\x34\x37\x22\x3e\x3c\x2f\x70\x61\x74\x68\x3e\x0d\x0a\x3c\x2f\x73\
\x76\x67\x3e\
"
qt_resource_name = b"\
\x00\x05\
\x00\x6f\xa6\x53\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x08\
\x05\xe2\x54\xa7\
\x00\x6c\
\x00\x6f\x00\x67\x00\x6f\x00\x2e\x00\x73\x00\x76\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x8c\x16\x33\xc3\xa6\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706191321830" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9915" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M416 192C537.6 192 640 294.4 640 416S537.6 640 416 640 192 537.6 192 416 294.4 192 416 192M416 128C256 128 128 256 128 416S256 704 416 704 704 576 704 416 576 128 416 128L416 128z" fill="#272636" p-id="9916"></path><path d="M832 864c-6.4 0-19.2 0-25.6-6.4l-192-192c-12.8-12.8-12.8-32 0-44.8s32-12.8 44.8 0l192 192c12.8 12.8 12.8 32 0 44.8C851.2 864 838.4 864 832 864z" fill="#272636" p-id="9917"></path></svg>

After

Width:  |  Height:  |  Size: 740 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704806879008" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8579" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512 128c211.2 0 384 172.8 384 384s-172.8 384-384 384-384-172.8-384-384 172.8-384 384-384m0-64C262.4 64 64 262.4 64 512s198.4 448 448 448 448-198.4 448-448-198.4-448-448-448z" fill="#1296db" p-id="8580"></path><path d="M448 704c-12.8 0-25.6-6.4-32-12.8L313.6 588.8c-12.8-12.8-12.8-32 0-44.8s32-12.8 44.8 0L448 633.6l275.2-275.2c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8l-288 288c-6.4 12.8-19.2 12.8-32 12.8z" fill="#1296db" p-id="8581"></path></svg>

After

Width:  |  Height:  |  Size: 788 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562784487" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="26032" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M380.677 176.279l390.182 225.272c85.024 49.089 85.024 171.81 0 220.899L380.677 847.721c-85.024 49.089-191.304-12.272-191.304-110.449V286.728c0-98.177 106.28-159.538 191.304-110.449z" fill="#FF7B15" p-id="26033"></path></svg>

After

Width:  |  Height:  |  Size: 556 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702562083657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5392" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M0 0m0 0l1024 0q0 0 0 0l0 1024q0 0 0 0l-1024 0q0 0 0 0l0-1024q0 0 0 0Z" fill="#E8EFF8" p-id="5393"></path><path d="M141.637818 405.643636A23.272727 23.272727 0 0 0 160.814545 442.181818h350.487273a23.272727 23.272727 0 0 0 18.455273-37.469091L364.683636 190.161455a46.545455 46.545455 0 0 0-75.170909 1.88509l-147.874909 213.620364z" fill="#69CB91" p-id="5394"></path><path d="M337.454545 884.363636a174.545455 174.545455 0 1 0 0-349.090909 174.545455 174.545455 0 0 0 0 349.090909z" fill="#247ADE" p-id="5395"></path><path d="M907.636364 186.181818a23.272727 23.272727 0 0 0-23.272728-23.272727h-209.454545a23.272727 23.272727 0 0 0-23.272727 23.272727v674.909091a23.272727 23.272727 0 0 0 23.272727 23.272727h209.454545a23.272727 23.272727 0 0 0 23.272728-23.272727V186.181818z" fill="#A0BFF7" p-id="5396"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702554736273" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4304" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#FCCC5A" p-id="4305"></path><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#FFD980" p-id="4306"></path><path d="M347.434667 420.565333V486.4h118.855111v288.910222h91.420444V486.4h118.855111v-65.834667z" fill="#FFFFFF" p-id="4307"></path></svg>

After

Width:  |  Height:  |  Size: 885 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704806899964" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9066" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512 128c211.2 0 384 172.8 384 384S723.2 896 512 896 128 723.2 128 512s172.8-384 384-384m0-64C262.4 64 64 262.4 64 512s198.4 448 448 448 448-198.4 448-448S761.6 64 512 64z" fill="#515151" p-id="9067"></path></svg>

After

Width:  |  Height:  |  Size: 544 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706096206963" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8303" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M936.170667 669.952L534.613333 268.394667a32 32 0 0 0-42.986666-2.069334l-2.282667 2.069334L87.829333 669.952a8.533333 8.533333 0 0 0-2.496 6.037333v66.346667a8.533333 8.533333 0 0 0 14.570667 6.058667l412.074667-412.096 412.117333 412.096a8.533333 8.533333 0 0 0 14.570667-6.037334v-66.346666a8.533333 8.533333 0 0 0-2.496-6.058667z" fill="#333333" p-id="8304"></path></svg>

After

Width:  |  Height:  |  Size: 706 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706094276810" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5249" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M549.546667 320v176.64l124.586666 124.586667a21.333333 21.333333 0 0 1 0 30.293333l-22.613333 22.613333a21.333333 21.333333 0 0 1-30.293333 0l-140.373334-140.373333a22.613333 22.613333 0 0 1-6.4-14.933333V320a21.333333 21.333333 0 0 1 21.333334-21.333333h32.426666a21.333333 21.333333 0 0 1 21.333334 21.333333z m346.453333 85.333333v-213.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-12.373334a20.906667 20.906667 0 0 0-15.36 6.4l-63.573333 63.573333A384 384 0 1 0 896 534.613333a21.333333 21.333333 0 0 0-5.546667-15.786666 22.186667 22.186667 0 0 0-15.36-6.826667h-42.666666a21.333333 21.333333 0 0 0-21.333334 20.053333A298.666667 298.666667 0 1 1 512 213.333333a295.68 295.68 0 0 1 210.346667 88.32l-75.946667 75.946667a20.906667 20.906667 0 0 0-6.4 15.36v12.373333a21.333333 21.333333 0 0 0 21.333333 21.333334h213.333334a21.333333 21.333333 0 0 0 21.333333-21.333334z" p-id="5250" fill="#d81e06"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1704295202245" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5558" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M870.69952 153.30048c-66.10688-66.10944-154.00448-102.51776-247.49696-102.51904-93.49248 0-181.3888 36.40832-247.49696 102.51648-66.11072 66.10944-102.51648 154.00576-102.51648 247.49952-0.00128 76.19968 24.19072 148.6784 68.93056 208.67584l-60.2048 60.20352L138.18496 525.94688c-19.99488-19.99488-52.41216-19.99488-72.40704 0-19.99488 19.9936-19.99488 52.41216 0 72.40704l143.72992 143.72992-55.75552 55.75552c-19.9936 19.9936-19.9936 52.41216 0 72.40576 19.99616 19.99616 52.41344 19.99488 72.40832 0l55.75424-55.75424 143.7312 143.72992c19.9936 19.99488 52.41088 19.99488 72.40576 0 19.99616-19.99488 19.99616-52.41216 0-72.40704L354.32192 742.08512l60.2048-60.20352c59.99872 44.73856 132.47616 68.93184 208.67584 68.93184 93.49248 0 181.38752-36.40832 247.49696-102.51776s102.51776-154.00576 102.51776-247.49824C973.21728 307.30496 936.80768 219.40736 870.69952 153.30048zM798.29248 575.88736c-46.76736 46.76736-108.94976 72.5248-175.08992 72.5248s-128.32128-25.75744-175.08992-72.5248c-46.76864-46.76736-72.5248-108.94976-72.5248-175.08992 0.00128-66.14272 25.75616-128.32384 72.5248-175.0912 46.76736-46.76864 108.94976-72.5248 175.08992-72.5248 66.14016 0.00128 128.32256 25.75744 175.08992 72.52608 46.76736 46.76736 72.5248 108.94848 72.5248 175.08864C870.81728 466.9376 845.0624 529.11872 798.29248 575.88736z" fill="#d81e06" p-id="5559"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1698328304971" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2624"
width="16" height="16">
<path d="M1024 298.666667V85.333333c0-25.6-17.066667-42.666667-42.666667-42.666666H298.666667c-25.6 0-42.666667 17.066667-42.666667 42.666666v213.333334l384 85.333333 384-85.333333z"
fill="#41A5EE" p-id="2625"></path>
<path d="M1024 298.666667H256v213.333333l405.333333 85.333333 362.666667-85.333333z" fill="#2B7CD3"
p-id="2626"></path>
<path d="M1024 512H256v213.333333l384 64 384-64z" fill="#185ABD" p-id="2627"></path>
<path d="M1024 725.333333H256v213.333334c0 25.6 17.066667 42.666667 42.666667 42.666666h682.666666c25.6 0 42.666667-17.066667 42.666667-42.666666v-213.333334z"
fill="#103F91" p-id="2628"></path>
<path d="M588.8 256H256v597.333333h324.266667c29.866667 0 59.733333-29.866667 59.733333-59.733333V307.2c0-29.866667-21.333333-51.2-51.2-51.2z"
opacity=".5" p-id="2629"></path>
<path d="M546.133333 810.666667H51.2C21.333333 810.666667 0 789.333333 0 759.466667V264.533333C0 234.666667 21.333333 213.333333 51.2 213.333333h499.2c25.6 0 46.933333 21.333333 46.933333 51.2v499.2c0 25.6-21.333333 46.933333-51.2 46.933334z"
fill="#185ABD" p-id="2630"></path>
<path d="M435.2 682.666667H371.2L298.666667 448 226.133333 682.666667H162.133333L93.866667 341.333333h59.733333l46.933333 238.933334 72.533334-230.4h51.2l68.266666 230.4L443.733333 341.333333h59.733334l-68.266667 341.333334z"
fill="#FFFFFF" p-id="2631"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705163866087" class="icon" viewBox="0 0 1792 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20689" xmlns:xlink="http://www.w3.org/1999/xlink" width="56" height="32"><path d="M320 192h1152a320 320 0 0 1 0 640H320A320 320 0 0 1 320 192z" fill="#CCCCCC" p-id="20690"></path><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FFFFFF" p-id="20691"></path></svg>

After

Width:  |  Height:  |  Size: 539 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705163839362" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15502" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M294.912 245.76C141.312 245.76 18.432 370.688 18.432 522.24 18.432 675.84 143.36 798.72 294.912 798.72h430.08c153.6 2.048 278.528-122.88 278.528-276.48C1003.52 370.688 878.592 245.76 727.04 245.76H294.912z m0 507.904c-126.976 0-231.424-102.4-231.424-231.424 0-126.976 102.4-231.424 231.424-231.424h430.08c126.976 0 231.424 102.4 231.424 231.424 0 126.976-102.4 231.424-231.424 231.424h-430.08z m174.08-231.424c0-94.208-75.776-169.984-169.984-169.984S131.072 430.08 131.072 522.24c0 94.208 75.776 169.984 169.984 169.984s167.936-75.776 167.936-169.984z m0 0" fill="#CCCCCC" p-id="15503"></path></svg>

After

Width:  |  Height:  |  Size: 931 B

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1705163819393" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="12840" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
<path fill="#e1e1e1" d="M699.7 284.2H326.3C200.2 284.2 98 386.4 98 512.4c0 126.1 102.2 228.3 228.3 228.3h373.5c126.1 0 228.3-102.2 228.3-228.3-0.1-126-102.3-228.2-228.4-228.2zM326.3 719.9c-114.6 0-207.5-92.9-207.5-207.5s92.9-207.5 207.5-207.5 207.5 92.9 207.5 207.5c-0.1 114.6-93 207.5-207.5 207.5z" p-id="12841">
</path>
</svg>

After

Width:  |  Height:  |  Size: 669 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705163901927" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24319" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M98 512.4c0 126.1 102.2 228.3 228.3 228.3h373.5c126.1 0 228.3-102.2 228.3-228.3 0-126.1-102.2-228.2-228.3-228.2H326.3C200.2 284.2 98 386.4 98 512.4z m394.3 0c0-114.6 92.9-207.5 207.5-207.5s207.5 92.9 207.5 207.5-92.9 207.5-207.5 207.5S492.3 627 492.3 512.4z" p-id="24320"></path></svg>

After

Width:  |  Height:  |  Size: 617 B

18359
app/resources/resource_rc.py Normal file

File diff suppressed because it is too large Load Diff

45
app/ui/Icon.py Normal file
View File

@@ -0,0 +1,45 @@
from PyQt5.QtGui import QIcon
from app.resources import resource_rc
var = resource_rc.qt_resource_name
class Icon:
Default_avatar_path = ':/icons/icons/default_avatar.svg'
Default_image_path = ':/icons/icons/404.png'
logo_path = ':/icons/icons/logo99.png'
logo_ico_path = ':/icons/icons/logo3.0.ico'
MainWindow_Icon = QIcon(':/icons/icons/logo.svg')
Default_avatar = QIcon(Default_avatar_path)
Output = QIcon(':/icons/icons/output.svg')
Back = QIcon(':/icons/icons/back.svg')
ToDocx = QIcon(':/icons/icons/word.svg')
ToCSV = QIcon(':/icons/icons/csv.svg')
ToHTML = QIcon(':/icons/icons/html.svg')
ToTXT = QIcon(':/icons/icons/txt.svg')
Chat_Icon = QIcon(':/icons/icons/chat.svg')
Contact_Icon = QIcon(':/icons/icons/contact.svg')
MyInfo_Icon = QIcon(':/icons/icons/myinfo.svg')
Annual_Report_Icon = QIcon(':/icons/icons/annual_report.svg')
Analysis_Icon = QIcon(':/icons/icons/analysis.svg')
Emotion_Icon = QIcon(':/icons/icons/emotion.svg')
Search_Icon = QIcon(':/icons/icons/search.svg')
Tool_Icon = QIcon(':/icons/icons/tool.svg')
Home_Icon = QIcon(':/icons/icons/home.svg')
Help_Icon = QIcon(':/icons/icons/help.svg')
Get_info_Icon = QIcon(':/icons/icons/get_wx_info.svg')
Folder_Icon = QIcon(':/icons/icons/folder.svg')
Start_Icon = QIcon(':/icons/icons/start.svg')
Decrypt_Icon = QIcon(':/icons/icons/decrypt.svg')
Man_Icon_path = ':/icons/icons/man.svg'
Woman_Icon_path = ':/icons/icons/woman.svg'
Man_Icon = QIcon(':/icons/icons/man.svg')
Woman_Icon = QIcon(':/icons/icons/woman.svg')
Arrow_left_Icon = QIcon(':/icons/icons/arrow-left.svg')
Arrow_right_Icon = QIcon(':/icons/icons/arrow-right.svg')
Update_Icon = QIcon(':/icons/icons/update.svg')
Clear_Icon = QIcon(':/icons/icons/clear.svg')
# Man_Icon_pixmap = QPixmap(Man_Icon_path)
# Woman_Icon_pixmap = QPixmap(Woman_Icon_path)
# Logo_Icon = QIcon(':/icons/icons/logo.png')

105
app/ui/QSS/style.qss Normal file
View File

@@ -0,0 +1,105 @@
QWidget{
background: rgb(238,244,249);
}
/*去掉item虚线边框*/
QListWidget, QListView, QTreeWidget, QTreeView {
outline: 0px;
}
QMenu::item:selected {
color: black;
background: rgb(230, 235, 240);
}
/*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/
QListWidget {
min-width: 120px;
max-width: 380px;
color: black;
border:none;
}
QListWidget::item{
min-width: 80px;
max-width: 380px;
min-height: 60px;
max-height: 60px;
}
QListWidget::item:hover {
background: rgb(230, 235, 240);
}
/*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected {
background: rgb(230, 235, 240);
border-left: 2px solid rgb(62, 62, 62);
color: black;
font-weight: bold;
}
/*鼠标悬停颜色*/
HistoryPanel::item:hover {
background: rgb(52, 52, 52);
}
QCheckBox::indicator {
background: rgb(255, 255, 255);
Width:20px;
Height:20px;
border-radius: 10px
}
QCheckBox::indicator:unchecked{
Width:20px;
Height:20px;
image: url(:/icons/icons/unselect.svg);
}
QCheckBox::indicator:checked{
Width:20px;
Height:20px;
image: url(:/icons/icons/select.svg);
}
QScrollBar:vertical {
border-width: 0px;
border: none;
background:rgba(133, 135, 138, 0);
width:4px;
margin: 0px 0px 0px 0px;
}
QScrollBar::handle:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgb(133, 135, 138), stop: 0.5 rgb(133, 135, 138), stop:1 rgb(133, 135, 138));
min-height: 20px;
max-height: 20px;
margin: 0 0px 0 0px;
border-radius: 2px;
}
QScrollBar::add-line:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0));
height: 0px;
border: none;
subcontrol-position: bottom;
subcontrol-origin: margin;
}
QScrollBar::sub-line:vertical {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0));
height: 0 px;
border: none;
subcontrol-position: top;
subcontrol-origin: margin;
}
QScrollBar::sub-page:vertical {
background: rgba(133, 135, 138, 0);
}
QScrollBar::add-page:vertical {
background: rgba(133, 135, 138, 0);
}
QProgressBar{
height:22px;
text-align:center;
font-size:14px;
color:rgb(49, 218, 27);
border-radius:11px;
background:#EBEEF5;
}
QProgressBar::chunk{
border-radius:11px;
background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #99ffff,stop:1 #9900ff);
}

0
app/ui/__init__.py Normal file
View File

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

@@ -0,0 +1 @@
from .chat_window import ChatWindow

217
app/ui/chat/ai_chat.py Normal file
View File

@@ -0,0 +1,217 @@
import json
import sys
import time
import traceback
from urllib.parse import urljoin
import requests
from PyQt5.QtCore import QThread, pyqtSignal, QSize, Qt
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QHBoxLayout, QApplication, QTextBrowser, QMessageBox
from app import config
from app.config import SERVER_API_URL
from app.log import logger
from app.ui.Icon import Icon
try:
from .chatInfoUi import Ui_Form
except:
from chatInfoUi import Ui_Form
from app.components.bubble_message import BubbleMessage
from app.person import Me, ContactDefault
class Message(QWidget):
def __init__(self, is_send=False, text='', parent=None):
super().__init__(parent)
self.avatar = QLabel(self)
self.textBrowser = QTextBrowser(self)
self.textBrowser.setText(text)
layout = QHBoxLayout(self)
if is_send:
pixmap = Me().avatar.scaled(45, 45)
self.textBrowser.setLayoutDirection(Qt.RightToLeft)
self.textBrowser.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
self.avatar.setPixmap(pixmap)
layout.addWidget(self.textBrowser)
layout.addWidget(self.avatar)
else:
pixmap = QPixmap(Icon.Default_avatar_path).scaled(45, 45)
self.avatar.setPixmap(pixmap)
layout.addWidget(self.avatar)
layout.addWidget(self.textBrowser)
# self.textBrowser.setFixedHeight(int(self.textBrowser.document().size().height()))
self.textBrowser.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.avatar.setFixedSize(QSize(60, 60))
def append(self, text: str):
self.textBrowser.insertPlainText(text)
self.textBrowser.setFixedHeight(int(self.textBrowser.document().size().height()))
class AIChat(QWidget, Ui_Form):
def __init__(self, contact, parent=None):
super().__init__(parent)
self.now_message: Message = None
self.setupUi(self)
self.last_timestamp = 0
self.last_str_time = ''
self.last_pos = 0
self.contact = contact
self.init_ui()
self.show_chats()
self.pushButton.clicked.connect(self.send_msg)
self.toolButton.clicked.connect(self.tool)
self.btn_clear.clicked.connect(self.clear_dialog)
self.btn_clear.setIcon(Icon.Clear_Icon)
def init_ui(self):
self.textEdit.installEventFilter(self)
def tool(self):
QMessageBox.information(self, "温馨提示", "暂未接入聊天数据您可进行基础的AI对话后续更新敬请期待")
def chat(self, text):
self.now_message.append(text)
self.scrollArea.verticalScrollBar().setValue(self.scrollArea.verticalScrollBar().maximum())
def send_msg(self):
msg = self.textEdit.toPlainText().strip()
self.textEdit.setText('')
if not msg:
return
print(msg)
bubble_message = BubbleMessage(
msg,
Me().avatar,
1,
True,
)
self.verticalLayout_message.addWidget(bubble_message)
message1 = Message(False)
self.verticalLayout_message.addWidget(message1)
self.show_chat_thread.msg = msg
self.now_message = message1
self.show_chat_thread.start()
self.scrollArea.verticalScrollBar().setValue(self.scrollArea.verticalScrollBar().maximum())
def clear_dialog(self):
self.show_chat_thread.history = []
while self.verticalLayout_message.count():
item = self.verticalLayout_message.takeAt(0)
widget = item.widget()
if widget is not None:
widget.deleteLater()
else:
del item
def show_chats(self):
# return
self.show_chat_thread = AIChatThread()
self.show_chat_thread.msgSignal.connect(self.chat)
def update_history_messages(self):
print('开始发送信息')
message1 = Message(False)
msg = '你好!'
self.verticalLayout_message.addWidget(message1)
self.show_chat_thread.msg = msg
self.now_message = message1
self.show_chat_thread.start()
def add_message(self, message):
print('message', message)
# self.textBrowser.append(message)
self.textBrowser.insertPlainText(message)
self.textBrowser.setFixedHeight(int(self.textBrowser.document().size().height()))
def eventFilter(self, obj, event):
if obj == self.textEdit and event.type() == event.KeyPress:
key = event.key()
if key == 16777220: # 回车键的键值
self.send_msg()
self.textEdit.setText('')
return True
return super().eventFilter(obj, event)
class AIChatThread(QThread):
msgSignal = pyqtSignal(str)
showSingal = pyqtSignal(tuple)
finishSingal = pyqtSignal(int)
msg_id = 0
# heightSingal = pyqtSignal(int)
def __init__(self):
super().__init__()
self.msg = ''
self.history = []
def run(self) -> None:
url = urljoin(SERVER_API_URL, 'chat')
data = {
'username': Me().wxid,
'token': Me().token,
'version': config.version,
'messages': [
*self.history,
{
'role': 'user',
"content": self.msg
}
]
}
message = '''
幼儿园三班一共有35人上个月34人满勤。\n其中1月15日小明同学感冒了他的妈妈给他请了一天的病假。
'''
try:
# for s in message:
# self.msgSignal.emit(s)
# time.sleep(0.05)
# return
resp = requests.post(url, json=data, stream=True)
message = {
'role': 'user',
'content': self.msg
}
resp_message = {
'role': 'assistant',
'content': ''
}
if resp.status_code == 200:
for line in resp.iter_lines():
if line:
trunk = line.decode('utf-8')
try:
data = json.loads(trunk.strip('data: '))
answer = data.get('answer')
print(answer)
if isinstance(answer, str):
resp_message['content'] += answer
self.msgSignal.emit(answer)
except:
print(trunk)
resp_message['content'] += trunk
self.msgSignal.emit(trunk)
else:
print(resp.text)
error = resp.json().get('error')
logger.error(f'ai请求错误:{error}')
self.msgSignal.emit(error)
self.history.append(message)
self.history.append(resp_message)
except Exception as e:
error = str(e)
logger.error(f'ai请求错误:{error}{traceback.format_exc()}')
self.msgSignal.emit(error)
if __name__ == '__main__':
app = QApplication(sys.argv)
contact = ContactDefault('1')
dialog = AIChat(contact)
dialog.show()
sys.exit(app.exec_())

74
app/ui/chat/chatInfoUi.py Normal file
View File

@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chatInfoUi.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(817, 748)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_7.setSpacing(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.frame = QtWidgets.QFrame(Form)
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_reamrk = QtWidgets.QLabel(self.frame)
self.label_reamrk.setObjectName("label_reamrk")
self.horizontalLayout_2.addWidget(self.label_reamrk)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.btn_clear = QtWidgets.QPushButton(self.frame)
self.btn_clear.setObjectName("btn_clear")
self.horizontalLayout_2.addWidget(self.btn_clear)
self.toolButton = QtWidgets.QToolButton(self.frame)
self.toolButton.setObjectName("toolButton")
self.horizontalLayout_2.addWidget(self.toolButton)
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.scrollArea = QtWidgets.QScrollArea(self.frame)
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 799, 564))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.verticalLayout_message = QtWidgets.QVBoxLayout()
self.verticalLayout_message.setObjectName("verticalLayout_message")
self.verticalLayout_3.addLayout(self.verticalLayout_message)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.verticalLayout_2.addWidget(self.scrollArea)
self.textEdit = QtWidgets.QTextEdit(self.frame)
self.textEdit.setMaximumSize(QtCore.QSize(16777215, 100))
self.textEdit.setObjectName("textEdit")
self.verticalLayout_2.addWidget(self.textEdit)
self.pushButton = QtWidgets.QPushButton(self.frame)
self.pushButton.setObjectName("pushButton")
self.verticalLayout_2.addWidget(self.pushButton)
self.horizontalLayout_7.addWidget(self.frame)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.label_reamrk.setText(_translate("Form", "EmoAi"))
self.btn_clear.setText(_translate("Form", "清除对话"))
self.toolButton.setText(_translate("Form", "..."))
self.pushButton.setText(_translate("Form", "发送"))

66
app/ui/chat/chatUi.py Normal file
View File

@@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chatUi.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(840, 752)
Form.setStyleSheet("background: rgb(240, 240, 240);")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setSpacing(6)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(Form)
self.label.setText("")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.lineEdit = QtWidgets.QLineEdit(Form)
self.lineEdit.setMinimumSize(QtCore.QSize(200, 30))
self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215))
self.lineEdit.setStyleSheet("")
self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle)
self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit)
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setMinimumSize(QtCore.QSize(30, 0))
self.label_2.setText("")
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.listWidget = QtWidgets.QListWidget(Form)
self.listWidget.setMinimumSize(QtCore.QSize(250, 0))
self.listWidget.setMaximumSize(QtCore.QSize(250, 16777215))
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setObjectName("listWidget")
self.verticalLayout_2.addWidget(self.listWidget)
self.verticalLayout_2.setStretch(1, 1)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.stackedWidget = QtWidgets.QStackedWidget(Form)
self.stackedWidget.setObjectName("stackedWidget")
self.horizontalLayout_2.addWidget(self.stackedWidget)
self.horizontalLayout_2.setStretch(1, 1)
self.retranslateUi(Form)
self.stackedWidget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))

188
app/ui/chat/chat_info.py Normal file
View File

@@ -0,0 +1,188 @@
import traceback
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QHBoxLayout
from app.DataBase import msg_db, hard_link_db
from app.components.bubble_message import BubbleMessage, ChatWidget, Notice
from app.person import Me
from app.util import get_abs_path
from app.util.emoji import get_emoji
class ChatInfo(QWidget):
def __init__(self, contact, parent=None):
super().__init__(parent)
self.last_timestamp = 0
self.last_str_time = ''
self.last_pos = 0
self.contact = contact
self.init_ui()
self.show_chats()
def init_ui(self):
self.label_reamrk = QLabel(self.contact.remark)
self.hBoxLayout = QHBoxLayout()
self.hBoxLayout.addWidget(self.label_reamrk)
self.vBoxLayout = QVBoxLayout()
self.vBoxLayout.setSpacing(0)
self.vBoxLayout.addLayout(self.hBoxLayout)
self.chat_window = ChatWidget()
self.chat_window.scrollArea.verticalScrollBar().valueChanged.connect(self.verticalScrollBar)
self.vBoxLayout.addWidget(self.chat_window)
self.setLayout(self.vBoxLayout)
def show_chats(self):
# Me().save_avatar()
# self.contact.save_avatar()
self.show_chat_thread = ShowChatThread(self.contact)
self.show_chat_thread.showSingal.connect(self.add_message)
self.show_chat_thread.finishSingal.connect(self.show_finish)
# self.show_chat_thread.start()
def show_finish(self, ok):
self.setScrollBarPos()
self.show_chat_thread.quit()
def verticalScrollBar(self, pos):
"""
滚动条到0之后自动更新聊天记录
:param pos:
:return:
"""
# print(pos)
if pos > 0:
return
# 记录当前滚动条最大值
self.last_pos = self.chat_window.verticalScrollBar().maximum()
self.update_history_messages()
def update_history_messages(self):
self.show_chat_thread.start()
def setScrollBarPos(self):
"""
将滚动条位置设置为上次看到的地方
:param pos:
:return:
"""
self.chat_window.update()
self.chat_window.show()
pos = self.chat_window.verticalScrollBar().maximum() - self.last_pos
self.chat_window.set_scroll_bar_value(pos)
def is_5_min(self, timestamp):
if abs(timestamp - self.last_timestamp) > 300:
self.last_timestamp = timestamp
return True
return False
def get_avatar_path(self, is_send, message, is_absolute_path=False) -> str:
if self.contact.is_chatroom:
avatar = message[13].smallHeadImgUrl
else:
avatar = Me().smallHeadImgUrl if is_send else self.contact.smallHeadImgUrl
if is_absolute_path:
if self.contact.is_chatroom:
# message[13].save_avatar()
avatar = message[13].avatar
else:
avatar = Me().avatar if is_send else self.contact.avatar
return avatar
def get_display_name(self, is_send, message) -> str:
if self.contact.is_chatroom:
if is_send:
display_name = Me().name
else:
display_name = message[13].remark
else:
display_name = None
return display_name
def add_message(self, message):
try:
type_ = message[2]
str_content = message[7]
str_time = message[8]
# print(type_, type(type_))
is_send = message[4]
avatar = self.get_avatar_path(is_send, message,True)
display_name = self.get_display_name(is_send, message)
timestamp = message[5]
BytesExtra = message[10]
if type_ == 1:
if self.is_5_min(timestamp):
time_message = Notice(self.last_str_time)
self.last_str_time = str_time
self.chat_window.add_message_item(time_message, 0)
bubble_message = BubbleMessage(
str_content,
avatar,
type_,
is_send,
display_name=display_name
)
self.chat_window.add_message_item(bubble_message, 0)
elif type_ == 3:
# return
if self.is_5_min(timestamp):
time_message = Notice(self.last_str_time)
self.last_str_time = str_time
self.chat_window.add_message_item(time_message, 0)
image_path = hard_link_db.get_image(content=str_content, bytesExtra=BytesExtra, up_dir=Me().wx_dir,thumb=False)
image_path = get_abs_path(image_path)
bubble_message = BubbleMessage(
image_path,
avatar,
type_,
is_send
)
self.chat_window.add_message_item(bubble_message, 0)
elif type_ == 47:
return
if self.is_5_min(timestamp):
time_message = Notice(self.last_str_time)
self.last_str_time = str_time
self.chat_window.add_message_item(time_message, 0)
image_path = get_emoji(str_content, thumb=True)
bubble_message = BubbleMessage(
image_path,
avatar,
3,
is_send
)
self.chat_window.add_message_item(bubble_message, 0)
elif type_ == 10000:
str_content = str_content.lstrip('<revokemsg>').rstrip('</revokemsg>')
message = Notice(str_content)
self.chat_window.add_message_item(message, 0)
except:
print(message)
traceback.print_exc()
class ShowChatThread(QThread):
showSingal = pyqtSignal(tuple)
finishSingal = pyqtSignal(int)
msg_id = 0
# heightSingal = pyqtSignal(int)
def __init__(self, contact):
super().__init__()
self.last_message_id = 9999999999
self.wxid = contact.wxid
def run(self) -> None:
messages = msg_db.get_message_by_num(self.wxid, self.last_message_id)
if messages:
self.last_message_id = messages[-1][0]
for message in messages:
self.showSingal.emit(message)
self.msg_id += 1
self.finishSingal.emit(1)

Some files were not shown because too many files have changed in this diff Show More