Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #122 from geeeeeeeeek/release/2.3
Browse files Browse the repository at this point in the history
Release/2.3
  • Loading branch information
Zhongyi Tong authored and Zhongyi Tong committed Feb 7, 2016
2 parents dd8e17c + 2c2ba5a commit 7d42f43
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)**

- 新增 延时拆开红包的可选项
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(" +");
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">微信红包</string>
<string name="app_version">稳定版 v2.2</string>
<string name="app_version">稳定版 v2.3</string>
<string name="app_description">∠( ᐛ 」∠)_使用指南∠( ᐛ 」∠)_\n\n ○ 狠戳插件开关\n ○ 回到微信聊天\n ○ 坐等红包进账\n\n 遇到问题, 欢迎通过Github issue反馈~\n https://github.com/geeeeeeeeek/WeChatLuckyMoney</string>
<string name="service_status">当前辅助服务状态:</string>
<string name="service_name">设置抢红包辅助服务</string>
Expand Down

0 comments on commit 7d42f43

Please sign in to comment.