@@ -208,8 +208,7 @@ def get_db_key_workflow():
208208
209209def get_wechat_internal_global_config (wx_dir : Path , file_name1 ) -> bytes :
210210 """
211- 获取 Blob 1: 微信内部的 global_config 文件
212- 路径逻辑: account_dir (wxid_xxx) -> parent (xwechat_files) -> all_users -> config -> global_config
211+ 读微信目录下的主配置文件
213212 """
214213 xwechat_files_root = wx_dir .parent
215214
@@ -253,7 +252,6 @@ def get_wechat_internal_global_config(wx_dir: Path, file_name1) -> bytes:
253252
254253
255254async def fetch_and_save_remote_keys (account : Optional [str ] = None ) -> Dict [str , Any ]:
256- # 1. 确定账号目录和 WXID
257255 account_dir = _resolve_account_dir (account )
258256 wx_id_dir = _resolve_account_wxid_dir (account_dir )
259257 wxid = wx_id_dir .name
@@ -272,11 +270,8 @@ async def fetch_and_save_remote_keys(account: Optional[str] = None) -> Dict[str,
272270 except Exception as e :
273271 raise RuntimeError (f"读取微信内部文件失败: { e } " )
274272
275- # Blob 3: 空 (联系人)
276273 blob3_bytes = b""
277274
278-
279- # 3. 构造请求
280275 headers = {
281276 "Accept" : "text/x-component" ,
282277 "Next-Action" : NEXT_ACTION_ID ,
@@ -338,17 +333,15 @@ async def fetch_and_save_remote_keys(account: Optional[str] = None) -> Dict[str,
338333 xor_raw = str (result_data ["xor_key" ])
339334 aes_val = str (result_data ["aes_key" ])
340335
341- # 转换 XOR Key (服务器返回的是十进制字符串 "178")
342336 try :
343337 if xor_raw .startswith ("0x" ):
344338 xor_int = int (xor_raw , 16 )
345339 else :
346340 xor_int = int (xor_raw )
347- xor_hex_str = f"0x{ xor_int :02X} " # 格式化为 0xB2
341+ xor_hex_str = f"0x{ xor_int :02X} "
348342 except :
349- xor_hex_str = xor_raw # 转换失败则原样保留
343+ xor_hex_str = xor_raw
350344
351- # 保存到数据库/Store
352345 upsert_account_keys_in_store (
353346 account = wxid ,
354347 image_xor_key = xor_hex_str ,
0 commit comments