diff --git a/README.md b/README.md index b747630..e5c5be5 100644 --- a/README.md +++ b/README.md @@ -24,59 +24,79 @@ If it doesn't work, please leave an issue together with your phone/OS/wechat ver + numpy + python-csscompressor (suggested, optional) + adb and rooted android phone connected to a Linux/Mac OS. -+ Silk audio decoder (just run `./third-party/compile_silk.sh`) ++ Silk audio decoder (included; just run `./third-party/compile_silk.sh`) + gnu-sed #### Get Necessary Data: -+ Get decrypted WeChat database (Linux & Mac Only): +Note that commands involving `./android-interact.sh` are meant to be run on the computer. + ++ (Requires Linux or Mac) Get the decrypted WeChat database and the avatar index: + Automatic: `./android-interact.sh db-decrypt` - + Requires rooted adb. Available at https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en + + Requires rooted adb. If the OS distribution does not come with adb support, you can download an app such as https://play.google.com/store/apps/details?id=eu.chainfire.adbd + Manual: - + Get /data/data/com.tencent.mm/MicroMsg/long-long-name/{EnMicroMsg.db,sfs/avatar.index} from __root__ filesystem, possible ways are: + + Figure out your `${userid}` by inspecting the contents of `/data/data/com.tencent.mm/MicroMsg` on the __root__ filesystem of the device. It should be a 32-character-long name consisting of hexadecimal digits. + + Get `/data/data/com.tencent.mm/MicroMsg/${userid}/{EnMicroMsg.db,sfs/avatar.index}` from the device, possible ways are: + `./android-interact.sh db` + Use your rooted file system manager app - + Get WeChat uin, possible ways are: - + `./android-interact.sh uin` + + Get WeChat uin (an integer), possible ways are: + + `./android-interact.sh uin`, which pulls the value from `/data/data/com.tencent.mm/shared_prefs/system_config_prefs.xml` + Login to [web wechat](https://wx.qq.com), get wxuin=1234567 from `document.cookie` - + Get your phone IMEI number, possible ways are: + + Get your phone IMEI number (a positive integer), possible ways are: + `./android-interact.sh imei` + Call `*#06#` on your phone + Find IMEI in system settings + Decrypt database, will produce `decrypted.db`: - ``` - ./decrypt-db.py - ``` + + ``` + ./decrypt-db.py + ``` -NOTE: you may need to try different ways to getting imei & uin, -because things behave differently on different phones. + NOTE: you may need to try different ways to getting imei & uin, + because things behave differently on different phones. -Also, if the decryption doesn't work with pysqlcipher, maybe try the version of sqlcipher in `legacy`. + Also, if the decryption doesn't work with pysqlcipher, maybe try the version of sqlcipher in `legacy`. -+ Get WeChat user resource directory from your phone to `resource` directory: ++ Copy the WeChat user resource directory `/mnt/sdcard/tencent/MicroMsg/${userid}/{emoji,image2,sfs,video,voice2}` from the phone's SD card to the `resource` directory: + `./android-interact.sh res` - + You might need to change the resource location in this script if the default doesn't work - + This takes a __long__ time. + + You might need to tweak `RES_DIR` in the script if the default doesn't work + + This can take a __long__ time. Some ways to do this faster: + + If there's enough free space on the SD card, you can combine all the files via `busybox tar` without compression in the `adb shell`, use `adb pull` to copy the `tar` archive to the computer, and then extract it. BusyBox is needed as the Android system's `tar` may choke on long paths. + + Alternatively, you can use pipes. This is slower, but doesn't require any free space on the SD card: + + ```sh + # copy MicroMsg to the current directory + adb shell 'cd /mnt/sdcard/tencent && + busybox tar czf - MicroMsg 2>/dev/null | busybox base64' | + base64 -di | tar xzf - + ``` #### Run: -+ Parse and dump text messages of __every__ chat (resource directory is not needed to run this): -``` -./dump-msg.py decrypted.db output_dir -``` -+ List all chats: -``` -./list-chats.py decrypted.db -``` -+ Generate statistical report on text messages: -``` -./count-message.sh output_dir -``` -+ Dump messages of one contact to html, containing voice messages, emojis, and images: -``` -./dump-html.py decrypted.db avatar.index resource output.html -``` ++ Parse and dump text messages of __every__ chat (requires `decrypted.db`): + + ``` + ./dump-msg.py decrypted.db output_dir + ``` + ++ List all chats (requires `decrypted.db`): + + ``` + ./list-chats.py decrypted.db + ``` + ++ Generate statistical report on text messages (requires `output_dir` from `./dump-msg.py`): + + ``` + ./count-message.sh output_dir + ``` + ++ Dump messages of one contact to html, containing voice messages, emojis, and images (requires `decrypted.db`, `avatar.index`, and `resource`): + + ``` + ./dump-html.py decrypted.db avatar.index resource "" output.html + ``` ### Examples: See [here](http://ppwwyyxx.com/static/wechat/example.html) for an example html.