Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容新版支付宝并支持开机自启、错误重试等功能 #45

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
12b3252
update
zwc456baby Jun 5, 2022
b28c230
fix bug
zwc456baby Jun 5, 2022
29a2ef9
支持常驻
zhouzhouprogram Jun 6, 2022
28eac36
自定义签名
zhouzhouprogram Jun 6, 2022
637c790
支持开机启动(必须打开自启权限)
zhouzhouprogram Jun 6, 2022
382329c
fix
zhouzhouprogram Jun 6, 2022
4e002ef
fix
zhouzhouprogram Jun 6, 2022
fc461fc
modify
zhouzhouprogram Jun 7, 2022
97f24b2
支持开机启动、支持通知失败自动重试一次、支持使用service唤醒设备通知
zhouzhouprogram Jun 7, 2022
d1cbca8
m
zhouzhouprogram Jun 7, 2022
91add63
fix
zhouzhouprogram Jun 7, 2022
63af1cd
m
zhouzhouprogram Jun 7, 2022
047d51c
修复子线程可能导致的问题
zhouzhouprogram Jun 7, 2022
4a093e6
m
zhouzhouprogram Jun 7, 2022
658bb71
m
zwc456baby Jun 8, 2022
d726751
m
zhouzhouprogram Jun 8, 2022
556969d
支持支付宝店员收款
zhouzhouprogram Jun 8, 2022
3ed2c90
m
zwc456baby Jun 9, 2022
f1bbe2e
优化内存占用
zwc456baby Jun 9, 2022
fc50235
m
zhouzhouprogram Jun 11, 2022
2ddd715
支持企业微信小薇商户二维码收款
zhouzhouprogram Sep 6, 2022
7c7423f
增加一个参数供后台判断是重试还是首次推送
zhouzhouprogram Sep 15, 2022
2c250d3
增加五次重试机制
zhouzhouprogram Sep 15, 2022
1ac9fb7
增加通知信息文件写入功能,增加错误捕获
zhouzhouprogram Sep 15, 2022
eacc657
修复企业微信对外收款,大额时候的匹配问题
zhouzhouprogram Sep 16, 2022
8d2144e
m
zhouzhouprogram Sep 19, 2022
b054d3f
m
zhouzhouprogram Oct 15, 2022
9987e9c
兼容最新企业微信,支持企业微信对外收款最新版
zhouzhouprogram Dec 22, 2022
e0d236d
新版支付宝通知带积分情况处理
zhouzhouprogram Dec 28, 2022
f24c4d3
修复新版支付宝匹配金额
zhouzhouprogram May 17, 2024
d3f4510
升级到api 28
zhouzhouprogram May 17, 2024
e56a800
兼容微信8.0.50
zhouzhouprogram Jul 9, 2024
4bc2759
某些vpn开启会导致连接假死,关闭连接池避免该问题
zhouzhouprogram Jul 10, 2024
7e9095e
修改readme,增加Android15相关的说明
example Dec 1, 2024
1d8158e
修复识别问题
zhouzhouprogram Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
/captures
.externalNativeBuild

*.jks
/app/authkey.jks

56 changes: 47 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,66 @@
V免签 —— 个人开发者收款解决方案
===============

## Android 15 新限制

请注意,Android 15 新系统,对app权限进一步限制,需要打开usb调试模式,使用adb执行shell命令:

```
appops set com.vone.qrcode RECEIVE_SENSITIVE_NOTIFICATIONS allow
```

手动授予 `RECEIVE_SENSITIVE_NOTIFICATIONS` 权限,才能正常监听某些 支付宝 消息,否则会导致漏单等情况。这是Android15 新加入的限制,目前没有其他办法绕过

> 部分消息会被系统拦截,部分消息能够正常监听,这是新系统的默认行为,并非软件无法监听。手动授予权限后,才能监听到完整的通知消息
> Android 14 以及低版本没有这个限制

## 简介

此处为fork自原作者的修改版
主要修改增加几项功能:

1. 支持开机自启(国内定制系统需手动开启自启权限)
2. 支持post失败后再重试一次(这次重试是强制亮屏的)
3. ios设备可以找一台安卓设备-》绑定店员进行收款通知了

优化功能:

1. 优化了里面大量的 okhttp 的访问,做成了单例,防止某些情况下可能导致的内存溢出、错误崩溃等等
2. 增加了一次网络重试(没有做三次、四次是防止重复提交导致订单出问题),而且是唤起到前台的网络重试,(之所以唤起到前台,是测试过小米等机型,如果app长时间在后台(6小时以上),app会被限制网络,除非启动前台Service或者Activity

修改版特点:可以装在自己的日用安卓机器上,不用专门找一台机器亮屏挂机了。因为修改版支持错误重试,如果装在日用机器上推送失败,软件会强制打开一个前台Service以及一个前台Activity

前台页面的打开需要手动开启两项权限:后台弹出页面、锁屏显示

> 在使用过程中,可以将屏幕关闭,省电,然后在收到支付信息后,软件会自动的打开前台并推送支付信息。
> 软件里面的心跳本来想移除用来省电的,但基于可靠性,虽然心跳会略微增加耗电,但还是没有去除

---

**以下赞助链接采用此系统搭建,您可以随时赞助测试其稳定性:**

[赞助链接](https://card.zwc365.com/p/2eyzmzlwcdc076wm8zc2)

如果 APK 出现什么问题,不兼容你的手机或新版支付宝,可以从赞助链接与我反馈

如果你不想搭建或者不会搭建 V免签,可以用我搭建好的 [V免签系统](http://pay.zwc365.com/)

===============


V免签 是基于SpringBoot 2.1.1/ThinkPhP5.1 实现的一套免签支付程序,主要包含以下特色:

+ JAVA、PHP双服务端,总有一款适合你服务器
+ 超简单Api使用,提供统一Api实现收款回调
+ 免费、开源

> v免签开发交流群:992029073

> bug反馈请建立issues

> Java版服务端地址:【 https://github.com/szvone/Vmq 】

> PHP 版服务端地址:【 https://github.com/szvone/vmqphp 】

## 前言


V免签为完全开源项目,开源项目意味着作者没有任何收入来源,仅凭个人空闲时间开发,如果您有经济条件,您可以赞助本项目的开发(下方收款码),如果您不想赞助,也请您点击上面的Star给一个星星,也是对我莫大的认同,感谢各位的支持。

![微信赞助](https://s2.ax1x.com/2019/12/20/QOjH1O.jpg)![支付宝赞助](https://s2.ax1x.com/2019/12/20/QOveNq.jpg)

[赞助链接](https://card.zwc365.com/p/2eyzmzlwcdc076wm8zc2)

## 安装

Expand Down
Binary file removed app/app-release.apk
Binary file not shown.
25 changes: 21 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
compileSdkVersion 28
// buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.vone.qrcode"
minSdkVersion 19
targetSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
//加载资源
Properties properties = new Properties()
InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream();
properties.load(inputStream)

signConfig {
storeFile file(properties.getProperty("STORE_FILE_NAME"))//签名文件路径,
storePassword properties.getProperty("KEY_PASSWORD") //密码
keyAlias properties.getProperty("STORE_ALIAS")
keyPassword properties.getProperty("KEY_PASSWORD") //密码
}
}
buildTypes {
debug {
signingConfig signingConfigs.signConfig // 配置debug包的签名,接入微信分享必须验证签名
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.signConfig
}
}
}
Expand All @@ -25,7 +42,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
// compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.zxing:core:3.3.0'
compile 'com.squareup.okhttp3:okhttp:3.7.0'
compile 'com.squareup.okio:okio:1.12.0'
Expand Down
41 changes: 36 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@
<uses-permission android:name="android.permission.CAMERA" /> <!-- 摄像头权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 自动聚焦权限 -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- 新增权限 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
android:name="com.vone.vmq.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.vone.vmq.MainActivity">
<activity
android:name="com.vone.vmq.MainActivity"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="com.google.zxing.activity.CaptureActivity"/>

android:name="com.google.zxing.activity.CaptureActivity"
android:excludeFromRecents="true" />

<service
android:name="com.vone.vmq.NeNotificationService2"
Expand All @@ -37,7 +47,28 @@
</intent-filter>
</service>

<service android:name="com.vone.vmq.ForegroundServer" />

<activity
android:name="com.vone.vmq.LockShowActivity"
android:excludeFromRecents="true"
android:launchMode="singleInstance" />


<receiver
android:name="com.vone.vmq.StartReceive"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />

<data
android:host="66469"
android:scheme="android_secret_code" />
</intent-filter>
</receiver>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static Bitmap addLogo(Bitmap src, Bitmap logo) {
canvas.drawBitmap(src, 0, 0, null);
canvas.scale(scaleFactor, scaleFactor, srcWidth / 2, srcHeight / 2);
canvas.drawBitmap(logo, (srcWidth - logoWidth) / 2, (srcHeight - logoHeight) / 2, null);
canvas.save(Canvas.ALL_SAVE_FLAG);
canvas.save();
canvas.restore();
} catch (Exception e) {
bitmap = null;
Expand Down
35 changes: 35 additions & 0 deletions app/src/main/java/com/vone/vmq/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.vone.vmq;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.os.Process;
import android.util.Log;

public class App extends Application {

@SuppressLint("StaticFieldLeak")
private static Context mContext;

public static Context getContext() {
return mContext;
}

@Override
public void onCreate() {
super.onCreate();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
Utils.putStr(App.this, "exception:" + Log.getStackTraceString(throwable));
Process.killProcess(Process.myPid());
}
});
}

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
mContext = base;
}
}
16 changes: 16 additions & 0 deletions app/src/main/java/com/vone/vmq/Constant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.vone.vmq;

/**
* Created by user68 on 2018/7/30.
*/

@SuppressWarnings({"unused", "WeakerAccess"})
public class Constant {

public final static String GET_MESSAGE_KEY = "get_message_key";

public final static String FINISH_LOCK_SHOW_ACTIVITY = "finish_lock_show_activity";
public final static String UPDATA_MESSAGE_DATA_ACTION = "updata_message_data_action";
public final static String FINISH_FOREGROUND_SERVICE = "finish_foreground_service";

}
Loading