Kaynağa Gözat

some small change

ppwwyyxx 11 yıl önce
ebeveyn
işleme
b80bbb39c2
4 değiştirilmiş dosya ile 18 ekleme ve 8 silme
  1. 1 2
      README.md
  2. 1 1
      android-interact.sh
  3. 4 4
      count-message.sh
  4. 12 1
      libchat/libchat.py

+ 1 - 2
README.md

@@ -14,7 +14,7 @@ This tool can parse and dump WeChat chat history on a rooted android phone.
 + adb and rooted android phone connected to PC
 
 #### Get Necessary Data:
-+ Get decrypted WeChat database (Linux only):
++ Get decrypted WeChat database (Linux & Mac Only):
 	+ Automatic: `./android-interact.sh db_decrypt`
 	+ Manual:
 		+ Get /data/data/com.tencent.mm/MicroMsg/long-long-name/EnMicroMsg.db from *root* filesystem, possible ways are:
@@ -60,7 +60,6 @@ Screenshots:
 + Skip existing files when copying android resources
 + Fix rare unhandled types: > 10000 and < 0
 + Better user experiences... see `grep 'TODO' lib -R`
-+ mac support (For now you will have to compile sqlcipher 2.1.1 by yourself. Also, shell script might work on BSD)
 + more easy-to-use for non-programmers (GUI?)
 
 ### Disclaimers

+ 1 - 1
android-interact.sh

@@ -1,6 +1,6 @@
 #!/bin/bash -e
 # File: android-interact.sh
-# Date: Sun Feb 01 17:26:48 2015 +0800
+# Date: Sun Apr 12 21:19:07 2015 +0900
 # Author: Yuxin Wu <[email protected]>
 
 source compatibility.sh

+ 4 - 4
report.sh → count-message.sh

@@ -1,16 +1,16 @@
 #!/bin/bash -e
-# File: android-interact.sh
-# Date: Sat Mar  7 20:57:51 2015 +0800
+# File: count-message.sh
+# Date: Sun Apr 12 21:01:01 2015 +0900
 # Author: Kangjing Huang <[email protected]>
 
 
 if [[ -z $1 ]]
-then 
+then
     echo "Usage: $0 [Directory of text messages]"
     exit 1
 fi
 
-echo -e "Filename\tCounts of message\tCounts of chars\tCounts of words" 
+echo -e "Filename\tCounts of message\tCounts of chars\tCounts of words"
 
 SAVEIFS=$IFS
 IFS=$(echo -en "\n\b")

+ 12 - 1
libchat/libchat.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python2
 # -*- coding: UTF-8 -*-
 # File: libchat.py
-# Date: Sat Mar 28 00:08:29 2015 +0800
+# Date: Sun Apr 12 21:08:51 2015 +0900
 # Author: Yuxin Wu <[email protected]>
 import sqlite3
 import os
@@ -14,6 +14,16 @@ NUM_FIELDS = 8
 ChatMsgBase = namedtuple('ChatMsgBase',
           ['source', 'time', 'sender', 'chatroom',
            'text', 'image', 'sound', 'extra_data'])
+""" source: unicode,
+    time: datetime,
+    sender: unicode,
+    chatroom: unicode,
+    text: unicode,
+    image: string,
+    sound: string,
+    extra_data: string
+"""
+
 class ChatMsg(ChatMsgBase):
     def __repr__(self): # repr must return str?
         return "Msg@{}/{}-{}/{}/{}/{}/{}".format(
@@ -56,6 +66,7 @@ class SqliteLibChat(object):
               ','.join(['?']*NUM_FIELDS)), tp)
 
     def add_msgs(self, msgs):
+        """ each message is a ChatMsg instance"""
         self.c = self.conn.cursor()
         for m in msgs:
             self._add_msg(SqliteLibChat.prefilter(m))