Skip to content

Commit 4bc5764

Browse files
committed
fix(chat): 修复实时聊天最新消息读取不全
- 通过 native cursor 和 exec_query 兜底读取多个 message_*.db 分片 - 使用 session_last_message 校正 SessionTable 滞后的排序、时间和预览 - 保留实时消息的库表和 rowid 元信息,避免跨库定位错误 - 支持 packed_info 原始 16 字节 MD5,修复视频缩略图匹配 - 补充实时消息跨分片和会话排序回归测试
1 parent 5ceba05 commit 4bc5764

3 files changed

Lines changed: 498 additions & 78 deletions

File tree

src/wechat_decrypt_tool/chat_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,6 @@ def _extract_md5_from_packed_info(packed_info: Any) -> str:
560560
s = packed_info.strip()
561561
if s.lower().startswith("0x"):
562562
s = s[2:]
563-
if len(s) == 32 and _PACKED_INFO_HEX_RE.fullmatch(s):
564-
return s.lower()
565563
if s and _PACKED_INFO_HEX_RE.fullmatch(s) and (len(s) % 2 == 0):
566564
try:
567565
data = bytes.fromhex(s)
@@ -578,6 +576,9 @@ def _extract_md5_from_packed_info(packed_info: Any) -> str:
578576
except Exception:
579577
data = b""
580578

579+
if len(data) == 16:
580+
return data.hex()
581+
581582
md5 = _extract_md5_from_blob(data)
582583
md5 = str(md5 or "").strip().lower()
583584
if len(md5) == 32 and all(c in "0123456789abcdef" for c in md5):

0 commit comments

Comments
 (0)