From 9b3875edf053054dc84df698466cf3ebf15c99ad Mon Sep 17 00:00:00 2001 From: Zhongyi Tong Date: Sun, 7 Feb 2016 18:20:00 +0800 Subject: [PATCH 1/5] =?UTF-8?q?Fix=20bug=20with=20=20=E6=8B=9C=E5=B9=B4?= =?UTF-8?q?=E7=BA=A2=E5=8C=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .../java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 978c10bd..8f9a3a5c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java index 4d7e1889..597dc0ac 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java @@ -18,7 +18,7 @@ public boolean generateSignature(AccessibilityNodeInfo node, String excludeWords /* The text in the hongbao. Should mean something. */ String hongbaoContent = hongbaoNode.getChild(0).getText().toString(); - if (hongbaoContent == null) return false; + if (hongbaoContent == null || "查看红包".equals(hongbaoContent)) return false; /* Check the user's exclude words list. */ String[] excludeWordsArray = excludeWords.split(" +"); From 5740f540ce904de239b325822257cb009947b474 Mon Sep 17 00:00:00 2001 From: Zhongyi Tong Date: Sun, 7 Feb 2016 18:39:04 +0800 Subject: [PATCH 2/5] Fix watchlist bug (#59 in bugly). --- .idea/misc.xml | 2 +- .../java/xyz/monkeytong/hongbao/services/HongbaoService.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 8f9a3a5c..978c10bd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java b/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java index 814759c6..1052711c 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java @@ -40,7 +40,7 @@ public class HongbaoService extends AccessibilityService implements SharedPrefer private AccessibilityNodeInfo rootNodeInfo, mReceiveNode, mUnpackNode; private boolean mLuckyMoneyPicked, mLuckyMoneyReceived; private int mUnpackCount = 0; - private boolean mMutex = false; + private boolean mMutex = false, mListMutex = false; private HongbaoSignature signature = new HongbaoSignature(); private PowerUtil powerUtil; @@ -61,6 +61,7 @@ public void onAccessibilityEvent(AccessibilityEvent event) { if (!mMutex) { if (sharedPreferences.getBoolean("pref_watch_notification", false) && watchNotifications(event)) return; if (sharedPreferences.getBoolean("pref_watch_list", false) && watchList(event)) return; + mListMutex = false; } if (sharedPreferences.getBoolean("pref_watch_chat", false)) watchChat(event); @@ -122,6 +123,8 @@ private void setCurrentActivityName(AccessibilityEvent event) { } private boolean watchList(AccessibilityEvent event) { + if (mListMutex) return false; + mListMutex = true; AccessibilityNodeInfo eventSource = event.getSource(); // Not a message if (event.getEventType() != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED || eventSource == null) From 401821d72b64d03b8171b0e359667f2ad1505eb2 Mon Sep 17 00:00:00 2001 From: Zhongyi Tong Date: Sun, 7 Feb 2016 18:42:53 +0800 Subject: [PATCH 3/5] Fix signature bug in group chat with name shown. --- .../java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java index 597dc0ac..f8b03119 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java @@ -77,10 +77,10 @@ private String[] getSenderContentDescriptionFromNode(AccessibilityNodeInfo node) String[] result = {"unknownSender", "unknownTime"}; for (int i = 0; i < count; i++) { AccessibilityNodeInfo thisNode = node.getChild(i); - if ("android.widget.ImageView".equals(thisNode.getClassName())) { + if ("android.widget.ImageView".equals(thisNode.getClassName()) && "unknownSender".equals(result[0])) { CharSequence contentDescription = thisNode.getContentDescription(); if (contentDescription != null) result[0] = contentDescription.toString().replaceAll("头像$", ""); - } else if ("android.widget.TextView".equals(thisNode.getClassName())) { + } else if ("android.widget.TextView".equals(thisNode.getClassName()) && "unknownTime".equals(result[1])) { CharSequence thisNodeText = thisNode.getText(); if (thisNodeText != null) result[1] = thisNodeText.toString(); } From f226c9edb44816c8c4a1bdc9704461cc1f9fef80 Mon Sep 17 00:00:00 2001 From: Zhongyi Tong Date: Sun, 7 Feb 2016 18:51:01 +0800 Subject: [PATCH 4/5] Fix issue #69 in bugly. --- .../monkeytong/hongbao/activities/MainActivity.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/xyz/monkeytong/hongbao/activities/MainActivity.java b/app/src/main/java/xyz/monkeytong/hongbao/activities/MainActivity.java index 107f4a67..8403bbd7 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/activities/MainActivity.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/activities/MainActivity.java @@ -18,6 +18,7 @@ import java.util.List; +import android.widget.Toast; import xyz.monkeytong.hongbao.R; import xyz.monkeytong.hongbao.fragments.GeneralSettingsFragment; import xyz.monkeytong.hongbao.utils.ConnectivityUtil; @@ -89,8 +90,14 @@ protected void onDestroy() { } public void onButtonClicked(View view) { - Intent accessibleIntent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS); - startActivity(accessibleIntent); + try { + Intent accessibleIntent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS); + startActivity(accessibleIntent); + } catch (Exception e) { + Toast.makeText(this, "遇到一些问题,请手动打开系统设置>辅助服务>微信红包(ฅ´ω`ฅ)", Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } + } public void openGithub(View view) { From 2c2ba5a3c59c08be8b34091a37ce1e3c03e7165e Mon Sep 17 00:00:00 2001 From: Zhongyi Tong Date: Sun, 7 Feb 2016 19:11:08 +0800 Subject: [PATCH 5/5] Update version. --- CHANGELOG.md | 7 +++++++ app/build.gradle | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee27d9f1..87b9a8d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # 更新日志 +**[v2.3 (2016.02.07)](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/tag/v2.3)** + +- 优化 不打开拜年红包 +- 紧急修复了Bugly上几个高优先级的问题,减少Crash出现 + + + **[v2.2 (2016.02.04)](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/tag/v2.2)** - 新增 延时拆开红包的可选项 diff --git a/app/build.gradle b/app/build.gradle index 4fbebb5f..b89394fe 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 16 targetSdkVersion 22 versionCode 2 - versionName "v2.2" + versionName "v2.3" ndk { //设置支持的SO库架构 abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a' diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63078218..959efde6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ 微信红包 - 稳定版 v2.2 + 稳定版 v2.3 ∠( ᐛ 」∠)_使用指南∠( ᐛ 」∠)_\n\n ○ 狠戳插件开关\n ○ 回到微信聊天\n ○ 坐等红包进账\n\n 遇到问题, 欢迎通过Github issue反馈~\n https://github.com/geeeeeeeeek/WeChatLuckyMoney 当前辅助服务状态: 设置抢红包辅助服务