diff --git a/README.md b/README.md index 6bc37e2..fadf853 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,9 @@ V免签为完全开源项目,开源项目意味着作者没有任何收入来 + 本系统原理为监控收款后手机的通知栏推送消息,所以请保持微信/支付宝/V免签监控端后台正常运行,且添加到内存清理白名单! ## 更新记录 + + v1.4(2019.04.23) + + 修复部分手机无法正确检测监听权限问题,点击监听权限按钮后,如果一切正常,状态栏会收到推送信息,并且会提示监听权限正常! + + v1.3(2019.04.20) + 添加后台心跳线程熄屏运行权限,更加稳定啦(推荐更新到此版本) diff --git a/app/app-release.apk b/app/app-release.apk index 7b1bda7..f156d75 100644 Binary files a/app/app-release.apk and b/app/app-release.apk differ diff --git a/app/src/main/java/com/vone/vmq/MainActivity.java b/app/src/main/java/com/vone/vmq/MainActivity.java index 5179b20..855bce1 100644 --- a/app/src/main/java/com/vone/vmq/MainActivity.java +++ b/app/src/main/java/com/vone/vmq/MainActivity.java @@ -310,6 +310,11 @@ private boolean gotoNotificationAccessSetting(Context context) { public void checkPush(View v){ + if (btnStart.getText().equals("检测服务状态")){ + Toast.makeText(MainActivity.this, "请先开启服务!", Toast.LENGTH_SHORT).show(); + return; + } + Notification mNotification; NotificationManager mNotificationManager; mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); @@ -317,11 +322,11 @@ public void checkPush(View v){ mNotification = new NotificationCompat.Builder(this) // 设置小图标 .setSmallIcon(R.mipmap.ic_launcher) - .setTicker("这是一条测试推送信息") + .setTicker("这是一条测试推送信息,如果程序正常,则会提示监听权限正常") // 设置标题 .setContentTitle("V免签测试推送") // 设置内容 - .setContentText("这是一条测试推送信息") + .setContentText("这是一条测试推送信息,如果程序正常,则会提示监听权限正常") // 设置Notification提示铃声为系统默认铃声 .setSound( RingtoneManager.getActualDefaultRingtoneUri( @@ -331,7 +336,7 @@ public void checkPush(View v){ // 点击Notification的时候自动移除 .build(); - Toast.makeText(MainActivity.this, "已推送信息,如果权限,那么将会有下一条提示!", Toast.LENGTH_SHORT).show(); + //Toast.makeText(MainActivity.this, "已推送信息,如果权限,那么将会有下一条提示!", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/com/vone/vmq/NeNotificationService.java b/app/src/main/java/com/vone/vmq/NeNotificationService.java index ced371c..02cc75a 100644 --- a/app/src/main/java/com/vone/vmq/NeNotificationService.java +++ b/app/src/main/java/com/vone/vmq/NeNotificationService.java @@ -64,7 +64,7 @@ public void releaseWakeLock() @Override public void onAccessibilityEvent(AccessibilityEvent event) { - + Log.d(TAG, "onAccessibilityEvent: "+event); if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) { Log.d(TAG, "onAccessibilityEvent: 监控到新的推送"); @@ -133,11 +133,11 @@ public void onAccessibilityEvent(AccessibilityEvent event) { if (!texts.isEmpty()) { for (CharSequence ctext : texts) { String text = ctext.toString(); - if (text.equals("这是一条测试推送信息")){ + if (text.equals("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")){ Handler handlerThree=new Handler(Looper.getMainLooper()); handlerThree.post(new Runnable(){ public void run(){ - Toast.makeText(getApplicationContext() ,"监听服务运行正常,可以监听到推送!",Toast.LENGTH_SHORT).show(); + Toast.makeText(getApplicationContext() ,"监听权限正常!",Toast.LENGTH_SHORT).show(); } }); } @@ -154,9 +154,12 @@ public void run(){ protected void onServiceConnected() { //设置监听配置 AccessibilityServiceInfo info = new AccessibilityServiceInfo(); - info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED; + info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED | + AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED | + AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED; info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC; - info.notificationTimeout = 100; + + info.notificationTimeout = 10; setServiceInfo(info); //读入保存的配置数据并显示