Android 应用,用于监听系统通知,当收到微信/支付宝支付通知时,提取金额并上报到 CatPay 服务器。
- 监听微信支付通知
- 监听支付宝支付通知
- 自动提取收款金额
- 上报到服务器
/api/device/report - 首次配置服务器地址和设备Key
- React Native + Expo
- TypeScript
- 原生 Android NotificationListenerService
# 安装依赖
npm install
# 生成 Android 项目
npx expo prebuild --platform android
# 构建 Debug APK
cd android && ./gradlew assembleDebug
# 构建 Release APK
cd android && ./gradlew assembleRelease推送代码后,GitHub Actions 会自动构建 Release APK。
BIND_NOTIFICATION_LISTENER_SERVICE- 监听通知POST_NOTIFICATIONS- 发送通知INTERNET- 网络请求
- 安装 APK 到手机
- 首次启动配置服务器地址和设备 Key
- 授予通知监听权限
- 收到微信/支付宝收款通知后自动上报
POST /api/device/report
Content-Type: application/json
{
"deviceKey": "设备Key",
"amount": 1.23,
"type": "wechat" | "alipay"
}