Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
合并master version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuagu committed Mar 8, 2020
2 parents 43e7175 + f90164f commit 15914c5
Show file tree
Hide file tree
Showing 80 changed files with 688 additions and 402 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
7 changes: 3 additions & 4 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 1 addition & 19 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
### 没有办法的获取到收款推送的办法

### 提示
- `很感谢你的使用`
- `如无必要,不要star、fork,使star数控制在500以下,fork400以下`
Expand All @@ -14,25 +12,9 @@



#### 目前个人收款现状

##### 个人申请支付接口现状

- `原生支付宝,微信支付`

- `支付宝只服务于有营业执照、个体工商户的商户。就算你有钱但没实体店铺在某宝上也是买不到的。截止目前无法以个人身份(或以个人为主体)直接申请API。网上那些 “个人申请支付宝xx接口” 的文章就不要看了,节约时间。微信同支付宝,不支付个人申请。`

##### 原先的方法不管用了

- 最好的方法是抓取与支付宝绑定的邮件,但是只要你绑定了电话,支付包就不发邮件和短信提醒你有收款到帐了。

- 抓自己支付宝网页版的账单,这个关键在于复制出cookie,原先一个cookie可以使用一个月,现在是动态的5分钟就变了。使用模拟登录,支付宝的风控很厉害,导致模拟登录容易被封。



#### 应用工作原理

- 手机安装一个app,然后这个服务监听手机收到的通知,如果是收到收款的通知,就把信息推送到指定的url去。
- 手机安装一个app,然后这个服务监听手机收到的通知,如果是想要获取的通知,就把信息推送到指定的url去。

#### 本软件使用方法

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.weihuagu.receiptnotice"
minSdkVersion 19
targetSdkVersion 28
versionCode 14
versionName "1.3"
versionCode 15
versionName "1.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down

This file was deleted.

15 changes: 10 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:name="com.google.android.actions"
android:resource="@xml/receiptnoticeaccessibilityservice_config" />

<activity android:name=".MainActivity">
<activity android:name=".view.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
Expand All @@ -30,14 +30,14 @@
</intent-filter>
</activity>
<activity
android:name=".FileLogActivity"
android:name=".view.FileLogActivity"
android:label="@string/filelog_title">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.showfilelog" />
</intent-filter>
</activity>
<activity
android:name=".IllustrateDecryptActivity"
android:name=".view.IllustrateDecryptActivity"
android:label="@string/illustratedecrypt_title">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.illustratedecryptmethod" />
Expand All @@ -46,8 +46,13 @@
</intent-filter>
</activity>
<activity android:name="com.github.pedrovgs.lynx.LynxActivity" />
<activity android:name=".PreferenceActivity" />
<activity android:name=".UserAgreementActiviy" />
<activity android:name=".view.PreferenceActivity" />
<activity android:name=".view.UserAgreementActiviy" />
<activity android:name=".view.FollowThirdAppActivity">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.followthirdapp" />
</intent-filter>
</activity>

<service
android:name=".NLService"
Expand Down
119 changes: 19 additions & 100 deletions app/src/main/java/com/weihuagu/receiptnotice/NLService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import android.util.Log;

import android.os.Bundle;
import android.content.SharedPreferences;
import android.content.Context;
import android.os.Build;
import android.widget.Toast;

import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.action.ActionStatusBarNotification;
import com.weihuagu.receiptnotice.action.HandlePost;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.NotificationUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.message.MessageConsumer;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class NLService extends NotificationListenerService implements AsyncResponse, IDoPost, ActionStatusBarNotification {
public class NLService extends NotificationListenerService implements ActionStatusBarNotification, MessageConsumer {
private String TAG="NLService";
private String posturl=null;
private Context context=null;
Expand Down Expand Up @@ -55,7 +58,7 @@ public void onNotificationPosted(StatusBarNotification sbn) {
return;

//接受推送处理
NotificationHandle notihandle =new NotificationHandleFactory().getNotificationHandle(pkg,notification,this);
NotificationHandle notihandle =new NotificationHandleFactory().getNotificationHandle(pkg,notification,new HandlePost());
if(notihandle!=null){
notihandle.setStatusBarNotification(sbn);
notihandle.setActionStatusbar(this);
Expand All @@ -69,7 +72,7 @@ public void onNotificationPosted(StatusBarNotification sbn) {
LogUtil.debugLog("这是检测之外的其它通知");
LogUtil.debugLog("包名是"+pkg);
NotificationUtil.printNotify(notification);
//printNotify(getNotitime(notification),getNotiTitle(extras),getNotiContent(extras));

LogUtil.debugLog("**********************");


Expand Down Expand Up @@ -102,101 +105,17 @@ private void sendToast(String msg){
Toast.makeText(getApplicationContext(),msg,Toast.LENGTH_LONG).show();
}

private String getNotitime(Notification notification){

long when=notification.when;
Date date=new Date(when);
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm");
String notitime=format.format(date);
return notitime;

}

private String getNotiTitle(Bundle extras){
String title=null;
// 获取通知标题
title = extras.getString(Notification.EXTRA_TITLE, "");
return title;
}

private String getNotiContent(Bundle extras){
String content=null;
// 获取通知内容
content = extras.getString(Notification.EXTRA_TEXT, "");
return content;
}

private void printNotify(String notitime,String title,String content){
Log.d(TAG,notitime);
Log.d(TAG,title);
Log.d(TAG,content);
}


public void doPost(Map<String, String> params){
if(this.posturl==null|params==null)
return;
LogUtil.debugLog("开始准备进行post");
if(params.get("repeatnum")!=null){
doPostTask(params,null);
return;
}

PreferenceUtil preference=new PreferenceUtil(getBaseContext());
PostMapFilter mapfilter=new PostMapFilter(preference,params,this.posturl);
Map<String, String> recordmap=mapfilter.getLogMap();
Map<String, String> postmap=mapfilter.getPostMap();

doPostTask(postmap,recordmap);



}

private void doPostTask(Map<String, String> postmap,Map<String, String> recordmap){
PostTask mtask = new PostTask();
String tasknum=RandomUtil.getRandomTaskNum();
mtask.setRandomTaskNum(tasknum);
mtask.setOnAsyncResponse(this);
if(recordmap!=null)
LogUtil.postRecordLog(tasknum,recordmap.toString());
else
LogUtil.postRecordLog(tasknum,postmap.toString());

mtask.execute(postmap);


}


@Override
public void onDataReceivedSuccess(String[] returnstr) {
Log.d(TAG,"Post Receive-returned post string");
Log.d(TAG,returnstr[2]);
LogUtil.postResultLog(returnstr[0],returnstr[1],returnstr[2]);



}
@Override
public void onDataReceivedFailed(String[] returnstr,Map<String ,String> postedmap) {
// TODO Auto-generated method stub
Log.d(TAG,"Post Receive-post error");
LogUtil.postResultLog(returnstr[0],returnstr[1],returnstr[2]);
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
if(preference.isPostRepeat()){
String repeatlimit=preference.getPostRepeatNum();
int limitnum=Integer.parseInt(repeatlimit);
String repeatnumstr=postedmap.get("repeatnum");
int repeatnum=Integer.parseInt(repeatnumstr);
if(repeatnum<=limitnum)
doPost(postedmap);
}

}

private void subMessage() {
public void subMessage() {
LiveEventBus
.get("get_alipay_transfer_money", TestBeanWithPostFullInformationMap.class)
.observeForever( new Observer<TestBeanWithPostFullInformationMap>() {
@Override
public void onChanged(@Nullable TestBeanWithPostFullInformationMap testpostbean) {

}
});

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import android.app.ActivityManager;
import android.app.Service;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
Expand All @@ -22,31 +20,30 @@
import java.util.List;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.lang.System;
import java.lang.Thread;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLSocketFactory;
import com.google.gson.Gson;
import com.weihuagu.receiptnotice.util.DeviceInfoUtil;
import com.weihuagu.receiptnotice.util.ExternalInfoUtil;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.SSLSocketFactoryCompat;

import io.socket.emitter.Emitter;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.Timer;
import java.util.TimerTask;
import okhttp3.MediaType;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.TlsVersion;
import okhttp3.ConnectionSpec;

Expand Down
Loading

0 comments on commit 15914c5

Please sign in to comment.