From 929bd0da8945fa2f88667d92279a5e260db66145 Mon Sep 17 00:00:00 2001 From: ppwwyyxx Date: Mon, 2 Feb 2015 13:32:11 +0800 Subject: [PATCH] bug fix --- android-interact.sh | 13 +++++++------ compatibility.sh | 7 +++---- decrypt_db.sh | 8 ++++---- lib/render.py | 12 ++++++------ lib/smiley.py | 5 ++--- lib/static/TP_EMOJI.html | 2 +- lib/static/TP_IMG.html | 2 +- lib/static/TP_MSG.html | 2 +- lib/static/TP_SPEAK.html | 2 +- lib/static/wx.css | 17 +++-------------- 10 files changed, 29 insertions(+), 41 deletions(-) diff --git a/android-interact.sh b/android-interact.sh index 6857525..b0bc3a9 100755 --- a/android-interact.sh +++ b/android-interact.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # File: android-interact.sh -# Date: Sun Jan 11 23:05:58 2015 +0800 +# Date: Sun Feb 01 17:26:48 2015 +0800 # Author: Yuxin Wu source compatibility.sh @@ -13,8 +13,8 @@ cd "$PROG_DIR" RES_DIR="/mnt/sdcard/tencent/MicroMsg" MM_DIR="/data/data/com.tencent.mm" -echo "Starting rooted adb server..." -adb root +#echo "Starting rooted adb server..." +#adb root if [[ $1 == "uin" ]]; then adb pull $MM_DIR/shared_prefs/system_config_prefs.xml 2>/dev/null @@ -26,7 +26,7 @@ if [[ $1 == "uin" ]]; then rm system_config_prefs.xml echo "Got wechat uin: $uin" elif [[ $1 == "imei" ]]; then - imei=$(adb shell dumpsys iphonesubinfo | grep 'Device ID' | $GREP -o '[0-9]+') + imei=$(adb shell dumpsys iphonesubinfo | grep 'Device ID' | $GREP -o '[0-9]\+') [[ -n $imei ]] || { echo "Failed to get imei. You can try other methods, or report a bug." exit 1 @@ -34,6 +34,7 @@ elif [[ $1 == "imei" ]]; then echo "Got imei: $imei" elif [[ $1 == "db" || $1 == "res" ]]; then echo "Looking for user dir name..." + sleep 1 # sometimes adb complains: device not found userList=$(adb ls $RES_DIR | cut -f 4 -d ' ' \ | awk '{if (length() == 32) print}') numUser=$(echo $userList | wc -l) @@ -71,9 +72,9 @@ elif [[ $1 == "db" || $1 == "res" ]]; then fi elif [[ $1 == "db_decrypt" ]]; then echo "Getting uin..." - $0 uin | tail -n1 | grep -o '[0-9]*' > /tmp/uin + $0 uin | tail -n1 | grep -o '[0-9]*' | tee /tmp/uin echo "Getting imei..." - $0 imei | tail -n1 | grep -o '[0-9]*' > /tmp/imei + $0 imei | tail -n1 | grep -o '[0-9]*' | tee /tmp/imei echo "Getting db..." $0 db echo "Decrypting db..." diff --git a/compatibility.sh b/compatibility.sh index cf1688a..361cc47 100755 --- a/compatibility.sh +++ b/compatibility.sh @@ -1,20 +1,19 @@ #!/bin/bash -e # $File: compatibility.sh -# $Date: Mon Jan 19 14:27:25 2015 +0800 +# $Date: Sun Feb 01 17:22:34 2015 +0800 # Author: Vury Leo realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } -if [ `uname` = 'Darwin' ] -then +if [ `uname` = 'Darwin' ]; then REALPATH='realpath' GREP='grep -E' MD5SUM='md5' else REALPATH='readlink -f' - GREP='grep' + GREP=grep MD5SUM='md5sum' fi diff --git a/decrypt_db.sh b/decrypt_db.sh index fd3cd9a..e5fb004 100755 --- a/decrypt_db.sh +++ b/decrypt_db.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # File: decrypt_db.sh -# Date: Sun Jan 11 22:30:50 2015 +0800 +# Date: Sun Feb 01 17:30:29 2015 +0800 # Author: Yuxin Wu source compatibility.sh @@ -12,7 +12,7 @@ output=decrypted.db if [[ -z "$1" || -z "$2" || -z "$3" ]]; then echo "Usage: $0 " - exit + exit 1 fi if [[ -f $output ]]; then @@ -25,8 +25,8 @@ fi KEY=$(echo -n "$imei$uin" | $MD5SUM | cut -b 1-7) echo "KEY: $KEY" -uname | grep Darwin > /dev/null || os=linux && os=darwin -uname -m | grep x86_64 > /dev/null || version=32bit && version=64bit +uname | grep Darwin > /dev/null && os=darwin || os=linux +uname -m | grep x86_64 > /dev/null && version=64bit || version=32bit echo "Use $version sqlcipher of $os." echo "Dump decrypted database... " diff --git a/lib/render.py b/lib/render.py index b760672..d6b35f1 100644 --- a/lib/render.py +++ b/lib/render.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: render.py -# Date: Sun Jan 11 23:46:06 2015 +0800 +# Date: Sun Feb 01 17:46:57 2015 +0800 # Author: Yuxin Wu import os @@ -66,15 +66,15 @@ class HTMLRender(object): def all_css(self): # call after processing all messages, # because smiley css need to be included only when necessary - if hasattr(self, 'final_css'): - return self.final_css - - self.css_string.append(self.smiley.gen_used_smiley_css()) def process(css): css = css_compress(css) return u''.format(css) + + if hasattr(self, 'final_css'): + return self.final_css + process(self.smiley.gen_used_smiley_css()) + self.final_css = u"\n".join(map(process, self.css_string)) - return self.final_css + return self.final_css + process(self.smiley.gen_used_smiley_css()) @property def all_js(self): diff --git a/lib/smiley.py b/lib/smiley.py index db76b61..cfe8fa0 100755 --- a/lib/smiley.py +++ b/lib/smiley.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: smiley.py -# Date: Sun Jan 11 23:40:50 2015 +0800 +# Date: Sun Feb 01 17:47:07 2015 +0800 # Author: Yuxin Wu import os @@ -66,6 +66,7 @@ class SmileyProvider(object): def gen_replace_elem(self, smiley_id): + self.used_smiley_id.add(str(smiley_id)) return ''.format(smiley_id) def _replace_unicode(self, msg): @@ -74,7 +75,6 @@ class SmileyProvider(object): return msg for k, v in self.unicode_smiley.iteritems(): if k in msg: - self.used_smiley_id.add(str(v)) msg = msg.replace(k, self.gen_replace_elem(v)) return msg @@ -84,7 +84,6 @@ class SmileyProvider(object): return msg for k, v in self.tencent_smiley.iteritems(): if k in msg: - self.used_smiley_id.add(str(v)) msg = msg.replace(k, self.gen_replace_elem(v)) return msg diff --git a/lib/static/TP_EMOJI.html b/lib/static/TP_EMOJI.html index 02a38a4..551da3a 100644 --- a/lib/static/TP_EMOJI.html +++ b/lib/static/TP_EMOJI.html @@ -1,6 +1,6 @@
- +
diff --git a/lib/static/TP_IMG.html b/lib/static/TP_IMG.html index 3b774bc..3100426 100644 --- a/lib/static/TP_IMG.html +++ b/lib/static/TP_IMG.html @@ -1,6 +1,6 @@
- +
diff --git a/lib/static/TP_MSG.html b/lib/static/TP_MSG.html index 603cea7..4cbf25b 100644 --- a/lib/static/TP_MSG.html +++ b/lib/static/TP_MSG.html @@ -1,6 +1,6 @@
- +
diff --git a/lib/static/TP_SPEAK.html b/lib/static/TP_SPEAK.html index 2ec9dba..6c903ac 100644 --- a/lib/static/TP_SPEAK.html +++ b/lib/static/TP_SPEAK.html @@ -1,6 +1,6 @@
- +
diff --git a/lib/static/wx.css b/lib/static/wx.css index 5579ae4..7deb270 100644 --- a/lib/static/wx.css +++ b/lib/static/wx.css @@ -3269,7 +3269,7 @@ a.iconOperater:active { width: 36px; height: 36px; } -.createNewChat .friendDetail .avatar img { +.createNewChat .friendDetail .avatar span { display: block; width: 33px; height: 33px; @@ -3336,7 +3336,7 @@ a.iconOperater:active { -o-text-overflow: ellipsis; overflow: hidden; } -.createNewChat a.activeColumn .avatar img { +.createNewChat a.activeColumn .avatar span { border: 1px solid #FFF; } .createNewChat .selectedPanel { @@ -3717,7 +3717,7 @@ a.iconOperater:active { float: left; margin: 0px 13px 0px 0px; } -.profileMesg .avatar_wrap img.avatar { +.profileMesg .avatar_wrap span.avatar { height: 60px; width: 60px; } @@ -3821,7 +3821,6 @@ a.iconOperater:active { margin-right: 14px; border: 2px solid #FFF; box-shadow: 0px 1px 0px #B9B9B9; - background: url(../images/avatar_default1844c2.png) no-repeat center; } .window .content .personalInfo { margin-top: -19px; @@ -4296,7 +4295,6 @@ a.btnGray input { height: 69px; border: 2px solid #FFF; box-shadow: 0px 1px 0px #B9B9B9; - background: url(../images/avatar_default1844c2.png) no-repeat center; } /*edit avartor end*/ /*friend card*/ @@ -4351,7 +4349,6 @@ a.btnGray input { width: 79px; height: 79px; margin-right: 10px; - background: url(../images/avatar_default1844c2.png) no-repeat center; } .callingCard .cloudBody .footer { color: #828282; @@ -4527,7 +4524,6 @@ a.btnBlue:active .btnBluePanel { height: 250px; border: 2px solid #FFF; box-shadow: 0px 1px 0px #A5A5A5; - background: url(../images/edit_avatar1844c2.png) no-repeat center; } .preAvartor .editOper { margin-top: 20px; @@ -5068,13 +5064,6 @@ a.btnBlue:active .btnBluePanel { .popupPhotoAlbumPanel .friendCirRPanel .comments ul li a:hover { text-decoration: none; } -.popupPhotoAlbumPanel .friendCirRPanel .comments ul img.avatar { - height: 40px; - width: 40px; - border-radius: 0px; - border: none; - box-shadow: none; -} .popupPhotoAlbumPanel .friendCirRPanel .comments .commentPanel { margin-left: 52px; }