Skip to content

Commit f700546

Browse files
committed
v1.4版本
1 parent c459a1f commit f700546

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ V免签为完全开源项目,开源项目意味着作者没有任何收入来
4343
+ 本系统原理为监控收款后手机的通知栏推送消息,所以请保持微信/支付宝/V免签监控端后台正常运行,且添加到内存清理白名单!
4444

4545
## 更新记录
46+
+ v1.4(2019.04.23)
47+
+ 修复部分手机无法正确检测监听权限问题,点击监听权限按钮后,如果一切正常,状态栏会收到推送信息,并且会提示监听权限正常!
48+
4649
+ v1.3(2019.04.20)
4750
+ 添加后台心跳线程熄屏运行权限,更加稳定啦(推荐更新到此版本)
4851

app/app-release.apk

-80 Bytes
Binary file not shown.

app/src/main/java/com/vone/vmq/MainActivity.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,23 @@ private boolean gotoNotificationAccessSetting(Context context) {
310310

311311

312312
public void checkPush(View v){
313+
if (btnStart.getText().equals("检测服务状态")){
314+
Toast.makeText(MainActivity.this, "请先开启服务!", Toast.LENGTH_SHORT).show();
315+
return;
316+
}
317+
313318
Notification mNotification;
314319
NotificationManager mNotificationManager;
315320
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
316321

317322
mNotification = new NotificationCompat.Builder(this)
318323
// 设置小图标
319324
.setSmallIcon(R.mipmap.ic_launcher)
320-
.setTicker("这是一条测试推送信息")
325+
.setTicker("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")
321326
// 设置标题
322327
.setContentTitle("V免签测试推送")
323328
// 设置内容
324-
.setContentText("这是一条测试推送信息")
329+
.setContentText("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")
325330
// 设置Notification提示铃声为系统默认铃声
326331
.setSound(
327332
RingtoneManager.getActualDefaultRingtoneUri(
@@ -331,7 +336,7 @@ public void checkPush(View v){
331336
// 点击Notification的时候自动移除
332337
.build();
333338

334-
Toast.makeText(MainActivity.this, "已推送信息,如果权限,那么将会有下一条提示!", Toast.LENGTH_SHORT).show();
339+
//Toast.makeText(MainActivity.this, "已推送信息,如果权限,那么将会有下一条提示!", Toast.LENGTH_SHORT).show();
335340

336341

337342

app/src/main/java/com/vone/vmq/NeNotificationService.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void releaseWakeLock()
6464

6565
@Override
6666
public void onAccessibilityEvent(AccessibilityEvent event) {
67-
67+
Log.d(TAG, "onAccessibilityEvent: "+event);
6868

6969
if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) {
7070
Log.d(TAG, "onAccessibilityEvent: 监控到新的推送");
@@ -133,11 +133,11 @@ public void onAccessibilityEvent(AccessibilityEvent event) {
133133
if (!texts.isEmpty()) {
134134
for (CharSequence ctext : texts) {
135135
String text = ctext.toString();
136-
if (text.equals("这是一条测试推送信息")){
136+
if (text.equals("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")){
137137
Handler handlerThree=new Handler(Looper.getMainLooper());
138138
handlerThree.post(new Runnable(){
139139
public void run(){
140-
Toast.makeText(getApplicationContext() ,"监听服务运行正常,可以监听到推送!",Toast.LENGTH_SHORT).show();
140+
Toast.makeText(getApplicationContext() ,"监听权限正常!",Toast.LENGTH_SHORT).show();
141141
}
142142
});
143143
}
@@ -154,9 +154,12 @@ public void run(){
154154
protected void onServiceConnected() {
155155
//设置监听配置
156156
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
157-
info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
157+
info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED |
158+
AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED |
159+
AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
158160
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
159-
info.notificationTimeout = 100;
161+
162+
info.notificationTimeout = 10;
160163
setServiceInfo(info);
161164

162165
//读入保存的配置数据并显示

0 commit comments

Comments
 (0)