greycodee / wechat-backup

微信聊天记录持久化备份本地硬盘,释放手机存储空间。
MIT License
3.22k stars 339 forks source link

uin 不是 7位 #29

Closed snowman closed 1 year ago

snowman commented 1 year ago
$ adb shell su -c "cat /data/data/com.tencent.mm/shared_prefs/auth_info_key_prefs.xml" | grep -i uin
    <int name="_auth_uin" value="2009066962" />
snowman commented 1 year ago

使用IMEI: 1234567890ABCDEF (大写)

#!/usr/bin/env python

import hashlib

uin = "2009066962"
IMEI = "1234567890ABCDEF"

hash_output = hashlib.md5((IMEI+uin).encode()).hexdigest()[:7]

print(
"""
$ sqlcipher EnMicroMsg.db
pragma key = '{}';
pragma cipher_use_hmac = off;
pragma kdf_iter = 4000;
pragma cipher_page_size = 1024;
pragma cipher_hmac_algorithm = HMAC_SHA1;
pragma cipher_kdf_algorithm = PBKDF2_HMAC_SHA1;
ATTACH DATABASE 'plaintext.db' AS plaintext KEY '';
SELECT sqlcipher_export('plaintext');
detach database plaintext;
""".format(hash_output.lower()))