Skip to content

Commit

Permalink
v1.4版本
Browse files Browse the repository at this point in the history
  • Loading branch information
szvone committed Apr 23, 2019
1 parent c459a1f commit f700546
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ V免签为完全开源项目,开源项目意味着作者没有任何收入来
+ 本系统原理为监控收款后手机的通知栏推送消息,所以请保持微信/支付宝/V免签监控端后台正常运行,且添加到内存清理白名单!

## 更新记录
+ v1.4(2019.04.23)
+ 修复部分手机无法正确检测监听权限问题,点击监听权限按钮后,如果一切正常,状态栏会收到推送信息,并且会提示监听权限正常!

+ v1.3(2019.04.20)
+ 添加后台心跳线程熄屏运行权限,更加稳定啦(推荐更新到此版本)

Expand Down
Binary file modified app/app-release.apk
Binary file not shown.
11 changes: 8 additions & 3 deletions app/src/main/java/com/vone/vmq/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,23 @@ 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);

mNotification = new NotificationCompat.Builder(this)
// 设置小图标
.setSmallIcon(R.mipmap.ic_launcher)
.setTicker("这是一条测试推送信息")
.setTicker("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")
// 设置标题
.setContentTitle("V免签测试推送")
// 设置内容
.setContentText("这是一条测试推送信息")
.setContentText("这是一条测试推送信息,如果程序正常,则会提示监听权限正常")
// 设置Notification提示铃声为系统默认铃声
.setSound(
RingtoneManager.getActualDefaultRingtoneUri(
Expand All @@ -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();



Expand Down
13 changes: 8 additions & 5 deletions app/src/main/java/com/vone/vmq/NeNotificationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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: 监控到新的推送");
Expand Down Expand Up @@ -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();
}
});
}
Expand All @@ -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);

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

0 comments on commit f700546

Please sign in to comment.