Skip to content

Commit

Permalink
first v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuagu committed Aug 19, 2018
1 parent 305ac6b commit d70fc4d
Show file tree
Hide file tree
Showing 39 changed files with 1,307 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 没有办法的获取到收款推送的办法

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

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

- 原生支付宝,微信支付

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

- 结论:不可行
##### 原先的方法不管用了

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

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



##### 实在是没有法子的办法

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

##### 本软件使用方法

- 安装后先将软件加入系统白名单,各个安卓系统的方法各有不同

- 打开软件自动跳转到获取通知权限页面,允许本应用监控通知

- 返回到软件主页,填写你要接受收款信息通知的url,软件在接到收款通知后,会用post的方法,发送json信息.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

def keystorePropertiesFile = rootProject.file("./app/key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.weihuagu.receiptnotice"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}


signingConfigs{
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
26 changes: 26 additions & 0 deletions app/src/androidTest/java/com/xinri/ExampleInstrumentedTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.xinri;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.xinri", appContext.getPackageName());
}
}
25 changes: 25 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.weihuagu.receiptnotice">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".NLService"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.weihuagu.receiptnotice;

import java.util.List;

public interface AsyncResponse {
public void onDataReceivedSuccess(String returnstr);
public void onDataReceivedFailed();
}
98 changes: 98 additions & 0 deletions app/src/main/java/com/weihuagu/receiptnotice/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/

package com.weihuagu.receiptnotice;

public class Constants {
/**
* Actions.
*/
public static final String ACTION_BROWSER_CONTEXT_MENU = "ACTION_BROWSER_OPEN";

/**
* Extras.
*/
public static final String EXTRA_ID = "EXTRA_ID";
public static final String EXTRA_ACTION_ID = "EXTRA_ACTION_ID";
public static final String EXTRA_NEW_TAB = "EXTRA_NEW_TAB";
public static final String EXTRA_LABEL = "EXTRA_LABEL";
public static final String EXTRA_URL = "EXTRA_URL";
public static final String EXTRA_FOLDER_ID = "EXTRA_FOLDER_ID";
public static final String EXTRA_HIT_TEST_RESULT = "EXTRA_HIT_TEST_RESULT";
public static final String EXTRA_INCOGNITO = "EXTRA_INCOGNITO";

/**
* Specials urls.
*/
public static final String URL_ABOUT_BLANK = "about:blank";
public static final String URL_ABOUT_START = "about:start";
public static final String URL_ABOUT_TUTORIAL = "about:tutorial";

/**
* User agents
*/
public static final String USER_AGENT_ANDROID = "";
public static final String USER_AGENT_DESKTOP = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24";

/**
* Preferences.
*/
public static final String PREFERENCE_HOME_PAGE = "PREFERENCE_HOME_PAGE";
public static final String PREFERENCE_SEARCH_URL = "PREFERENCE_SEARCH_URL";
public static final String PREFERENCE_START_PAGE_LIMIT = "PREFERENCE_START_PAGE_LIMIT";
public static final String PREFERENCE_BUBBLE_POSITION = "PREFERENCE_BUBBLE_POSITION";
public static final String PREFERENCE_TOOLBARS_AUTOHIDE_DURATION = "PREFERENCE_TOOLBARS_AUTOHIDE_DURATION";
public static final String PREFERENCES_SWITCH_TABS_METHOD = "PREFERENCES_SWITCH_TABS_METHOD";

public static final String PREFERENCE_ENABLE_JAVASCRIPT = "PREFERENCE_ENABLE_JAVASCRIPT";
public static final String PREFERENCE_ENABLE_IMAGES = "PREFERENCE_ENABLE_IMAGES";
public static final String PREFERENCE_USE_WIDE_VIEWPORT = "PREFERENCE_USE_WIDE_VIEWPORT";
public static final String PREFERENCE_LOAD_WITH_OVERVIEW = "PREFERENCE_LOAD_WITH_OVERVIEW";
public static final String PREFERENCE_USER_AGENT = "PREFERENCE_USER_AGENT";
public static final String PREFERENCE_PLUGINS = "PREFERENCE_PLUGINS";

public static final String PREFERENCE_ACCEPT_COOKIES = "PREFERENCE_ACCEPT_COOKIES";
public static final String PREFERENCE_ENABLE_GEOLOCATION = "PREFERENCE_ENABLE_GEOLOCATION";
public static final String PREFERENCE_REMEMBER_FORM_DATA = "PREFERENCE_REMEMBER_FORM_DATA";
public static final String PREFERENCE_REMEMBER_PASSWORDS = "PREFERENCE_REMEMBER_PASSWORDS";

public static final String PREFERENCE_HISTORY_SIZE = "PREFERENCE_HISTORY_SIZE";
public static final String PREFERENCE_CLEAR_CACHE = "PREFERENCE_CLEAR_CACHE";
public static final String PREFERENCE_WEBSITES_SETTINGS = "PREFERENCE_WEBSITES_SETTINGS";
public static final String PREFERENCE_SSL_EXCEPTIONS = "PREFERENCE_SSL_EXCEPTIONS";
public static final String PREFERENCE_CLEAR_HISTORY = "PREFERENCE_CLEAR_HISTORY";
public static final String PREFERENCE_CLEAR_COOKIES = "PREFERENCE_CLEAR_COOKIES";
public static final String PREFERENCE_CLEAR_GEOLOCATION = "PREFERENCE_CLEAR_GEOLOCATION";
public static final String PREFERENCE_CLEAR_FORM_DATA = "PREFERENCE_CLEAR_FORM_DATA";
public static final String PREFERENCE_CLEAR_PASSWORDS = "PREFERENCE_CLEAR_PASSWORDS";
public static final String PREFERENCE_INCOGNITO_BY_DEFAULT = "PREFERENCE_INCOGNITO_BY_DEFAULT";

public static final String PREFERENCE_TEXT_SCALING = "PREFERENCE_TEXT_SCALING";
public static final String PREFERENCE_MINIMUM_FONT_SIZE = "PREFERENCE_MINIMUM_FONT_SIZE";
public static final String PREFERENCE_INVERTED_DISPLAY = "PREFERENCE_INVERTED_DISPLAY";
public static final String PREFERENCE_INVERTED_DISPLAY_CONTRAST = "PREFERENCE_INVERTED_DISPLAY_CONTRAST";

public static final String PREFERENCE_BOOKMARKS_SORT_MODE = "PREFERENCE_BOOKMARKS_SORT_MODE";

public static final String PREFERENCE_FULL_SCREEN = "PREFERENCE_FULL_SCREEN";

public static final String PREFERENCE_RESTORE_TABS = "PREFERENCE_RESTORE_TABS";

public static final String PREFERENCE_UI_TYPE = "PREFERENCE_UI_TYPE";
public static final String PREFERENCE_CLOSE_PANEL_ON_NEW_TAB = "PREFERENCE_CLOSE_PANEL_ON_NEW_TAB";

public static final String PREFERENCE_JS_LOG_ON_LOGCAT = "PREFERENCE_JS_LOG_ON_LOGCAT";

/**
* Technical preferences.
*/
public static final String TECHNICAL_PREFERENCE_LAST_HISTORY_TRUNCATION = "TECHNICAL_PREFERENCE_LAST_HISTORY_TRUNCATION";
public static final String TECHNICAL_PREFERENCE_FIRST_RUN = "TECHNICAL_PREFERENCE_FIRST_RUN";
public static final String TECHNICAL_PREFERENCE_LAST_RUN_VERSION_CODE = "TECHNICAL_PREFERENCE_LAST_RUN_VERSION_CODE";
public static final String TECHNICAL_PREFERENCE_ADDON_ENABLED = "TECHNICAL_PREFERENCE_ADDON_ENABLED_";
public static final String TECHNICAL_PREFERENCE_SAVED_TABS = "TECHNICAL_PREFERENCE_SAVED_TABS";
public static final String TECHNICAL_PREFERENCE_HOMEPAGE_URL_UPDATE_NEEDED = "TECHNICAL_PREFERENCE_HOMEPAGE_URL_UPDATE_NEEDED";
}
94 changes: 94 additions & 0 deletions app/src/main/java/com/weihuagu/receiptnotice/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.weihuagu.receiptnotice;

import android.support.v7.app.AppCompatActivity;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;

import android.content.SharedPreferences;
import android.widget.Toast;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.EditText;


public class MainActivity extends AppCompatActivity implements View.OnClickListener{

private static final String TAG = "MainActivity";
private Button btnsetposturl;
private EditText posturl;
private SharedPreferences sp ;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}

private void initView() {

btnsetposturl=(Button) findViewById(R.id.btnsetposturl);
btnsetposturl.setOnClickListener(this);
posturl = (EditText) findViewById(R.id.posturl);
sp = getSharedPreferences("url", Context.MODE_PRIVATE);


}

@Override
protected void onResume() {
super.onResume();
boolean isAuthor=isNotificationServiceEnable();
if (!isAuthor){
//直接跳转通知授权界面
//android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS是API 22才加入到Settings里,这里直接写死
startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
}
}

@Override
protected void onDestroy() {
super.onDestroy();
}

/**
* 是否已授权
*
* @return
*/
private boolean isNotificationServiceEnable() {
return NotificationManagerCompat.getEnabledListenerPackages(this).contains(getPackageName());
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnsetposturl:
setPostUrl();
break;
}
}

private void setPostUrl() {
SharedPreferences.Editor edit = sp.edit();
//通过editor对象写入数据
edit.putString("posturl",posturl.getText().toString());
//提交数据存入到xml文件中
edit.commit();
Toast.makeText(getApplicationContext(), "已经设置posturl为:"+posturl.getText().toString(),
Toast.LENGTH_SHORT).show();
}




}
Loading

0 comments on commit d70fc4d

Please sign in to comment.