diff --git a/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java b/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java index ec2499a3..8d9014fb 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/services/HongbaoService.java @@ -124,6 +124,9 @@ private boolean watchNotifications(AccessibilityEvent event) { if (parcelable instanceof Notification) { Notification notification = (Notification) parcelable; try { + /* 清除signature,避免进入会话后误判*/ + signature.cleanSignature(); + notification.contentIntent.send(); } catch (PendingIntent.CanceledException e) { e.printStackTrace(); diff --git a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java index 555d63a6..419a8781 100644 --- a/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java +++ b/app/src/main/java/xyz/monkeytong/hongbao/utils/HongbaoSignature.java @@ -61,4 +61,11 @@ private String[] getSenderContentDescriptionFromNode(AccessibilityNodeInfo node) } return result; } + + public void cleanSignature(){ + this.content = ""; + this.time = ""; + this.sender =""; + } + }