update docs

This commit is contained in:
Yuxin Wu
2017-11-29 02:33:15 -08:00
parent dcad5ed99d
commit d5c097277d
4 changed files with 24 additions and 25 deletions
+9 -15
View File
@@ -65,29 +65,23 @@ pip install --user --pre pysox
./decrypt-db.py <path to EnMicroMsg.db> <imei> <uin>
```
NOTE: you may need to try different ways to getting imei & uin,
because things behave differently on different phones.
Some phones may have multiple imei, you may need to try them all. See [#33](https://github.com/ppwwyyxx/wechat-dump/issues/33).
NOTE: you may need to try different ways to get imei,
because things behave differently on different phones.
Some phones may have multiple imei, you may need to try them all.
See [#33](https://github.com/ppwwyyxx/wechat-dump/issues/33).
If the decryption doesn't work, maybe try the version of sqlcipher in `legacy`.
If things still don't work, you can try the [password cracker](https://github.com/chg-hou/EnMicroMsg.db-Password-Cracker)
If decryption doesn't work, you can also try the [password cracker](https://github.com/chg-hou/EnMicroMsg.db-Password-Cracker)
to brute-force the password.
+ Copy the WeChat user resource directory `/mnt/sdcard/tencent/MicroMsg/${userid}/{avatar,emoji,image2,sfs,video,voice2}` from the phone to the `resource` directory:
+ `./android-interact.sh res`
+ You might need to change `RES_DIR` in the script if the default is incorrect on your phone.
+ This can take a __very long__ time. Some manual ways to do it faster:
+ This script needs busybox and base64 on your phone.
If they are not available, there is a slow fallback method in the script you can use.
+ This can take a few minutes. One way to do it faster:
+ If there's enough free space on your phone, you can log in and archive all required files via `busybox tar` with or without compression,
and use `adb pull` to copy the archive. Note that `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 your phone.
```sh
# This will copy the whole 'MicroMsg' to the current directory:
adb shell 'cd /mnt/sdcard/tencent &&
busybox tar czf - MicroMsg 2>/dev/null | busybox base64' |
base64 -di | tar xzf -
```
+ What you'll need in the end is a `resource` directory with the following subdir: `avatar,emoji,image2,sfs,video,voice2`.
+ What you'll need in the end is a `resource` directory with the following subdir: `avatar,emoji,image2,sfs,video,voice2`.
+ (Optional) Download the emoji cache from [here](https://github.com/ppwwyyxx/wechat-dump/releases/download/0.1/emoji.cache.tar.bz2)
and put it under `resource/emoji`. This will avoid downloading too many emojis during rendering.
+11 -6
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# File: android-interact.sh
# Date: Fri Jun 26 10:38:07 2015 +0800
# Date: Wed Nov 29 02:19:00 2017 -0800
# Author: Yuxin Wu <[email protected]>
PROG_NAME=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" "$0"`
@@ -31,7 +31,7 @@ elif [[ $1 == "imei" ]]; then
imei=$(adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed 's/[^0-9A-F]*//g' | tr -d '\n')
}
[[ -n $imei ]] || {
>&2 echo "Failed to get imei. You can try other methods, or report a bug."
>&2 echo "Failed to get imei. You can try other methods mentioned in README, or report a bug."
exit 1
}
echo "Got imei: $imei"
@@ -51,12 +51,17 @@ elif [[ $1 == "db" || $1 == "res" ]]; then
echo "Found $numUser user(s). User chosen: $chooseUser"
if [[ $1 == "res" ]]; then
echo "Pulling resources... this might take a long time, because adb sucks..."
mkdir -p resource; cd resource
echo "Pulling resources... "
for d in avatar image2 voice2 emoji video sfs; do
mkdir -p $d; cd $d
adb pull "$RES_DIR/$chooseUser/$d"
cd ..
adb shell "cd $RES_DIR/$chooseUser &&
busybox tar czf - $d 2>/dev/null | busybox base64" |
base64 -di | tar xzf -
# Old Slow Way:
# mkdir -p $d; cd $d
# adb pull "$RES_DIR/$chooseUser/$d"
# cd ..
[[ -d $d ]] || {
>&2 echo "Failed to download resource directory: $RES_DIR/$chooseUser/$d"
exit 1
+3 -3
View File
@@ -1,6 +1,6 @@
#!/bin/bash -e
# File: count-message.sh
# Date: Sun Apr 12 21:01:01 2015 +0900
# Date: Wed Nov 29 02:32:40 2017 -0800
# Author: Kangjing Huang <[email protected]>
@@ -11,7 +11,7 @@ then
fi
# TODO work on db directly
echo -e "Filename\tCounts of message\tCounts of chars\tCounts of words"
echo -e "Filename\t#Lines\t#Chars\t#Words"
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
@@ -23,6 +23,6 @@ do
CHARCOUNT=$(cat "$i"| sed 's/.*:[0-9][0-9]:\(.*\)/\1/g' | sed 's/\[.*\]//g' | grep -v img | wc -m)
WORDCOUNT=$(cat "$i"| sed 's/.*:[0-9][0-9]:\(.*\)/\1/g' | sed 's/\[.*\]//g' | grep -v img | wc -w)
echo -e "$LINECOUNT\t$CHARCOUNT\t$WORDCOUNT"
done
done | sort -t $'\t' -k 2 -n | column -t -s $'\t'
IFS=$SAVEIFS
+1 -1
View File
@@ -14,4 +14,4 @@ db_file = sys.argv[1]
parser = WeChatDBParser(db_file)
chats = parser.msgs_by_chat.keys()
for k in chats:
print parser.contacts[k], '\t', k
print parser.contacts[k], '\t', k