Skip to content

Commit

Permalink
Merge branch 'feature/android-nogat-support' into 7.0-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhongyi Tong authored Jan 27, 2017
2 parents a14f59e + 21fb800 commit 623fef0
Show file tree
Hide file tree
Showing 20 changed files with 366 additions and 170 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.imi
.gradle
/local.properties
/.idea/workspace.xml
Expand All @@ -6,4 +7,4 @@
/build
/captures
/.idea/dictionaries
/monkeytong.jks
/monkeytong.jks
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# 微信红包

<a href="https://play.google.com/store/apps/details?id=xyz.monkeytong.hongbao"><img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" height="24"></a>

[![Gitter](https://badges.gitter.im/geeeeeeeeek/WeChatLuckyMoney.svg)](https://gitter.im/geeeeeeeeek/WeChatLuckyMoney?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Build Status](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney.svg?branch=stable)](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney) [**ENGLISH**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/README_EN.md)
[![Gitter](https://badges.gitter.im/geeeeeeeeek/WeChatLuckyMoney.svg)](https://gitter.im/geeeeeeeeek/WeChatLuckyMoney?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Build Status](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney.svg?branch=stable)](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney) [![Docs](https://img.shields.io/badge/Docs-English-blue.svg)](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/README_EN.md)

一个帮助你在微信抢红包时战无不胜的Android应用。自动检测并且拆开红包,速度超乎你的想象。

前往[**Release**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/)下载最新版本。已下载用户可直接在设置里面更新。
支持中英文。前往[**Release**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/)下载最新版本。已下载用户可直接在设置里面更新。

### 特性

Expand All @@ -18,7 +16,7 @@

多种特征标识,聊天时不再重复点击红包。智能过滤红包关键字[[?]](https://github.com/geeeeeeeeek/WeChatLuckyMoney/issues/97),避免落入“专属红包”、“抢到翻倍”的陷阱。还可以设置延时抢红包和自动回复感谢语[[?]](https://github.com/geeeeeeeeek/WeChatLuckyMoney/issues/118)

- **紧跟微信更新,内置最新春节红包资讯**
- **紧跟微信更新**

第一时间适配最新版本微信,应用内即可一键更新。

Expand Down Expand Up @@ -49,8 +47,5 @@
本项目使用[MIT许可证](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/LICENSE.md)

### 应用截图

![608460845](https://cloud.githubusercontent.com/assets/7262715/17330401/4ade682a-58f9-11e6-8b27-3c24941eee24.jpg)
![805028608](https://cloud.githubusercontent.com/assets/7262715/17330399/4a6b44d0-58f9-11e6-99bf-c2f89d019145.jpg)
![1627530051](https://cloud.githubusercontent.com/assets/7262715/17330397/4a388946-58f9-11e6-85b6-04b406d27dba.jpg)

![wechatimg159](https://cloud.githubusercontent.com/assets/7262715/22361931/999cc8e0-e499-11e6-91ae-ce6973f722f0.png)
![wechatimg160](https://cloud.githubusercontent.com/assets/7262715/22361932/99b0181e-e499-11e6-8547-d366f9c4cfd9.jpeg)
11 changes: 7 additions & 4 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# WeChat Lucky Money

<a href="https://play.google.com/store/apps/details?id=xyz.monkeytong.hongbao"><img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" height="48"></a>

[![Gitter](https://badges.gitter.im/geeeeeeeeek/WeChatLuckyMoney.svg)](https://gitter.im/geeeeeeeeek/WeChatLuckyMoney?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Build Status](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney.svg?branch=stable)](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney) [**中文 README**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/README.md)
[![Gitter](https://badges.gitter.im/geeeeeeeeek/WeChatLuckyMoney.svg)](https://gitter.im/geeeeeeeeek/WeChatLuckyMoney?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Build Status](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney.svg?branch=stable)](https://travis-ci.org/geeeeeeeeek/WeChatLuckyMoney) [![Docs](https://img.shields.io/badge/文档-中文-blue.svg)](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/README.md)

This Android app helps you snatch red envelopes in WeChat. It detects red envelopes automatically, and clicks to open them faster than your imagination.

Please goto the [**Release**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/) page to download the latest version.
Available in English and Chinese. Please goto the [**Release**](https://github.com/geeeeeeeeek/WeChatLuckyMoney/releases/) page to download the latest version.

### Spotlights

Expand Down Expand Up @@ -47,3 +45,8 @@ The project was heavily inspired by the [app](https://github.com/XiaoMi/LuckyMon
This app might alter the natural way of interactions with WeChat. When you are using the code and its accessories, you are fully responsible for any possible consequences.

The project is licensed to the [MIT](https://github.com/geeeeeeeeek/WeChatLuckyMoney/blob/stable/LICENSE.md).

### Snapshots

![wechatimg157](https://cloud.githubusercontent.com/assets/7262715/22361930/999aecdc-e499-11e6-91f6-c8c44b9ccc55.png)
![wechatimg158](https://cloud.githubusercontent.com/assets/7262715/22361929/99998126-e499-11e6-93bc-e97ea263db47.jpeg)
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ android {
//其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.2.0
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.Image;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.view.View;
Expand All @@ -19,8 +17,9 @@

import java.util.List;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import xyz.monkeytong.hongbao.R;
import xyz.monkeytong.hongbao.fragments.GeneralSettingsFragment;
import xyz.monkeytong.hongbao.utils.ConnectivityUtil;
import xyz.monkeytong.hongbao.utils.UpdateTask;

Expand Down Expand Up @@ -77,10 +76,16 @@ private void handleMaterialStatusBar() {

}

@Override
protected void onPause() {
super.onPause();
}

@Override
protected void onResume() {
super.onResume();

updateServiceStatus();
// Check for update when WIFI is connected or on first time.
if (ConnectivityUtil.isWifi(this) || UpdateTask.count == 0)
new UpdateTask(this, false).update();
Expand All @@ -95,33 +100,35 @@ protected void onDestroy() {

public void openAccessibility(View view) {
try {
Toast.makeText(this, "点击「微信红包」" + pluginStatusText.getText(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, getString(R.string.turn_on_toast) + pluginStatusText.getText(), Toast.LENGTH_SHORT).show();
Intent accessibleIntent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(accessibleIntent);
} catch (Exception e) {
Toast.makeText(this, "遇到一些问题,请手动打开系统设置>无障碍服务>微信红包(ฅ´ω`ฅ)", Toast.LENGTH_LONG).show();
Toast.makeText(this, getString(R.string.turn_on_error_toast), Toast.LENGTH_LONG).show();
e.printStackTrace();
}

}

public void openGitHub(View view) {
Intent webViewIntent = new Intent(this, WebViewActivity.class);
webViewIntent.putExtra("title", "GitHub 项目主页");
webViewIntent.putExtra("title", getString(R.string.webview_github_title));
webViewIntent.putExtra("url", "https://github.com/geeeeeeeeek/WeChatLuckyMoney");
startActivity(webViewIntent);
}

public void openUber(View view) {
Intent webViewIntent = new Intent(this, WebViewActivity.class);
webViewIntent.putExtra("title", "Uber 优惠乘车机会(优惠码rgk2wue)");
webViewIntent.putExtra("url", "https://get.uber.com.cn/invite/rgk2wue");
webViewIntent.putExtra("title", getString(R.string.webview_uber_title));
String[] couponList = new String[]{"https://dc.tt/oTLtXH2BHsD", "https://dc.tt/ozFJHDnfLky"};
int index = (int) (Math.random() * 2);
webViewIntent.putExtra("url", couponList[index]);
startActivity(webViewIntent);
}

public void openSettings(View view) {
Intent settingsIntent = new Intent(this, SettingsActivity.class);
settingsIntent.putExtra("title", "偏好设置");
settingsIntent.putExtra("title", getString(R.string.preference));
settingsIntent.putExtra("frag_id", "GeneralSettingsFragment");
startActivity(settingsIntent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
import org.w3c.dom.Text;
import xyz.monkeytong.hongbao.R;

/**
Expand All @@ -31,7 +29,7 @@ public SeekBarPreference(Context context, AttributeSet attrs) {
}
}
if (prefKind.equals("pref_open_delay")) {
hintText = "拆开红包";
hintText = getContext().getString(R.string.delay_open);
} else if (prefKind.equals("pref_comment_delay")) {
hintText = "发送回复(暂不支持延时)";
}
Expand All @@ -52,20 +50,12 @@ protected void onBindDialogView(View view) {
}

this.textView = (TextView) view.findViewById(R.id.pref_seekbar_textview);
if (delay == 0) {
this.textView.setText("立即" + hintText);
} else {
this.textView.setText("延迟" + delay + "秒" + hintText);
}
setHintText(0);

this.seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
if (i == 0) {
textView.setText("立即" + hintText);
} else {
textView.setText("延迟" + i + "秒" + hintText);
}
setHintText(i);
}

@Override
Expand All @@ -89,4 +79,12 @@ protected void onDialogClosed(boolean positiveResult) {
}
super.onDialogClosed(positiveResult);
}

private void setHintText(int delay) {
if (delay == 0) {
this.textView.setText(getContext().getString(R.string.delay_instantly) + hintText);
} else {
this.textView.setText(getContext().getString(R.string.delay_delay) + delay + getContext().getString(R.string.delay_sec) + getContext().getString(R.string.delay_then) + hintText);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
import xyz.monkeytong.hongbao.R;
import xyz.monkeytong.hongbao.fragments.CommentSettingsFragment;
Expand Down Expand Up @@ -46,7 +47,7 @@ private void prepareSettings() {
title = bundle.getString("title");
fragId = bundle.getString("frag_id");
} else {
title = "偏好设置";
title = getString(R.string.preference);
fragId = "GeneralSettingsFragment";
}

Expand Down Expand Up @@ -87,6 +88,7 @@ public void performBack(View view) {
}

public void enterAccessibilityPage(View view) {
Toast.makeText(this, getString(R.string.turn_on_toast), Toast.LENGTH_SHORT).show();
Intent mAccessibleIntent =
new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(mAccessibleIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import xyz.monkeytong.hongbao.R;
import xyz.monkeytong.hongbao.utils.DownloadUtil;
import xyz.monkeytong.hongbao.utils.UpdateTask;
Expand All @@ -47,7 +49,7 @@ protected void onCreate(Bundle savedInstanceState) {
webViewTitle = bundle.getString("title");
webViewUrl = bundle.getString("url");

TextView webViewBar = (TextView) findViewById(R.id.webview_bar);
final TextView webViewBar = (TextView) findViewById(R.id.webview_bar);
webViewBar.setText(webViewTitle);

webView = (WebView) findViewById(R.id.webView);
Expand All @@ -58,10 +60,14 @@ protected void onCreate(Bundle savedInstanceState) {
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.indexOf("apk") > 0) {
Toast.makeText(getApplicationContext(), "正在准备下载", Toast.LENGTH_SHORT).show();
if (url.contains("apk")) {
Toast.makeText(getApplicationContext(), getString(R.string.download_backend), Toast.LENGTH_SHORT).show();
(new DownloadUtil()).enqueue(url, getApplicationContext());
return true;
} else if (!url.contains("http")) {
Toast.makeText(getApplicationContext(), getString(R.string.download_redirect), Toast.LENGTH_LONG).show();
webViewBar.setText(getString(R.string.download_hint));
return false;
} else {
view.loadUrl(url);
return false;
Expand All @@ -77,6 +83,21 @@ public void onPageFinished(WebView view, String url) {
}
}

@Override
protected void onPause() {
super.onPause();
}

@Override
protected void onResume() {
super.onResume();
}

@Override
protected void onDestroy() {
super.onDestroy();
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void loadUI() {
setContentView(R.layout.activity_webview);
Expand All @@ -92,11 +113,6 @@ private void loadUI() {
window.setStatusBarColor(0xffE46C62);
}

@Override
protected void onResume() {
super.onResume();
}

public void performBack(View view) {
super.onBackPressed();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class UpdateTask extends AsyncTask<String, String, String> {
public UpdateTask(Context context, boolean needUpdate) {
this.context = context;
this.isUpdateOnRelease = needUpdate;
if (this.isUpdateOnRelease) Toast.makeText(context, "正在检查新版本……", Toast.LENGTH_SHORT).show();
if (this.isUpdateOnRelease) Toast.makeText(context, context.getString(R.string.checking_new_version), Toast.LENGTH_SHORT).show();
}

@Override
Expand Down
Loading

0 comments on commit 623fef0

Please sign in to comment.