Skip to content

Commit

Permalink
尝试修复信息隐藏在标题而不是内容里 c-kzxvldkhX#102
Browse files Browse the repository at this point in the history
尝试修复信息隐藏在标题而不是内容里
  • Loading branch information
WeihuaGu authored and xcorp1986 committed Sep 19, 2020
1 parent 00f44ca commit 78261f4
Showing 1 changed file with 48 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,27 @@ public void handleNotification(){
if(title.contains("支付宝") | title.contains("收钱码") | title.contains("收款通知")){
//不可将转账判断延后放,以防止通过昵称虚构金额
if(content.contains("向你转了1笔钱")){
Map<String,String> postmap=new HashMap<String,String>();
transfercodePush();
return ;
}

if(content.contains("成功收款") | content.contains("向你付款")){
collectioncodePush(true);
return ;
}
}
if(isInfoHideInTitle()){
collectioncodePush(false);
return ;
}




}

private void transfercodePush(){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","alipay-transfer");
postmap.put("time",notitime);
postmap.put("title","转账");
Expand All @@ -50,25 +70,33 @@ public void handleNotification(){

postpush.doPost(postmap);
return ;
}

if(content.contains("成功收款") | content.contains("向你付款")){
Map<String,String> postmap=new HashMap<String,String>();
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<String,String> postmap=new HashMap<String,String>();
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);
Expand Down

0 comments on commit 78261f4

Please sign in to comment.