From 0110c4c10a3ad4c88cab7f321c74148e8d641d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A1=BE=E7=8E=AE=E5=8D=8E?= Date: Thu, 11 Jun 2020 22:05:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=9A=90=E8=97=8F=E5=9C=A8=E6=A0=87=E9=A2=98=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E5=86=85=E5=AE=B9=E9=87=8C=20#102?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 尝试修复信息隐藏在标题而不是内容里 --- .../AlipayPmentayNotificationHandle.java | 68 +++++++++++++------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java b/app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java index 4901018..e860136 100644 --- a/app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java +++ b/app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java @@ -30,7 +30,27 @@ public void handleNotification(){ if(title.contains("支付宝") | title.contains("收钱码") | title.contains("收款通知")){ //不可将转账判断延后放,以防止通过昵称虚构金额 if(content.contains("向你转了1笔钱")){ - Map postmap=new HashMap(); + transfercodePush(); + return ; + } + + if(content.contains("成功收款") | content.contains("向你付款")){ + collectioncodePush(true); + return ; + } + } + if(isInfoHideInTitle()){ + collectioncodePush(false); + return ; + } + + + + + } + + private void transfercodePush(){ + Map postmap=new HashMap(); postmap.put("type","alipay-transfer"); postmap.put("time",notitime); postmap.put("title","转账"); @@ -50,25 +70,33 @@ public void handleNotification(){ postpush.doPost(postmap); return ; - } - - if(content.contains("成功收款") | content.contains("向你付款")){ - Map postmap=new HashMap(); - postmap.put("type","alipay"); - postmap.put("time",notitime); - postmap.put("title","支付宝支付"); - postmap.put("money",extractMoney(content)); - postmap.put("content",content); - - postpush.doPost(postmap); - return ; - } - } - - - - } - + + } + + private void collectioncodePush(boolen isinfoincontent){ + Map postmap=new HashMap(); + postmap.put("type","alipay"); + postmap.put("time",notitime); + postmap.put("title","支付宝支付"); + if(isinfoincontent){ + postmap.put("money",extractMoney(content)); + postmap.put("content",content); + }else + { + postmap.put("money",extractMoney(title)); + postmap.put("content",title); + } + + postpush.doPost(postmap); + return ; + } + + private boolen isInfoHideInTitle(){ + if(title.contains("成功收款")&&content.contains("查看余额")) + return true; + return false; + + } private String whoTransferred(String content){ Pattern pattern = Pattern.compile("(.*)(已成功向你转了)"); Matcher matcher = pattern.matcher(content);