Compare commits

..

28 Commits

Author SHA1 Message Date
1d2438f0a8 <mymessagemanager>APK 15.12.6 release Publish. 2026-01-06 20:51:18 +08:00
a21f515d7a 更新应用设置,添加微信小店广告链接。 2026-01-06 20:50:00 +08:00
b6642c3960 Merge branch 'winboll' into mymessagemanager 2026-01-06 20:40:05 +08:00
cce4a643e7 编译环境参数调整 2026-01-06 14:08:30 +08:00
61cfa7f3ff 添加微信支付测试窗口 2026-01-04 17:05:12 +08:00
cb9ad1dc57 添加企业微信测试码 2026-01-03 11:16:35 +08:00
98c334f442 移除GitHub工作流配置文件 2026-01-03 10:19:43 +08:00
47c328cd25 <winboll>APK 15.11.8 release Publish. 2025-12-31 20:28:06 +08:00
7134d4e1c8 源码整理 2025-12-31 20:25:15 +08:00
778a1bc98e 添加应用版本号说明 2025-12-15 12:42:50 +08:00
1ecec3515f <mymessagemanager>APK 15.12.5 release Publish. 2025-12-13 21:13:49 +08:00
0a4922f767 <mymessagemanager>APK 15.12.4 release Publish. 2025-12-13 17:23:20 +08:00
faf8e3b8f7 <mymessagemanager>Start New Stage Version. 2025-12-13 17:22:23 +08:00
6b3388ec2a 优化应用设置窗口排版 2025-12-13 17:21:22 +08:00
52c005feab <mymessagemanager>APK 15.12.3 release Publish. 2025-12-10 12:11:13 +08:00
d4e319aae4 添加TTS语音模块安装向导。 2025-12-10 12:09:15 +08:00
b958eba720 <mymessagemanager>APK 15.12.2 release Publish. 2025-12-09 15:29:43 +08:00
8f68dc778b 应用设置页UI调整优化。 2025-12-09 15:28:02 +08:00
8effa62082 编译参数修复 2025-12-09 14:49:39 +08:00
d7bff51148 整体视图优化,增加主题设置菜单。 2025-12-09 14:47:33 +08:00
dae93f07b7 <mymessagemanager>APK 15.12.1 release Publish. 2025-12-09 11:48:49 +08:00
64372e7983 添加米盟广告SDK。UI未调整完成。 2025-12-09 11:46:47 +08:00
e90f905cd8 <mymessagemanager>APK 15.12.0 release Publish. 2025-12-09 11:23:25 +08:00
090070aa0e 更新基础类库,升级应用基础版本号。修改类引用路径。 2025-12-09 11:18:34 +08:00
bb94f87597 更新说明书 2025-12-08 00:56:14 +08:00
669a6eab0c <winboll>APK 15.11.7 release Publish. 2025-12-07 03:42:32 +08:00
a0d65d9f78 <winboll>Start New Stage Version. 2025-12-07 03:41:55 +08:00
f5f9d7c46e 更新应用图标 2025-12-07 03:41:26 +08:00
85 changed files with 2538 additions and 860 deletions

View File

@@ -1,87 +0,0 @@
name: Android CI
# 触发器
on:
push:
tags:
- *-beta
pull_request:
tags:
- *-beta
jobs:
build:
runs-on: ubuntu-latest
# 设置 JDK 环境
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# 获取应用打包秘钥库
- name: Checkout Android Keystore
uses: actions/checkout@v3
with:
repository: zhangsken/keystore # 存储应用打包用的 keystore 的仓库(格式:用户名/仓库名)
token: ${{ secrets.APP_SECRET_TOKEN_1 }} # 连接仓库的 token , 需要单独配置
path: keystore # 仓库的根目录名
# 打包 Stage Release 版本应用
- name: Build with Gradle
run: bash ./gradlew assembleBetaRelease
# 创建release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.APP_SECRET_TOKEN_1 }}
# GitHub 会自动创建 GITHUB_TOKEN 密码以在工作流程中使用。
# 您可以使用 GITHUB_TOKEN 在工作流程运行中进行身份验证。
# 当您启用 GitHub Actions 时GitHub 在您的仓库中安装 GitHub 应用程序。
# GITHUB_TOKEN 密码是一种 GitHub 应用程序 安装访问令牌。
# 您可以使用安装访问令牌代表仓库中安装的 GitHub 应用程序 进行身份验证。
# 令牌的权限仅限于包含您的工作流程的仓库。 更多信息请参阅“GITHUB_TOKEN 的权限”。
# 在每个作业开始之前, GitHub 将为作业提取安装访问令牌。 令牌在作业完成后过期。
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
# 获取 APK 版本号
- name: Get Version Name
uses: actions/github-script@v3
id: get-version
with:
script: |
const str=process.env.GITHUB_REF;
return str.substring(str.indexOf("v"));
result-encoding: string
# 上传至 Release 的资源
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.APP_SECRET_TOKEN_1 }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # 上传网址,无需改动
#asset_path: app/build/outputs/apk/release/app-release.apk # 上传路径(Release)
asset_path: app/build/outputs/apk/beta/release/app-beta-release.apk # 上传路径(WinBoll Stage Release)
asset_name: WinBoll-${{steps.get-version.outputs.result}}0.apk # 资源名
asset_content_type: application/vnd.android.package-archiv # 资源类型
# 存档打包的文件
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: app/build/outputs # 将打包之后的文件全部上传(里面会有混淆的 map 文件)

View File

@@ -1,166 +1,223 @@
#!/usr/bin/bash
# ==============================================================================
# WinBoLL 应用发布脚本
# 功能检查Git源码状态 → 编译Stage Release包 → 添加WinBoLL标签 → 提交并推送源码
# 依赖build.properties、app_update_description.txt项目根目录下
# 使用:./script_name.sh <APP_NAME>
# 作者:豆包&ZhanGSKen<zhangsken@qq.com>
# ==============================================================================
# 检查是否指定了将要发布的应用名称
# 使用 `-z` 命令检查变量是否为空
# ==================== 常量定义 ====================
# 脚本退出码
EXIT_CODE_SUCCESS=0
EXIT_CODE_ERR_NO_APP_NAME=2
EXIT_CODE_ERR_WORK_DIR=1
EXIT_CODE_ERR_GIT_CHECK=1
EXIT_CODE_ERR_ADD_WINBOLL_TAG=1
# Gradle 任务(正式发布)
GRADLE_TASK_PUBLISH="assembleStageRelease"
# Gradle 任务(调试用,注释备用)
# GRADLE_TASK_DEBUG="assembleBetaDebug"
# ==================== 函数定义 ====================
# 检查Git源码是否已完全提交无未提交变更
# 返回值0=已完全提交1=存在未提交变更
function checkGitSources() {
# 配置Git安全目录解决权限问题
git config --global --add safe.directory "$(pwd)"
# 检查是否有未提交的变更
if [[ -n $(git diff --stat) ]]; then
echo "[ERROR] Git源码存在未提交变更请先提交所有修改"
return 1
fi
echo "[INFO] Git源码检查通过所有变更已提交。"
return 0
}
# 询问是否添加GitHub Workflows标签当前逻辑注释保留扩展能力
# 返回值1=用户选择是0=用户选择否
function askAddWorkflowsTag() {
read -p "是否添加GitHub Workflows标签(Y/n) " answer
if [[ $answer =~ ^[Yy]$ ]]; then
return 1
else
return 0
fi
}
# 添加WinBoLL正式标签
# 参数:$1=应用名称(项目根目录名)
# 返回值0=标签添加成功1=标签已存在/添加失败
function addWinBoLLTag() {
local app_name=$1
local build_prop_path="${app_name}/build.properties"
# 从build.properties中提取publishVersion
local publish_version=$(grep -o "publishVersion=.*" "${build_prop_path}" | awk -F '=' '{print $2}')
if [[ -z ${publish_version} ]]; then
echo "[ERROR] 未从${build_prop_path}中提取到publishVersion配置"
return 1
fi
echo "[INFO] 从${build_prop_path}读取到publishVersion${publish_version}"
# 构造WinBoLL标签格式<APP_NAME>-v<publishVersion>
local tag="${app_name}-v${publish_version}"
echo "[INFO] 准备添加WinBoLL标签${tag}"
# 检查标签是否已存在
if [[ "$(git tag -l ${tag})" == "${tag}" ]]; then
echo "[ERROR] WinBoLL标签${tag}已存在!"
return 1
fi
# 添加带注释的标签注释来自app_update_description.txt
git tag -a "${tag}" -F "${app_name}/app_update_description.txt"
echo "[INFO] WinBoLL标签${tag}添加成功!"
return 0
}
# 添加GitHub Workflows Beta标签当前逻辑注释保留扩展能力
# 参数:$1=应用名称(项目根目录名)
# 返回值0=标签添加成功1=标签已存在/添加失败
function addWorkflowsTag() {
local app_name=$1
local build_prop_path="${app_name}/build.properties"
# 从build.properties中提取baseBetaVersion
local base_beta_version=$(grep -o "baseBetaVersion=.*" "${build_prop_path}" | awk -F '=' '{print $2}')
if [[ -z ${base_beta_version} ]]; then
echo "[ERROR] 未从${build_prop_path}中提取到baseBetaVersion配置"
return 1
fi
echo "[INFO] 从${build_prop_path}读取到baseBetaVersion${base_beta_version}"
# 构造Workflows标签格式<APP_NAME>-v<baseBetaVersion>-beta
local tag="${app_name}-v${base_beta_version}-beta"
echo "[INFO] 准备添加Workflows标签${tag}"
# 检查标签是否已存在
if [[ "$(git tag -l ${tag})" == "${tag}" ]]; then
echo "[ERROR] Workflows标签${tag}已存在!"
return 1
fi
# 添加带注释的标签注释来自app_update_description.txt
git tag -a "${tag}" -F "${app_name}/app_update_description.txt"
echo "[INFO] Workflows标签${tag}添加成功!"
return 0
}
# ==================== 主流程开始 ====================
echo "============================================="
echo " WinBoLL 应用发布脚本"
echo "============================================="
# 1. 检查应用名称参数是否指定
if [ -z "$1" ]; then
echo "No APP name specified : $0"
exit 2
echo "[ERROR] 未指定应用名称!使用方式:${0} <APP_NAME>"
exit ${EXIT_CODE_ERR_NO_APP_NAME}
fi
APP_NAME=$1
echo "[INFO] 待发布应用名称:${APP_NAME}"
## 定义相关函数
## 检查 Git 源码是否完全提交了完全提交就返回0
function checkGitSources {
#local input="$1"
#echo "The string is: $input"
git config --global --add safe.directory `pwd`
if [[ -n $(git diff --stat) ]]
then
local result="Source is no commit completely."
echo $result
# 脚本调试时使用
#return 0
# 正式检查源码时使用
return 1
fi
local result="Git Source Check OK."
echo $result
return 0
}
function askAddWorkflowsTag {
read answer
if [[ $answer =~ ^[Yy]$ ]]; then
#echo "You chose yes."
return 1
else
#echo "You chose no."
return 0
fi
}
function addWinBoLLTag {
# 就读取脚本 .winboll/winboll_app_build.gradle 生成的 publishVersion。
# 如果文件中有 publishVersion 这一项,
# 使用grep找到包含"publishVersion="的那一行然后用awk提取其后的值
PUBLISH_VERSION=$(grep -o "publishVersion=.*" $1/build.properties | awk -F '=' '{print $2}')
echo "< $1/build.properties publishVersion : ${PUBLISH_VERSION} >"
## 设新的 WinBoLL 标签
# 脚本调试时使用
#tag="projectname-v7.6.4-test1"
# 正式设置标签时使用
tag=$1"-v"${PUBLISH_VERSION}
echo "< WinBoLL Tag To: $tag >";
# 检查是否已经添加了 WinBoLL Tag
if [ "$(git tag -l ${tag})" == "${tag}" ]; then
echo -e "< WinBoLL Tag ${tag} exist! >"
return 1 # WinBoLL标签重复
fi
# 添加WinBoLL标签
git tag -a ${tag} -F $1/app_update_description.txt
return 0
}
function addWorkflowsTag {
# 就读取脚本 .winboll/winboll_app_build.gradle 生成的 baseBetaVersion。
# 如果文件中有 baseBetaVersion 这一项,
# 使用grep找到包含"baseBetaVersion="的那一行然后用awk提取其后的值
BASE_BETA_VERSION=$(grep -o "baseBetaVersion=.*" $1/build.properties | awk -F '=' '{print $2}')
echo "< $1/build.properties baseBetaVersion : ${BASE_BETA_VERSION} >"
## 设新的 workflows 标签
# 脚本调试时使用
#tag="projectname-v7.6.4-beta"
# 正式设置标签时使用
tag=$1"-v"${BASE_BETA_VERSION}-beta
echo "< Workflows Tag To: $tag >";
# 检查是否已经添加了工作流 Tag
if [ "$(git tag -l ${tag})" == "${tag}" ]; then
echo -e "< Github Workflows Tag ${tag} exist! >"
return 1 # 工作流标签重复
fi
# 添加工作流标签
git tag -a ${tag} -F $1/app_update_description.txt
return 0
}
## 开始执行脚本
echo -e "Current dir : \n"`pwd`
# 检查当前目录是否是项目根目录
if [[ -e $1/build.properties ]]; then
echo "The $1/build.properties file exists."
echo -e "Work dir correctly."
else
echo "The $1/build.properties file does not exist."
echo "尝试进入根目录"
# 进入项目根目录
# 2. 检查并切换到项目根目录确保build.properties存在
echo "[INFO] 当前工作目录:$(pwd)"
if [[ ! -e "${APP_NAME}/build.properties" ]]; then
echo "[WARNING] 当前目录不存在${APP_NAME}/build.properties尝试切换到上级目录..."
cd ..
echo "[INFO] 切换后工作目录:$(pwd)"
fi
## 本脚本需要在项目根目录下执行
echo -e "Current dir : \n"`pwd`
# 检查当前目录是否是项目根目录
if [[ -e $1/build.properties ]]; then
echo "The $1/build.properties file exists."
echo -e "Work dir correctly."
# 验证最终工作目录是否正确
if [[ ! -e "${APP_NAME}/build.properties" ]]; then
echo "[ERROR] 工作目录错误!${APP_NAME}/build.properties 文件不存在。"
exit ${EXIT_CODE_ERR_WORK_DIR}
fi
echo "[INFO] 工作目录验证通过:${APP_NAME}/build.properties 存在。"
# 3. 检查Git源码状态
echo "---------------------------------------------"
echo " 步骤1检查Git源码状态"
echo "---------------------------------------------"
checkGitSources
if [[ $? -ne ${EXIT_CODE_SUCCESS} ]]; then
echo "[ERROR] Git源码检查失败脚本终止"
exit ${EXIT_CODE_ERR_GIT_CHECK}
fi
# 4. 编译Stage Release版本APK
echo "---------------------------------------------"
echo " 步骤2编译Stage Release APK"
echo "---------------------------------------------"
echo "[INFO] 开始执行Gradle任务${GRADLE_TASK_PUBLISH}"
# 调试用(注释正式任务,启用调试任务)
# bash gradlew :${APP_NAME}:${GRADLE_TASK_DEBUG}
bash gradlew :${APP_NAME}:${GRADLE_TASK_PUBLISH}
if [[ $? -ne ${EXIT_CODE_SUCCESS} ]]; then
echo "[ERROR] Gradle编译任务失败"
exit 1
fi
echo "[INFO] Stage Release APK编译成功"
# 5. 添加WinBoLL正式标签
echo "---------------------------------------------"
echo " 步骤3添加WinBoLL标签"
echo "---------------------------------------------"
addWinBoLLTag ${APP_NAME}
if [[ $? -ne ${EXIT_CODE_SUCCESS} ]]; then
echo "[ERROR] WinBoLL标签添加失败脚本终止"
exit ${EXIT_CODE_ERR_ADD_WINBOLL_TAG}
fi
# 6. 可选添加GitHub Workflows标签当前逻辑注释保留扩展能力
# echo "---------------------------------------------"
# echo " 步骤4添加Workflows标签可选"
# echo "---------------------------------------------"
# echo "是否添加GitHub Workflows Beta标签(Y/n) "
# askAddWorkflowsTag
# nAskAddWorkflowsTag=$?
# if [[ ${nAskAddWorkflowsTag} -eq 1 ]]; then
# addWorkflowsTag ${APP_NAME}
# if [[ $? -ne ${EXIT_CODE_SUCCESS} ]]; then
# echo "[ERROR] Workflows标签添加失败脚本终止"
# exit 1
# fi
# fi
# 7. 清理更新描述文件
echo "---------------------------------------------"
echo " 步骤5清理更新描述文件"
echo "---------------------------------------------"
echo "" > "${APP_NAME}/app_update_description.txt"
echo "[INFO] 已清空${APP_NAME}/app_update_description.txt"
# 8. 提交并推送源码与标签
echo "---------------------------------------------"
echo " 步骤6提交并推送源码"
echo "---------------------------------------------"
git add .
git commit -m "<${APP_NAME}> 开始新的Stage版本开发。"
echo "[INFO] 源码提交成功,开始推送..."
# 推送源码到远程仓库
git push origin
# 推送标签到远程仓库
git push origin --tags
if [[ $? -eq ${EXIT_CODE_SUCCESS} ]]; then
echo "[INFO] 源码与标签推送成功!"
else
echo "The $1/build.properties file does not exist."
echo -e "Work dir error."
echo "[ERROR] 源码与标签推送失败!"
exit 1
fi
# 检查源码状态
result=$(checkGitSources)
if [[ $? -eq 0 ]]; then
echo $result
# 如果Git已经提交了所有代码就执行标签和应用发布操作
# ==================== 主流程结束 ====================
echo "============================================="
echo " WinBoLL 应用发布完成!"
echo "============================================="
exit ${EXIT_CODE_SUCCESS}
# 预先询问是否添加工作流标签
#echo "Add Github Workflows Tag? (yes/No)"
#result=$(askAddWorkflowsTag)
#nAskAddWorkflowsTag=$?
#echo $result
# 发布应用
echo "Publishing WinBoLL APK ..."
# 脚本调试时使用
#bash gradlew :$1:assembleBetaDebug
# 正式发布
bash gradlew :$1:assembleStageRelease
echo "Publishing WinBoLL APK OK."
# 添加 WinBoLL 标签
result=$(addWinBoLLTag $1)
echo $result
if [[ $? -eq 0 ]]; then
echo $result
# WinBoLL 标签添加成功
else
echo -e "${0}: addWinBoLLTag $1\n${result}\nAdd WinBoLL tag cancel."
exit 1 # addWinBoLLTag 异常
fi
# 添加 GitHub 工作流标签
#if [[ $nAskAddWorkflowsTag -eq 1 ]]; then
# 如果用户选择添加工作流标签
#result=$(addWorkflowsTag $1)
#if [[ $? -eq 0 ]]; then
# echo $result
# 工作流标签添加成功
#else
#echo -e "${0}: addWorkflowsTag $1\n${result}\nAdd workflows tag cancel."
#exit 1 # addWorkflowsTag 异常
#fi
#fi
## 清理更新描述文件内容
echo "" > $1/app_update_description.txt
# 设置新版本开发参数配置
# 提交配置
git add .
git commit -m "<$1>Start New Stage Version."
echo "Push sources to git repositories ..."
# 推送源码到所有仓库
git push origin && git push origin --tags
else
echo -e "${0}: checkGitSources\n${result}\nShell cancel."
exit 1 # checkGitSources 异常
fi

View File

@@ -64,6 +64,11 @@ android {
dimension "WinBoLLApp"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
// 应用包输出配置
//

View File

@@ -5,10 +5,11 @@
## ☁ ☁ ☁ WinBoLL APP ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ WinBoLL Studio Android 应用开源项目。☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ WinBoLL 网站地址 https://www.winboll.cc/ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ WinBoLL 源码地址 <https://gitea.winboll.cc/Studio/APPBase> ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ GitHub 源码地址 <https://github.com/ZhanGSKen/APPBase.git> ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ 码云 源码地址 <https://gitee.com/zhangsken/appbase.git> ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ WinBoLL 源码地址 <https://gitea.winboll.cc/Studio/WinBoLL.git> ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ GitHub 源码地址 <https://github.com/ZhanGSKen/WinBoLL.git> ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ 码云 源码地址 <https://gitee.com/zhangsken/winboll.git> ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ 在 jitpack.io 托管的 APPBase 类库源码<https://github.com/ZhanGSKen/APPBase.git> ☁ ☁ ☁ ☁
# ☁ ☁ ☁ 在 jitpack.io 托管的 AES 类库源码<https://github.com/ZhanGSKen/AES.git> ☁ ☁ ☁ ☁
## WinBoLL 提问
同样是 /sdcard 目录,在开发 Android 应用时,
能否实现手机编译与电脑编译的源码同步。
@@ -154,3 +155,11 @@ $ bash gradlew assembleBetaDebug
$ bash gradlew assembleStageDebug
### 若是 winboll.properties 文件的 [ExtraAPKOutputPath] 属性设置了路径。编译器也会复制一份 APK 到这个路径。
# 应用版本号命名方式
## statge 渠道
V<应用开发环境编号><应用功能变更号><应用调试阶段号>
APPBase_15.7.0
## beta 渠道
V<应用开发环境编号><应用功能变更号><应用调试阶段号>-beta<调试编译计数>_<调试编译时间(分钟+秒钟)>
APPBase_15.9.6-beta8_5413

View File

@@ -100,12 +100,15 @@ allprojects {
}
subprojects {
// 1. 对纯 Java 模块的 JavaCompile 任务配置(升级为 Java 11
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
// 可选:确保编码一致
options.encoding = "UTF-8"
}
}
}
}
task clean(type: Delete) {

View File

@@ -18,39 +18,45 @@ def genVersionName(def versionName){
}
android {
// 关键:改为你已安装的 SDK 32≥ targetSdkVersion 30兼容已安装环境
compileSdkVersion 32
buildToolsVersion "32.0.0"
// 直接使用已安装的构建工具 33.0.3(无需修改)
buildToolsVersion "33.0.3"
defaultConfig {
applicationId "cc.winboll.studio.mymessagemanager"
minSdkVersion 24
minSdkVersion 23
targetSdkVersion 30
versionCode 8
// versionName 更新后需要手动设置
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.3"
versionName "15.12"
if(true) {
versionName = genVersionName("${versionName}")
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
// 米盟 SDK
packagingOptions {
doNotStrip "*/*/libmimo_1011.so"
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api 'cc.winboll.studio:libaes:15.9.3'
api 'cc.winboll.studio:libapputils:15.8.6'
api 'cc.winboll.studio:libappbase:15.9.5'
// 米盟
api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
//注意以下5个库必须要引入
//api 'androidx.appcompat:appcompat:1.4.1'
api 'androidx.recyclerview:recyclerview:1.0.0'
api 'com.google.code.gson:gson:2.8.5'
api 'com.github.bumptech.glide:glide:4.9.0'
//annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
api 'io.github.medyo:android-about-page:2.0.0'
api 'com.github.getActivity:ToastUtils:10.5'
api 'com.jcraft:jsch:0.1.55'
api 'org.jsoup:jsoup:1.13.1'
api 'com.squareup.okhttp3:okhttp:4.4.1'
@@ -69,4 +75,14 @@ dependencies {
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
//api 'androidx.fragment:fragment:1.1.0'
api 'com.google.android.material:material:1.0.0'
// WinBoLL库 nexus.winboll.cc 地址
api 'cc.winboll.studio:libaes:15.12.12'
api 'cc.winboll.studio:libappbase:15.14.2'
// WinBoLL备用库 jitpack.io 地址
//api 'com.github.ZhanGSKen:AES:aes-v15.12.9'
//api 'com.github.ZhanGSKen:APPBase:appbase-v15.14.1'
api fileTree(dir: 'libs', include: ['*.jar'])
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Sep 28 12:37:31 HKT 2025
stageCount=10
#Tue Jan 06 20:51:18 HKT 2026
stageCount=7
libraryProject=
baseVersion=15.3
publishVersion=15.3.9
baseVersion=15.12
publishVersion=15.12.6
buildCount=0
baseBetaVersion=15.3.10
baseBetaVersion=15.12.7

View File

@@ -9,9 +9,135 @@
# Add any project specific keep options here:
# 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 *;
#}
# ============================== 基础通用规则 ==============================
# 保留系统组件
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
# 保留 WinBoLL 核心包及子类(合并简化规则)
-keep class cc.winboll.studio.** { *; }
-keepclassmembers class cc.winboll.studio.** { *; }
# 保留所有类中的 public static final String TAG 字段(便于日志定位)
-keepclassmembers class * {
public static final java.lang.String TAG;
}
# 保留序列化类避免Parcelable/Gson解析异常
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# 保留 R 文件避免资源ID混淆
-keepclassmembers class **.R$* {
public static <fields>;
}
# 保留 native 方法避免JNI调用失败
-keepclasseswithmembernames class * {
native <methods>;
}
# 保留注解和泛型(避免反射/序列化异常)
-keepattributes *Annotation*
-keepattributes Signature
# 屏蔽 Java 8+ 警告(适配 Java 7 语法)
-dontwarn java.lang.invoke.*
-dontwarn android.support.v8.renderscript.*
-dontwarn java.util.function.**
# ============================== 第三方框架专项规则 ==============================
# OkHttp 4.4.1米盟广告请求依赖完善Lambda兼容
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-keep class okhttp3.internal.** { *; }
-keep class okio.** { *; }
-dontwarn okhttp3.internal.platform.**
-dontwarn okio.**
# ============================== 必要补充规则 ==============================
# OkHttp 4.4.1 补充规则Java 7 兼容)
-keep class okhttp3.internal.concurrent.** { *; }
-keep class okhttp3.internal.connection.** { *; }
-dontwarn okhttp3.internal.concurrent.TaskRunner
-dontwarn okhttp3.internal.connection.RealCall
# Glide 4.9.0(米盟广告图片加载依赖)
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$ImageType {
**[] $VALUES;
public *;
}
-keepclassmembers class * implements com.bumptech.glide.module.AppGlideModule {
<init>();
}
-dontwarn com.bumptech.glide.**
# Gson 2.8.5(米盟广告数据序列化依赖)
-keep class com.google.gson.** { *; }
-keep interface com.google.gson.** { *; }
-keepclassmembers class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# 米盟 SDK(核心广告组件,完整保留避免加载失败)
-keep class com.miui.zeus.** { *; }
-keep interface com.miui.zeus.** { *; }
# 保留米盟日志字段(便于广告加载失败排查)
-keepclassmembers class com.miui.zeus.mimo.sdk.** {
public static final java.lang.String TAG;
}
# RecyclerView 1.0.0(米盟广告布局渲染依赖)
-keep class androidx.recyclerview.** { *; }
-keep interface androidx.recyclerview.** { *; }
-keepclassmembers class androidx.recyclerview.widget.RecyclerView$Adapter {
public *;
}
# 其他第三方框架(按引入依赖保留,无则可删除)
# XXPermissions 18.63
-keep class com.hjq.permissions.** { *; }
-keep interface com.hjq.permissions.** { *; }
# ZXing 二维码(核心解析组件)
-keep class com.google.zxing.** { *; }
-keep class com.journeyapps.zxing.** { *; }
# Jsoup HTML解析
-keep class org.jsoup.** { *; }
# Pinyin4j 拼音搜索
-keep class net.sourceforge.pinyin4j.** { *; }
# JSch SSH组件
-keep class com.jcraft.jsch.** { *; }
# AndroidX 基础组件
-keep class androidx.appcompat.** { *; }
-keep interface androidx.appcompat.** { *; }
# ============================== 优化与调试配置 ==============================
# 优化级别(平衡混淆效果与性能)
-optimizationpasses 5
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
# 调试辅助(保留行号便于崩溃定位)
-verbose
-dontpreverify
-dontusemixedcaseclassnames
-keepattributes SourceFile,LineNumberTable

View File

@@ -7,9 +7,10 @@ package cc.winboll.studio.mymessagemanager;
*/
import android.view.Gravity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import com.hjq.toast.ToastUtils;
import java.io.File;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
public class App extends GlobalApplication {
@@ -29,18 +30,23 @@ public class App extends GlobalApplication {
@Override
public void onCreate() {
super.onCreate();
setIsDebugging(BuildConfig.DEBUG);
//setIsDebugging(false);
// 初始化窗口管理类
WinBoLLActivityManager.init(this);
// 初始化 Toast 框架
ToastUtils.init(this);
// 设置 Toast 布局样式
ToastUtils.setView(R.layout.toast_custom_view);
//ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
//LogUtils.d(TAG, "BuildConfig.DEBUG " + Boolean.toString(BuildConfig.DEBUG));
_mszAppExternalFilesDir = getExternalFilesDir(TAG).toString();
_mszConfigUtilPath = _mszAppExternalFilesDir + File.separator + _mszConfigUtilFileName;
_mszSMSReceiveRuleUtilPath = _mszAppExternalFilesDir + File.separator + _mszSMSReceiveRuleUtilFileName;
}
@Override
public void onTerminate() {
super.onTerminate();
ToastUtils.release();
}
}

View File

@@ -11,9 +11,10 @@ import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.libaes.winboll.APPInfo;
import cc.winboll.studio.libaes.winboll.AboutView;
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.models.APPInfo;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libaes.views.AboutView;
import cc.winboll.studio.mymessagemanager.App;
import cc.winboll.studio.mymessagemanager.R;
@@ -64,13 +65,13 @@ public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
);
layout.addView(aboutView, params);
App.getWinBoLLActivityManager().add(this);
WinBoLLActivityManager.getInstance().add(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
App.getWinBoLLActivityManager().registeRemove(this);
WinBoLLActivityManager.getInstance().registeRemove(this);
}
public AboutView CreateAboutView() {

View File

@@ -5,25 +5,31 @@ package cc.winboll.studio.mymessagemanager.activitys;
* @Date 2024/05/12 20:03:42
* @Describe 应用设置窗口
*/
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.Toast;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
import cc.winboll.studio.libaes.views.AToolbar;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.dialogs.CharsetRefuseEditDialog;
import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil;
import cc.winboll.studio.mymessagemanager.utils.PermissionUtil;
import cc.winboll.studio.mymessagemanager.utils.NotificationHelper;
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
public class AppSettingsActivity extends BaseActivity {
public class AppSettingsActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "AppSettingsActivity";
// 讯飞语记官网下载页链接
private static final String XUNFEI_YUJI_DOWNLOAD_URL = "https://iflynote.com/h/share-download-app.html";
AppConfigUtil mAppConfigUtil;
AToolbar mAToolbar;
AOHPCTCSeekBar mAOHPCTCSeekBar;
@@ -31,8 +37,19 @@ public class AppSettingsActivity extends BaseActivity {
EditText metPhoneMergePrefix;
Switch mswMergePrefixPhone;
Switch mswSMSRecycleProtectMode;
EditText metProtectModerRefuseChars;
//EditText metProtectModerRefuseChars;
EditText metProtectModerReplaceChars;
String mszProtectModerRefuseChars = "";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -58,13 +75,14 @@ public class AppSettingsActivity extends BaseActivity {
mswSMSRecycleProtectMode = findViewById(R.id.activityappsettingsSwitch3);
mswSMSRecycleProtectMode.setChecked(mAppConfigUtil.mAppConfigBean.isSMSRecycleProtectMode());
metProtectModerRefuseChars = findViewById(R.id.activityappsettingsEditText3);
metProtectModerRefuseChars.setText(mAppConfigUtil.mAppConfigBean.getProtectModerRefuseChars());
//metProtectModerRefuseChars = findViewById(R.id.activityappsettingsEditText3);
//metProtectModerRefuseChars.setText(mAppConfigUtil.mAppConfigBean.getProtectModerRefuseChars());
mszProtectModerRefuseChars = mAppConfigUtil.mAppConfigBean.getProtectModerRefuseChars();
metProtectModerReplaceChars = findViewById(R.id.activityappsettingsEditText4);
metProtectModerReplaceChars.setText(mAppConfigUtil.mAppConfigBean.getProtectModerReplaceChars());
mAOHPCTCSeekBar = findViewById(R.id.activityappsettingsAOHPCTCSeekBar1);
mAOHPCTCSeekBar.setThumb(getDrawable(R.drawable.cursor_pointer));
mAOHPCTCSeekBar.setThumbOffset(0);
@@ -74,7 +92,8 @@ public class AppSettingsActivity extends BaseActivity {
public void onOHPCommit() {
mAppConfigUtil.reLoadConfig();
mAppConfigUtil.mAppConfigBean.setIsSMSRecycleProtectMode(mswSMSRecycleProtectMode.isChecked());
mAppConfigUtil.mAppConfigBean.setProtectModerRefuseChars(metProtectModerRefuseChars.getText().toString());
//mAppConfigUtil.mAppConfigBean.setProtectModerRefuseChars(metProtectModerRefuseChars.getText().toString());
mAppConfigUtil.mAppConfigBean.setProtectModerRefuseChars(mszProtectModerRefuseChars);
mAppConfigUtil.mAppConfigBean.setProtectModerReplaceChars(metProtectModerReplaceChars.getText().toString());
mAppConfigUtil.mAppConfigBean.setCountryCode(metPhoneMergePrefix.getText().toString());
mAppConfigUtil.mAppConfigBean.setIsMergeCountryCodePrefix(mswMergePrefixPhone.isChecked());
@@ -98,18 +117,34 @@ public class AppSettingsActivity extends BaseActivity {
Toast.makeText(getApplication(), "应用已获得所需权限。", Toast.LENGTH_SHORT).show();
}
}
public void onCleanOldChannels(View view) {
YesNoAlertDialog.show(this, "通知设置清理", "是否清理旧的通知设置?", new YesNoAlertDialog.OnDialogResultListener(){
@Override
public void onNo() {
}
@Override
public void onYes() {
NotificationHelper notificationHelper = new NotificationHelper(AppSettingsActivity.this);
notificationHelper.cleanOldChannels();
}
});
public void onAddTTSSupport(View view) {
try {
// 1. 创建IntentAction为“打开网页”
Intent intent = new Intent(Intent.ACTION_VIEW);
// 2. 设置要跳转的URL
intent.setData(Uri.parse(XUNFEI_YUJI_DOWNLOAD_URL));
// 3. 确保Intent可被解析避免无浏览器时崩溃
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent); // 跳转至浏览器打开下载页
} else {
// 无浏览器时的提示
Toast.makeText(this, "未找到浏览器应用,请安装后重试", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this, "无法打开下载页面,请稍后再试", Toast.LENGTH_SHORT).show();
}
}
public void onCharsetRefuseEditDialog(View view) {
CharsetRefuseEditDialog dlg = new CharsetRefuseEditDialog(this, new CharsetRefuseEditDialog.OnTextConfirmListener(){
@Override
public void onTextConfirmed(String editText) {
//ToastUtils.show(editText);
mszProtectModerRefuseChars = editText;
}
}, mszProtectModerRefuseChars);
dlg.show();
}
}

View File

@@ -1,114 +0,0 @@
package cc.winboll.studio.mymessagemanager.activitys;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.mymessagemanager.R;
abstract public class BaseActivity extends AppCompatActivity {
public static final String TAG = "BaseActivity";
IOnActivityMessageReceived mIOnActivityMessageReceived;
@Override
protected void onCreate(Bundle savedInstanceState) {
//AppConfigUtil configUtil = AppConfigUtil.getInstance(this);
//setTheme(configUtil.mAppConfigBean.getAppThemeID());
LogUtils.d(TAG, "AESThemeUtil.getThemeTypeID(this) is : " + Integer.toString(AESThemeUtil.getThemeTypeID(this)));
setTheme(AESThemeUtil.getThemeTypeID(this));
super.onCreate(savedInstanceState);
}
public void sendActivityMessage(Message msg) {
mHandler.sendMessage(msg);
}
protected void setOnActivityMessageReceived(IOnActivityMessageReceived iOnActivityMessageReceived) {
mIOnActivityMessageReceived = iOnActivityMessageReceived;
}
Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (mIOnActivityMessageReceived != null) {
mIOnActivityMessageReceived.onActivityMessageReceived(msg);
}
}
};
protected interface IOnActivityMessageReceived {
void onActivityMessageReceived(Message msg);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
AESThemeUtil.inflateMenu(this, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
/*if (AESThemeUtil.onAppCompatThemeItemSelected(this, item)) {
ToastUtils.show("onAppCompatThemeItemSelected");
recreate();
}*/
/*int nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
if (R.id.item_depththeme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
AESThemeUtil.saveThemeStyleID(this, nThemeStyleID);
recreate();
} else if (R.id.item_skytheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
AESThemeUtil.saveThemeStyleID(this, nThemeStyleID);
recreate();
} else if (R.id.item_goldentheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
AESThemeUtil.saveThemeStyleID(this, nThemeStyleID);
recreate();
} else if (R.id.item_taotheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
AESThemeUtil.saveThemeStyleID(this, nThemeStyleID);
recreate();
} else if (R.id.item_defaulttheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
AESThemeUtil.saveThemeStyleID(this, nThemeStyleID);
recreate();
}*/
//int nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
if (R.id.item_depththeme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyDepthAESTheme);
recreate();
} else if (R.id.item_skytheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MySkyAESTheme);
recreate();
} else if (R.id.item_goldentheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyGoldenAESTheme);
recreate();
} else if (R.id.item_memortheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyMemorAESTheme);
recreate();
} else if (R.id.item_taotheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyTaoAESTheme);
recreate();
} else if (R.id.item_defaulttheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyAppTheme);
recreate();
} else if (R.id.item_defaulttheme == item.getItemId()) {
AESThemeUtil.saveThemeStyleID(this, R.style.MyAppTheme);
recreate();
}
//ToastUtils.show("nThemeStyleID " + Integer.toString(nThemeStyleID));
return super.onOptionsItemSelected(item);
}
}

View File

@@ -5,6 +5,8 @@ package cc.winboll.studio.mymessagemanager.activitys;
* @Date 2025/08/30 14:32
* @Describe 联系人查询与短信发送窗口
*/
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
@@ -16,23 +18,21 @@ import android.widget.RelativeLayout;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toolbar;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
import cc.winboll.studio.mymessagemanager.utils.PhoneUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
import com.hjq.toast.ToastUtils;
import cc.winboll.studio.libappbase.LogUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.app.Activity;
public class ComposeSMSActivity extends BaseActivity {
public class ComposeSMSActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static String TAG = "ComposeSMSActivity";
public static String EXTRA_SMSBODY = "sms_body";
@@ -54,6 +54,16 @@ public class ComposeSMSActivity extends BaseActivity {
private AOHPCTCSeekBar mAOHPCTCSeekBar;
private RelativeLayout mrlContracts;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -11,8 +11,11 @@ import android.view.View;
import android.widget.Button;
import android.widget.ScrollView;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libaes.utils.DevelopUtils;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libaes.views.ADsBannerView;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.LogView;
import cc.winboll.studio.mymessagemanager.App;
import cc.winboll.studio.mymessagemanager.BuildConfig;
import cc.winboll.studio.mymessagemanager.R;
@@ -30,7 +33,7 @@ import cc.winboll.studio.mymessagemanager.views.PhoneListViewForScrollView;
import com.baoyz.widget.PullRefreshLayout;
import java.util.ArrayList;
public class MainActivity extends BaseActivity {
public class MainActivity extends WinBoLLActivity {
public final static String TAG = "MainActivity";
@@ -42,6 +45,8 @@ public class MainActivity extends BaseActivity {
public static final int MY_PERMISSIONS_REQUEST = 0;
static MainActivity _mMainActivity;
ADsBannerView mADsBannerView;
//LogView mLogView;
AppConfigUtil mAppConfigUtil;
ConfirmSwitchView msvEnableService;
@@ -64,6 +69,9 @@ public class MainActivity extends BaseActivity {
setContentView(R.layout.activity_main);
_mMainActivity = MainActivity.this;
// 米盟广告栏
mADsBannerView = findViewById(R.id.adsbanner);
mAppConfigUtil = AppConfigUtil.getInstance(this);
initView();
@@ -256,21 +264,31 @@ public class MainActivity extends BaseActivity {
@Override
protected void onDestroy() {
super.onDestroy();
if (mADsBannerView != null) {
mADsBannerView.releaseAdResources();
}
}
@Override
protected void onResume() {
super.onResume();
reloadSMS();
//mLogView.start();
if (mADsBannerView != null) {
mADsBannerView.resumeADs(MainActivity.this);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//return super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.toolbar_main, menu);
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.toolbar_main2, menu);
getMenuInflater().inflate(R.menu.toolbar_main_first, menu);
// 主题菜单
AESThemeUtil.inflateMenu(this, menu);
// 调试工具菜单
if (App.isDebugging()) {
DevelopUtils.inflateMenu(this, menu);
getMenuInflater().inflate(R.menu.toolbar_main_debug, menu);
}
getMenuInflater().inflate(R.menu.toolbar_main_last, menu);
return true;
}
@@ -285,7 +303,12 @@ public class MainActivity extends BaseActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int nItemId = item.getItemId();
if (nItemId == R.id.app_ttsrule) {
int menuItemId = item.getItemId();
if (AESThemeUtil.onAppThemeItemSelected(this, item)) {
recreate();
} if (DevelopUtils.onDevelopItemSelected(this, item)) {
LogUtils.d(TAG, String.format("onOptionsItemSelected item.getItemId() %d ", item.getItemId()));
} else if (nItemId == R.id.app_ttsrule) {
Intent i = new Intent(MainActivity.this, TTSPlayRuleActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
@@ -297,16 +320,10 @@ public class MainActivity extends BaseActivity {
Intent i = new Intent(MainActivity.this, AppSettingsActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
} else if (nItemId == R.id.app_log) {
App.getWinBoLLActivityManager().startLogActivity(this);
} else if (nItemId == R.id.app_unittest) {
} else if (nItemId == R.id.app_unittest) {
Intent i = new Intent(MainActivity.this, UnitTestActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
} else if (nItemId == R.id.app_crashtest) {
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
getString(i);
}
} else if (nItemId == R.id.app_about) {
Intent i = new Intent(MainActivity.this, AboutActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View File

@@ -7,10 +7,8 @@ import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.EditText;
import android.widget.LinearLayout;
@@ -19,6 +17,7 @@ import android.widget.TextView;
import android.widget.Toast;
import android.widget.Toolbar;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.adapters.SMSArrayAdapter;
@@ -27,9 +26,9 @@ import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
import cc.winboll.studio.mymessagemanager.utils.ViewUtil;
import cc.winboll.studio.mymessagemanager.views.BottomPositionFixedScrollView;
import cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView;
import java.lang.ref.WeakReference;
import android.app.Activity;
public class SMSActivity extends BaseActivity {
public class SMSActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static String TAG = "SMSActivity";
public static final String ACTION_NOTIFY_SMS_CHANGED = "cc.winboll.studio.mymessagemanager.activitys.SMSActivity.ACTION_NOTIFY_SMS_CHANGED";
public static final String EXTRA_PHONE = "Phone";
@@ -45,6 +44,16 @@ public class SMSActivity extends BaseActivity {
Handler mSetFocusHandler;
private boolean isImeVisible = false;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -21,6 +21,7 @@ import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.mymessagemanager.App;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.SMSReceiveRuleActivity;
@@ -29,8 +30,9 @@ import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.utils.FileUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil;
import com.baoyz.widget.PullRefreshLayout;
import android.app.Activity;
public class SMSReceiveRuleActivity extends BaseActivity {
public class SMSReceiveRuleActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "SMSReceiveRuleActivity";
@@ -43,6 +45,16 @@ public class SMSReceiveRuleActivity extends BaseActivity {
SMSAcceptRuleBean mSMSAcceptRuleBeanAdd;
SMSAcceptRuleArrayAdapter mSMSAcceptRuleArrayAdapter;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -5,13 +5,15 @@ package cc.winboll.studio.mymessagemanager.activitys;
* @Date 2024/07/19 16:56:18
* @Describe 短信回收站
*/
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity;
import cc.winboll.studio.mymessagemanager.adapters.SMSRecycleAdapter;
@@ -19,7 +21,7 @@ import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
import com.baoyz.widget.PullRefreshLayout;
import java.io.File;
public class SMSRecycleActivity extends BaseActivity {
public class SMSRecycleActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "SMSRecycleActivity";
@@ -27,6 +29,16 @@ public class SMSRecycleActivity extends BaseActivity {
RecyclerView mRecyclerView;
SMSRecycleAdapter mSMSRecycleAdapter;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -74,7 +86,7 @@ public class SMSRecycleActivity extends BaseActivity {
}
return true;
}
YesNoAlertDialog.OnDialogResultListener mDeleteListener = new YesNoAlertDialog.OnDialogResultListener() {
@Override

View File

@@ -7,19 +7,34 @@ import android.text.TextUtils;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.SMSReceiveRuleActivity;
import cc.winboll.studio.mymessagemanager.activitys.SharedJSONReceiveActivity;
import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean;
import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog;
import cc.winboll.studio.mymessagemanager.utils.UriUtil;
import java.util.ArrayList;
import android.app.Activity;
public class SharedJSONReceiveActivity extends BaseActivity {
public class SharedJSONReceiveActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "SharedJSONReceive";
Toolbar mToolbar;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -16,13 +16,15 @@ import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.adapters.TTSRuleBeanRecyclerViewAdapter;
import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean;
import cc.winboll.studio.mymessagemanager.utils.FileUtil;
import cc.winboll.studio.mymessagemanager.utils.TTSPlayRuleUtil;
import android.app.Activity;
public class TTSPlayRuleActivity extends BaseActivity {
public class TTSPlayRuleActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "TTSPlayRuleActivity";
@@ -39,6 +41,16 @@ public class TTSPlayRuleActivity extends BaseActivity {
EditText metPatternText;
EditText metCurrentTTSRuleText;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -7,17 +7,18 @@ package cc.winboll.studio.mymessagemanager.activitys;
*/
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libaes.beans.AESThemeBean;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.mymessagemanager.enums.ThemeStyleEnum;
public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity {
public static final String TAG = "WinBoLLActivity";
protected volatile AESThemeBean.ThemeType mThemeType;
IOnActivityMessageReceived mIOnActivityMessageReceived;
@Override
public Activity getActivity() {
@@ -31,30 +32,51 @@ public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivi
@Override
protected void onCreate(Bundle savedInstanceState) {
mThemeType = getThemeType();
setThemeStyle();
// 1. 优先读取SP中保存的主题必须在setContentView前调用
ThemeStyleEnum savedTheme = ThemeStyleEnum.getThemeFromSP(this);
// 2. 设置主题
setTheme(savedTheme.getStyleId());
super.onCreate(savedInstanceState);
}
AESThemeBean.ThemeType getThemeType() {
/*SharedPreferences sharedPreferences = getSharedPreferences(
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
*/
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int selectedMenuId = item.getItemId();
// 1. 根据菜单ID获取对应的主题枚举
ThemeStyleEnum selectedTheme = ThemeStyleEnum.getThemeByMenuId(selectedMenuId);
if (selectedTheme != null) {
// 2. 调用枚举自带方法保存主题到SP替代AESThemeUtil
ThemeStyleEnum.saveThemeToSP(this, selectedTheme);
recreate(); // 重建Activity生效主题
} else if (selectedMenuId == android.R.id.home) {
finish();
} else {
return super.onOptionsItemSelected(item);
}
return true;
}
protected interface IOnActivityMessageReceived {
void onActivityMessageReceived(Message msg);
}
void setThemeStyle() {
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
public void sendActivityMessage(Message msg) {
mHandler.sendMessage(msg);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == android.R.id.home) {
finish();
return true;
protected void setOnActivityMessageReceived(IOnActivityMessageReceived iOnActivityMessageReceived) {
mIOnActivityMessageReceived = iOnActivityMessageReceived;
}
Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (mIOnActivityMessageReceived != null) {
mIOnActivityMessageReceived.onActivityMessageReceived(msg);
}
}
return super.onOptionsItemSelected(item);
}
};
}

View File

@@ -15,10 +15,10 @@ import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
public class SMSAcceptRuleArrayAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@@ -14,20 +14,20 @@ import android.widget.LinearLayout;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.beans.SMSBean;
import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog;
import cc.winboll.studio.mymessagemanager.utils.NotificationHelper;
import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
import cc.winboll.studio.mymessagemanager.utils.TTSPlayRuleUtil;
import cc.winboll.studio.mymessagemanager.views.DateAgoTextView;
import cc.winboll.studio.mymessagemanager.views.SMSView;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.utils.NotificationHelper;
public class SMSArrayAdapter extends BaseAdapter {

View File

@@ -20,11 +20,13 @@ import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.RecyclerView;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity;
import cc.winboll.studio.mymessagemanager.beans.SMSBean;
import cc.winboll.studio.mymessagemanager.beans.SMSRecycleBean;
import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog;
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
@@ -32,9 +34,7 @@ import cc.winboll.studio.mymessagemanager.utils.TTSPlayRuleUtil;
import cc.winboll.studio.mymessagemanager.utils.UserVisionSystemProtectModeUtil;
import cc.winboll.studio.mymessagemanager.views.DateAgoTextView;
import cc.winboll.studio.mymessagemanager.views.SMSView;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@@ -0,0 +1,148 @@
package cc.winboll.studio.mymessagemanager.dialogs;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/12/13 17:04
* @Describe 字符集编辑拒绝对话框
* 包含标题、300dp×300dp多行编辑框、确定/取消按钮(确定在右,取消在左)
* 支持预制文本初始化、编辑内容回传
*/
public class CharsetRefuseEditDialog extends Dialog {
public static final String TAG = "CharsetRefuseEditDialog";
// 文本回传接口
public interface OnTextConfirmListener {
void onTextConfirmed(String editText); // 确定按钮点击时回传编辑后的文本
}
private final OnTextConfirmListener mListener; // 外部传入的回传接口
private final String mPreText; // 预制文本框的内容
private EditText mEditText; // 多行文本编辑框
/**
* 构造函数
* @param context 上下文
* @param listener 文本回传接口(外部实现)
* @param preText 预制的编辑框初始文本
*/
public CharsetRefuseEditDialog(Context context, OnTextConfirmListener listener, String preText) {
super(context);
this.mListener = listener;
this.mPreText = preText;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 禁用对话框默认标题,使用自定义标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 初始化对话框布局
initView();
}
/**
* 初始化对话框布局(标题+编辑框+按钮)
*/
private void initView() {
// 根布局:垂直线性布局
LinearLayout rootLayout = new LinearLayout(getContext());
rootLayout.setOrientation(LinearLayout.VERTICAL);
rootLayout.setPadding(20, 20, 20, 20);
rootLayout.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
));
// 1. 添加标题栏
TextView titleTv = new TextView(getContext());
titleTv.setText("拒绝显示字符集编辑");
titleTv.setTextSize(18);
titleTv.setTextColor(Color.BLACK);
titleTv.setGravity(Gravity.CENTER);
titleTv.setPadding(0, 0, 0, 20); // 标题与编辑框间距
rootLayout.addView(titleTv);
// 2. 添加多行编辑框300dp×300dp
mEditText = new EditText(getContext());
// 转换dp为px适配不同屏幕密度
int dp300 = dp2px(getContext(), 300);
LinearLayout.LayoutParams editParams = new LinearLayout.LayoutParams(dp300, dp300);
mEditText.setLayoutParams(editParams);
mEditText.setLines(5); // 多行显示
mEditText.setHint("请输入内容");
mEditText.setText(mPreText); // 设置预制文本
mEditText.setSelection(mPreText.length()); // 光标定位到文本末尾
rootLayout.addView(mEditText);
// 3. 添加按钮栏(水平布局,确定在右、取消在左)
LinearLayout btnLayout = new LinearLayout(getContext());
btnLayout.setOrientation(LinearLayout.HORIZONTAL);
btnLayout.setGravity(Gravity.RIGHT); // 整体右对齐,实现确定在右、取消在左
btnLayout.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
));
btnLayout.setPadding(0, 20, 0, 0); // 按钮栏与编辑框间距
rootLayout.addView(btnLayout);
// 3.1 取消按钮(左侧)
TextView cancelBtn = new TextView(getContext());
cancelBtn.setText("取消");
cancelBtn.setTextSize(16);
cancelBtn.setTextColor(Color.parseColor("#666666"));
cancelBtn.setPadding(20, 10, 20, 10);
cancelBtn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
dismiss();
}
}); // 关闭对话框
btnLayout.addView(cancelBtn);
// 3.2 确定按钮(右侧)
TextView confirmBtn = new TextView(getContext());
confirmBtn.setText("确定");
confirmBtn.setTextSize(16);
confirmBtn.setTextColor(Color.parseColor("#0066CC"));
confirmBtn.setPadding(20, 10, 20, 10);
confirmBtn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
if (mListener != null) {
// 回传编辑后的文本
mListener.onTextConfirmed(mEditText.getText().toString().trim());
}
dismiss(); // 关闭对话框
}
});
btnLayout.addView(confirmBtn);
// 设置对话框内容布局
setContentView(rootLayout);
}
/**
* dp转px工具方法
* @param context 上下文
* @param dpValue dp值
* @return 对应的px值
*/
private int dp2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
}

View File

@@ -1,59 +0,0 @@
package cc.winboll.studio.mymessagemanager.dialogs;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2024/05/30 09:53:26
* @Describe 用户确定与否选择框
*/
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class YesNoAlertDialog {
public static final String TAG = "YesNoAlertDialog";
public static void show(Context context, String szTitle, String szMessage, final OnDialogResultListener listener) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
context);
// set title
alertDialogBuilder.setTitle(szTitle);
// set dialog message
alertDialogBuilder
.setMessage(szMessage)
.setCancelable(true)
.setOnCancelListener(new DialogInterface.OnCancelListener(){
@Override
public void onCancel(DialogInterface dialog) {
listener.onNo();
}
})
.setPositiveButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// if this button is clicked, close
// current activity
listener.onYes();
}
})
.setNegativeButton("NO", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// if this button is clicked, just close
// the dialog box and do nothing
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
public interface OnDialogResultListener {
abstract void onYes();
abstract void onNo();
}
}

View File

@@ -0,0 +1,93 @@
package cc.winboll.studio.mymessagemanager.enums;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.StyleRes;
import cc.winboll.studio.mymessagemanager.R;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/12/09 14:15
* @Describe 主题风格枚举类 - 含SharedPreferences存取方法主题持久化
*/
public enum ThemeStyleEnum {
// 主题枚举项(与原逻辑完全对应)
DEPTH_THEME(R.id.item_depththeme, R.style.MyDepthAESTheme),
SKY_THEME(R.id.item_skytheme, R.style.MySkyAESTheme),
GOLDEN_THEME(R.id.item_goldentheme, R.style.MyGoldenAESTheme),
MEMOR_THEME(R.id.item_memortheme, R.style.MyMemorAESTheme),
TAO_THEME(R.id.item_taotheme, R.style.MyTaoAESTheme),
DEFAULT_THEME(R.id.item_defaulttheme, R.style.MyAppTheme);
// ---------------------- 基础字段(原逻辑保留) ----------------------
private final int menuId;
@StyleRes
private final int styleId;
ThemeStyleEnum(int menuId, @StyleRes int styleId) {
this.menuId = menuId;
this.styleId = styleId;
}
public int getMenuId() {
return menuId;
}
@StyleRes
public int getStyleId() {
return styleId;
}
// ---------------------- SharedPreferences 配置(新增) ----------------------
// SP文件名主题配置建议与枚举类关联便于查找
private static final String SP_THEME_NAME = "sp_theme_config";
// SP存储键当前选中的主题Style ID
private static final String KEY_CURRENT_THEME_STYLE_ID = "current_theme_style_id";
// ---------------------- 核心方法保存主题到SP新增 ----------------------
/**
* 保存当前选中的主题Style ID到SharedPreferences
* @param context 上下文Activity/Application均可
* @param theme 要保存的主题枚举项如ThemeStyleEnum.DEFAULT_THEME
*/
public static void saveThemeToSP(Context context, ThemeStyleEnum theme) {
if (context == null || theme == null) return;
// 获取SP实例私有模式仅当前App可访问
SharedPreferences sp = context.getSharedPreferences(SP_THEME_NAME, Context.MODE_PRIVATE);
// 存入主题对应的Style ID
sp.edit().putInt(KEY_CURRENT_THEME_STYLE_ID, theme.getStyleId()).apply();
}
// ---------------------- 核心方法从SP读取主题新增 ----------------------
/**
* 从SharedPreferences读取保存的主题无存储时返回默认主题
* @param context 上下文
* @return 保存的主题枚举项默认返回DEFAULT_THEME
*/
public static ThemeStyleEnum getThemeFromSP(Context context) {
if (context == null) return DEFAULT_THEME;
// 读取SP中保存的Style ID
SharedPreferences sp = context.getSharedPreferences(SP_THEME_NAME, Context.MODE_PRIVATE);
int savedStyleId = sp.getInt(KEY_CURRENT_THEME_STYLE_ID, DEFAULT_THEME.getStyleId());
// 根据保存的Style ID匹配对应的枚举项
for (ThemeStyleEnum theme : values()) {
if (theme.getStyleId() == savedStyleId) {
return theme;
}
}
// 无匹配时返回默认主题(防止异常)
return DEFAULT_THEME;
}
// ---------------------- 辅助方法根据菜单ID获取主题原逻辑保留并优化 ----------------------
public static ThemeStyleEnum getThemeByMenuId(int menuId) {
for (ThemeStyleEnum theme : values()) {
if (theme.getMenuId() == menuId) {
return theme;
}
}
return null;
}
}

View File

@@ -14,15 +14,14 @@ import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.IBinder;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.MainActivity;
import cc.winboll.studio.mymessagemanager.beans.MessageNotificationBean;
import cc.winboll.studio.mymessagemanager.receivers.SMSRecevier;
import cc.winboll.studio.mymessagemanager.services.MainService;
import cc.winboll.studio.mymessagemanager.utils.AppConfigUtil;
import cc.winboll.studio.mymessagemanager.utils.NotificationHelper;
import cc.winboll.studio.mymessagemanager.utils.ServiceUtil;
import com.hjq.toast.ToastUtils;
public class MainService extends Service {

View File

@@ -12,7 +12,7 @@ import android.content.Intent;
import android.net.Uri;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.BaseActivity;
import cc.winboll.studio.mymessagemanager.activitys.WinBoLLActivity;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
@@ -184,7 +184,7 @@ public class PermissionUtil {
// current activity
//MainActivity.this.finish();
AppGoToSettingsUtil appGoToSettingsUtil = new AppGoToSettingsUtil();
appGoToSettingsUtil.GoToSetting((BaseActivity)context);
appGoToSettingsUtil.GoToSetting((WinBoLLActivity)context);
}
})
.setNegativeButton("Exit", new DialogInterface.OnClickListener() {

View File

@@ -11,7 +11,6 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libapputils.utils.RegexPPiUtils;
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
import java.util.ArrayList;
import java.util.Collections;

View File

@@ -0,0 +1,32 @@
package cc.winboll.studio.mymessagemanager.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/12/09 11:10
* @Describe .* 前置预防针
* regex pointer preventive injection
* 简称 RegexPPi
*/
public class RegexPPiUtils {
public static final String TAG = "RegexPPiUtils";
//
// 检验文本是否满足适合正则表达式模式计算
//
public static boolean isPPiOK(String text) {
//String text = "这里是一些任意的文本内容";
String regex = ".*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(text);
/*if (matcher.matches()) {
System.out.println("文本满足该正则表达式模式");
} else {
System.out.println("文本不满足该正则表达式模式");
}*/
return matcher.matches();
}
}

View File

@@ -8,7 +8,6 @@ package cc.winboll.studio.mymessagemanager.utils;
import android.content.Context;
import android.util.JsonReader;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libapputils.utils.RegexPPiUtils;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean;
import cc.winboll.studio.mymessagemanager.beans.SMSAcceptRuleBean_V1;
import java.io.IOException;

View File

@@ -18,8 +18,8 @@ import android.provider.Telephony;
import android.telephony.gsm.SmsManager;
import android.telephony.gsm.SmsMessage;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.mymessagemanager.beans.SMSBean;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
public class SMSUtil {

View File

@@ -10,14 +10,15 @@ import android.content.Intent;
import android.os.Message;
import android.util.JsonReader;
import android.widget.Toast;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.mymessagemanager.activitys.TTSPlayRuleActivity;
import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean;
import cc.winboll.studio.mymessagemanager.beans.TTSPlayRuleBean_V1;
import cc.winboll.studio.mymessagemanager.beans.TTSSpeakTextBean;
import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog;
import cc.winboll.studio.mymessagemanager.services.TTSPlayService;
import cc.winboll.studio.mymessagemanager.utils.FileUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

View File

@@ -8,8 +8,8 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Switch;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.mymessagemanager.dialogs.YesNoAlertDialog;
public class ConfirmSwitchView extends Switch {

View File

@@ -62,12 +62,11 @@
android:layout_height="wrap_content"
android:text="拒绝显示的字符集:"/>
<EditText
android:layout_width="0dp"
android:ems="10"
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:id="@+id/activityappsettingsEditText3"/>
android:text="点击编辑"
android:onClick="onCharsetRefuseEditDialog"/>
</LinearLayout>
@@ -213,32 +212,56 @@
android:text="检查应用权限"
android:onClick="onCheckAndGetAppPermission"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="清理通知设置"
android:onClick="onCleanOldChannels"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="安装TTS语音支持"
android:onClick="onAddTTSSupport"/>
</LinearLayout>
</LinearLayout>
<cc.winboll.studio.libaes.views.ADsControlView
android:id="@+id/ads_control_view"
android:background="@drawable/bg_frame"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:background="#FFFFFFFF"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="》"
android:rotation="90"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@drawable/bg_frame">
android:background="@drawable/bg_frame"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activityappsettingsAOHPCTCSeekBar1"
android:padding="30dp"/>
android:id="@+id/activityappsettingsAOHPCTCSeekBar1"/>
<TextView
android:layout_width="match_parent"

View File

@@ -8,7 +8,6 @@
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:layout_gravity="center"
android:id="@+id/activitymainASupportToolbar1"/>
<LinearLayout
@@ -52,25 +51,37 @@
</LinearLayout>
<com.baoyz.widget.PullRefreshLayout
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:id="@+id/activitymainPullRefreshLayout1">
android:layout_weight="1.0">
<ScrollView
<com.baoyz.widget.PullRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitymainScrollView1">
android:id="@+id/activitymainPullRefreshLayout1">
<cc.winboll.studio.mymessagemanager.views.PhoneListViewForScrollView
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitymainListView1"/>
android:layout_height="match_parent"
android:id="@+id/activitymainScrollView1">
</ScrollView>
<cc.winboll.studio.mymessagemanager.views.PhoneListViewForScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitymainListView1"/>
</com.baoyz.widget.PullRefreshLayout>
</ScrollView>
</com.baoyz.widget.PullRefreshLayout>
</LinearLayout>
<cc.winboll.studio.libaes.views.ADsBannerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adsbanner"/>
</LinearLayout>

View File

@@ -4,7 +4,6 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme"
android:id="@+id/remoteviewLinearLayout1">
<ImageView

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="APP Debug">
<menu>
<item
android:id="@+id/app_unittest"
android:title="@string/app_unittest"/>
</menu>
</item>
</menu>

View File

@@ -1,19 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="@string/app_developoptions">
<menu>
<item
android:id="@+id/app_log"
android:title="@string/app_log"/>
<item
android:id="@+id/app_unittest"
android:title="@string/app_unittest"/>
<item
android:id="@+id/app_crashtest"
android:title="@string/app_crashtest"/>
</menu>
</item>
<item
android:id="@+id/app_appsettings"
android:title="@string/text_appsettings"/>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyAppTheme" parent="AESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColor</item>
</style>
<style name="MyDepthAESTheme" parent="DepthAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorDepth</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorDepth</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorDepth</item>
</style>
<style name="MySkyAESTheme" parent="SkyAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorSky</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorSky</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorSky</item>
</style>
<style name="MyGoldenAESTheme" parent="GoldenAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorGolden</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorGolden</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorGolden</item>
</style>
<style name="MyMemorAESTheme" parent="MemorAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorMemor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorMemor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorMemor</item>
</style>
<style name="MyTaoAESTheme" parent="TaoAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorTao</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorTao</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorTao</item>
</style>
</resources>

View File

@@ -1,90 +0,0 @@
<resources>
<style name="MyAppTheme" parent="AESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColor</item>
</style>
<style name="MyDepthAESTheme" parent="DepthAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorDepth</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorDepth</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorDepth</item>
</style>
<style name="MySkyAESTheme" parent="SkyAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorSky</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorSky</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorSky</item>
</style>
<style name="MyGoldenAESTheme" parent="GoldenAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorGolden</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorGolden</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorGolden</item>
</style>
<style name="MyMemorAESTheme" parent="MemorAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorMemor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorMemor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorMemor</item>
</style>
<style name="MyTaoAESTheme" parent="TaoAESTheme">
<item name="android:textSize">20sp</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorTao</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorTao</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorTao</item>
</style>
<!--<style name="AppTheme_Base" parent="android:Theme.Material.Light.NoActionBar">
<item name="colorPrimary">#FFC4C4C4</item>
<item name="colorPrimaryDark">#FF9F9F9F</item>
<item name="colorAccent">#FF888888</item>
</style>
<style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar">
<item name="colorPrimary">#FFC4C4C4</item>
<item name="colorPrimaryDark">#FF9F9F9F</item>
<item name="colorAccent">#FF888888</item>
</style>
<style name="AppTheme_Default" parent="android:Theme.Material.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textSize">20sp</item>
<item name="aToolbar">@style/DefaultAToolbar</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColor</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColor</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColor</item>
</style>
<style name="AppTheme_Sky" parent="android:Theme.Material.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimarySky</item>
<item name="colorPrimaryDark">@color/colorPrimaryDarkSky</item>
<item name="colorAccent">@color/colorAccentSky</item>
<item name="android:textSize">20sp</item>
<item name="aToolbar">@style/SKyAToolbar</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorSky</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorSky</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorSky</item>
</style>
<style name="AppTheme_Golden" parent="android:Theme.Material.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimaryGolden</item>
<item name="colorPrimaryDark">@color/colorPrimaryDarkGolden</item>
<item name="colorAccent">@color/colorAccentGolden</item>
<item name="android:textSize">20sp</item>
<item name="aToolbar">@style/GoldenAToolbar</item>
<item name="attrSMSViewSendColor">@color/colorSMSSendColorGolden</item>
<item name="attrSMSViewInboxColor">@color/colorSMSInboxColorGolden</item>
<item name="attrTTSRuleViewBackgroundColor">@color/colorTTSRuleViewBackgroundColorGolden</item>
</style>
-->
</resources>

View File

@@ -19,11 +19,11 @@ def genVersionName(def versionName){
android {
// 1. compileSdkVersion必须 ≥ targetSdkVersion建议直接等于 targetSdkVersion30
compileSdkVersion 30
// 关键:改为你已安装的 SDK 32≥ targetSdkVersion 30兼容已安装环境
compileSdkVersion 32
// 2. buildToolsVersion需匹配 compileSdkVersion建议使用 30.x.x 最新稳定版(无需高于 compileSdkVersion
buildToolsVersion "30.0.3" // 这是 30 对应的最新稳定版,避免使用 beta 版
// 直接使用已安装的构建工具 33.0.3(无需修改
buildToolsVersion "33.0.3"
defaultConfig {
applicationId "cc.winboll.studio.winboll"
@@ -43,6 +43,12 @@ android {
packagingOptions {
doNotStrip "*/*/libmimo_1011.so"
}
sourceSets {
main {
jniLibs.srcDirs = ['libs'] // 若SO库放在libs目录下
}
}
}
dependencies {
@@ -63,6 +69,10 @@ dependencies {
api 'io.github.medyo:android-about-page:2.0.0'
// 网络连接类库
api 'com.squareup.okhttp3:okhttp:4.4.1'
// OkHttp网络请求
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
// FastJSON解析
implementation 'com.alibaba:fastjson:1.2.76'
// AndroidX 类库
api 'androidx.appcompat:appcompat:1.1.0'

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Dec 07 03:22:51 HKT 2025
stageCount=7
#Tue Jan 06 06:07:46 GMT 2026
stageCount=9
libraryProject=
baseVersion=15.11
publishVersion=15.11.6
buildCount=0
baseBetaVersion=15.11.7
publishVersion=15.11.8
buildCount=10
baseBetaVersion=15.11.9

Binary file not shown.

View File

@@ -14,8 +14,8 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher_stage"
android:roundIcon="@drawable/ic_launcher_stage"
android:icon="@drawable/ic_launcher"
android:roundIcon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyAppTheme"
android:resizeableActivity="true"
@@ -37,7 +37,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher_stage"
android:icon="@drawable/ic_launcher"
android:enabled="true">
<intent-filter>
@@ -278,6 +278,10 @@
<activity android:name="cc.winboll.studio.winboll.activities.SettingsActivity"/>
<activity android:name="cc.winboll.studio.winboll.unittest.TestWeWorkSpecSDK"/>
<activity android:name="cc.winboll.studio.winboll.activities.WXPayActivity"/>
</application>
</manifest>

View File

@@ -1,6 +1,6 @@
package cc.winboll.studio.winboll;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -8,20 +8,17 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import cc.winboll.studio.libaes.activitys.AboutActivity;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.models.APPInfo;
import cc.winboll.studio.libaes.models.DrawerMenuBean;
import cc.winboll.studio.libaes.unittests.TestAButtonFragment;
import cc.winboll.studio.libaes.unittests.TestViewPageFragment;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.winboll.activities.SettingsActivity;
import cc.winboll.studio.winboll.activities.WXPayActivity;
import cc.winboll.studio.winboll.fragments.BrowserFragment;
import java.util.ArrayList;
import android.content.Intent;
import cc.winboll.studio.libaes.activitys.AboutActivity;
public class MainActivity extends DrawerFragmentActivity {
@@ -152,6 +149,8 @@ public class MainActivity extends DrawerFragmentActivity {
}
} else if (nItemId == R.id.item_settings) {
WinBoLLActivityManager.getInstance().startWinBoLLActivity(getApplicationContext(), SettingsActivity.class);
} else if (nItemId == R.id.item_wxpayactivity) {
WinBoLLActivityManager.getInstance().startWinBoLLActivity(getApplicationContext(), WXPayActivity.class);
} else if (nItemId == cc.winboll.studio.libaes.R.id.item_about) {
Intent intent = new Intent(getApplicationContext(), AboutActivity.class);
APPInfo appInfo = genDefaultAPPInfo();

View File

@@ -0,0 +1,28 @@
package cc.winboll.studio.winboll;
/**
* 微信支付配置类
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class WxPayConfig {
// ========== 核心修改点:替换为你的服务端地址 ==========
// 服务端IP/域名 + 端口Docker部署的服务端需确保安卓端可访问
public static final String BASE_URL = "https://wxpay.winboll.cc";
// 统一下单接口路径(对应服务端的测试接口)
public static final String CREATE_ORDER_URL = BASE_URL + "/pay/createOrder";
// 订单查询接口路径
public static final String QUERY_ORDER_URL = BASE_URL + "/pay/queryOrder";
// ========== 固定支付配置 ==========
public static final String ORDER_BODY = "定额测试支付"; // 商品描述
public static final int TOTAL_FEE = 1; // 固定金额1分沙箱环境推荐
public static final String TRADE_TYPE = "NATIVE"; // 支付类型:二维码
// ========== 轮询配置 ==========
public static final long POLL_INTERVAL = 10000; // 轮询间隔10秒
public static final long POLL_TIMEOUT = 45000; // 轮询超时45秒
}

View File

@@ -0,0 +1,211 @@
package cc.winboll.studio.winboll.activities;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.winboll.WxPayConfig;
import cc.winboll.studio.winboll.utils.SpecUtil;
import cc.winboll.studio.winboll.utils.WxPayApi;
import cc.winboll.studio.winboll.utils.ZXingUtils;
import java.util.Timer;
import java.util.TimerTask;
/**
* 主界面:生成二维码 + 轮询查询支付结果
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class WXPayActivity extends WinBoLLActivity implements IWinBoLLActivity {
private static final String TAG = "WXPayActivity";
// Handler消息标识
private static final int MSG_POLL_TIMEOUT = 1001;
private static final int MSG_POLL_SUCCESS = 1002;
private static final int MSG_POLL_FAILED = 1003;
private ImageView mIvQrCode;
private TextView mTvOrderNo;
private TextView mTvPayStatus;
private Button mBtnCreateOrder;
private String mOutTradeNo; // 商户订单号
private Timer mPollTimer; // 轮询定时器
private long mPollStartTime; // 轮询开始时间
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
private Handler mPollHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MSG_POLL_TIMEOUT:
stopPoll();
mTvPayStatus.setText("支付状态:轮询超时");
mTvPayStatus.setTextColor(getResources().getColor(android.R.color.darker_gray));
Toast.makeText(WXPayActivity.this, "轮询超时,请手动查询", Toast.LENGTH_SHORT).show();
break;
case MSG_POLL_SUCCESS:
boolean isPaySuccess = (boolean) msg.obj;
String tradeState = (String) msg.getData().getString("tradeState");
stopPoll();
if (isPaySuccess) {
mTvPayStatus.setText("支付状态:支付成功 ✅");
mTvPayStatus.setTextColor(getResources().getColor(android.R.color.holo_green_dark));
Toast.makeText(WXPayActivity.this, "支付成功!", Toast.LENGTH_SHORT).show();
} else {
mTvPayStatus.setText("支付状态:" + tradeState);
mTvPayStatus.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
}
break;
case MSG_POLL_FAILED:
String errorMsg = (String) msg.obj;
mTvPayStatus.setText("查询失败:" + errorMsg);
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wxpay);
initView();
initListener();
}
private void initView() {
mIvQrCode = findViewById(R.id.iv_qrcode);
mTvOrderNo = findViewById(R.id.tv_order_no);
mTvPayStatus = findViewById(R.id.tv_pay_status);
mBtnCreateOrder = findViewById(R.id.btn_create_order);
}
private void initListener() {
mBtnCreateOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
createOrder();
}
});
}
/**
* 统一下单,生成二维码
*/
private void createOrder() {
mBtnCreateOrder.setEnabled(false);
mTvPayStatus.setText("支付状态:生成订单中...");
mIvQrCode.setImageBitmap(null);
WxPayApi.createOrder(new WxPayApi.OnCreateOrderCallback() {
@Override
public void onSuccess(String outTradeNo, String codeUrl) {
mOutTradeNo = outTradeNo;
mTvOrderNo.setText("商户订单号:" + outTradeNo);
mTvPayStatus.setText("支付状态:未支付,请扫码");
// 生成二维码
Bitmap qrCodeBitmap = ZXingUtils.createQRCodeBitmap(codeUrl, 250, 250);
if (qrCodeBitmap != null) {
mIvQrCode.setImageBitmap(qrCodeBitmap);
// 开始轮询查询支付结果
startPoll();
} else {
mTvPayStatus.setText("支付状态:生成二维码失败");
mBtnCreateOrder.setEnabled(true);
}
}
@Override
public void onFailure(String errorMsg) {
SpecUtil.WWSpecLogError(TAG, "统一下单失败:" + errorMsg);
mTvPayStatus.setText("生成订单失败:" + errorMsg);
mBtnCreateOrder.setEnabled(true);
Toast.makeText(WXPayActivity.this, errorMsg, Toast.LENGTH_SHORT).show();
}
});
}
/**
* 开始轮询查询支付结果
*/
private void startPoll() {
stopPoll(); // 先停止之前的轮询
mPollStartTime = System.currentTimeMillis();
mPollTimer = new Timer();
mPollTimer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
// 检查是否超时
long elapsedTime = System.currentTimeMillis() - mPollStartTime;
if (elapsedTime >= WxPayConfig.POLL_TIMEOUT) {
mPollHandler.sendEmptyMessage(MSG_POLL_TIMEOUT);
return;
}
// 查询订单状态
WxPayApi.queryOrder(mOutTradeNo, new WxPayApi.OnQueryOrderCallback() {
@Override
public void onSuccess(boolean isPaySuccess, String tradeState) {
Message msg = Message.obtain();
msg.what = MSG_POLL_SUCCESS;
msg.obj = isPaySuccess;
Bundle bundle = new Bundle();
bundle.putString("tradeState", tradeState);
msg.setData(bundle);
mPollHandler.sendMessage(msg);
}
@Override
public void onFailure(String errorMsg) {
Message msg = Message.obtain();
msg.what = MSG_POLL_FAILED;
msg.obj = errorMsg;
mPollHandler.sendMessage(msg);
}
});
}
}, 0, WxPayConfig.POLL_INTERVAL);
}
/**
* 停止轮询
*/
private void stopPoll() {
if (mPollTimer != null) {
mPollTimer.cancel();
mPollTimer = null;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
stopPoll();
}
}

View File

@@ -0,0 +1,311 @@
package cc.winboll.studio.winboll.unittest;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.winboll.activities.WinBoLLActivity;
/**
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/03 10:52
* @Describe 企业微信SDK接口测试基础调试版
* 包含SDK初始化、基础接口调用、日志输出、主线程回调处理
*/
public class TestWeWorkSpecSDK extends WinBoLLActivity implements IWinBoLLActivity, View.OnClickListener {
public static final String TAG = "TestWeWorkSpecSDK";
// ------------------- 企业微信SDK配置常量需替换为实际项目参数 -------------------
// 企业微信 CorpID从企业微信管理后台获取
private static final String CORP_ID = "wwb37c73f34c722852";
// 应用 AgentID从企业微信应用管理后台获取
private static final String AGENT_ID = "your_agent_id_here";
// 应用 Secret从企业微信应用管理后台获取注意保密
private static final String APP_SECRET = "your_app_secret_here";
// ------------------- Handler消息标识主线程处理SDK回调 -------------------
private static final int MSG_SDK_INIT_SUCCESS = 1001;
private static final int MSG_SDK_INIT_FAILED = 1002;
private static final int MSG_GET_CORP_INFO_SUCCESS = 1003;
private static final int MSG_GET_CORP_INFO_FAILED = 1004;
// ------------------- 控件声明 -------------------
private Button mBtnInitSDK;
private Button mBtnGetCorpInfo;
private Button mBtnCheckAuth;
// ------------------- 主线程Handler处理SDK异步回调 -------------------
private Handler mWeWorkHandler;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_weworkspecsdk);
// 初始化控件
initViews();
// 绑定点击事件
initEvents();
// 初始化Handler主线程处理回调更新UI
initHandler();
// 初始化SDK可选启动时自动初始化或点击按钮初始化
// initWeWorkSDK();
}
/**
* 初始化控件Java 7 显式绑定)
*/
private void initViews() {
mBtnInitSDK = (Button) findViewById(R.id.btn_init_sdk);
mBtnGetCorpInfo = (Button) findViewById(R.id.btn_get_corp_info);
mBtnCheckAuth = (Button) findViewById(R.id.btn_check_auth);
}
/**
* 绑定点击事件Java 7 匿名内部类)
*/
private void initEvents() {
mBtnInitSDK.setOnClickListener(this);
mBtnGetCorpInfo.setOnClickListener(this);
mBtnCheckAuth.setOnClickListener(this);
}
/**
* 初始化主线程Handler处理SDK异步回调安全更新UI
*/
private void initHandler() {
mWeWorkHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MSG_SDK_INIT_SUCCESS:
showToast("企业微信SDK初始化成功");
LogUtils.d(TAG, "SDK初始化成功");
break;
case MSG_SDK_INIT_FAILED:
String initError = (String) msg.obj;
showToast("SDK初始化失败" + initError);
LogUtils.e(TAG, "SDK初始化失败" + initError);
break;
case MSG_GET_CORP_INFO_SUCCESS:
String corpInfo = (String) msg.obj;
showToast("获取企业信息成功");
LogUtils.d(TAG, "企业信息:" + corpInfo);
break;
case MSG_GET_CORP_INFO_FAILED:
String corpError = (String) msg.obj;
showToast("获取企业信息失败:" + corpError);
LogUtils.e(TAG, "获取企业信息失败:" + corpError);
break;
default:
break;
}
}
};
}
// ------------------- 企业微信SDK核心接口调用 -------------------
/**
* 初始化企业微信SDK异步操作通过Handler回调结果
*/
private void initWeWorkSDK() {
showToast("开始初始化企业微信SDK...");
// 模拟SDK异步初始化实际项目中替换为企业微信SDK的真实初始化接口
new Thread(new Runnable() {
@Override
public void run() {
try {
// 真实SDK初始化逻辑示例
// WeWorkSDK.init(TestWeWorkSpecSDK.this, CORP_ID, AGENT_ID, new WeWorkSDKCallback() {
// @Override
// public void onSuccess() {
// mWeWorkHandler.sendEmptyMessage(MSG_SDK_INIT_SUCCESS);
// }
//
// @Override
// public void onFailure(String errorMsg) {
// Message msg = Message.obtain();
// msg.what = MSG_SDK_INIT_FAILED;
// msg.obj = errorMsg;
// mWeWorkHandler.sendMessage(msg);
// }
// });
// 调试模拟休眠1秒模拟异步初始化
Thread.sleep(1000);
// 模拟初始化成功如需测试失败替换为发送MSG_SDK_INIT_FAILED
mWeWorkHandler.sendEmptyMessage(MSG_SDK_INIT_SUCCESS);
// 模拟初始化失败
// Message msg = Message.obtain();
// msg.what = MSG_SDK_INIT_FAILED;
// msg.obj = "CorpID或AgentID错误";
// mWeWorkHandler.sendMessage(msg);
} catch (InterruptedException e) {
e.printStackTrace();
Message msg = Message.obtain();
msg.what = MSG_SDK_INIT_FAILED;
msg.obj = "线程中断:" + e.getMessage();
mWeWorkHandler.sendMessage(msg);
}
}
}).start();
}
/**
* 获取企业基本信息异步操作需先初始化SDK
*/
private void getCorpInfo() {
if (!isSDKInitialized()) {
showToast("请先初始化SDK");
return;
}
showToast("开始获取企业信息...");
// 模拟SDK异步获取企业信息实际项目中替换为真实接口
new Thread(new Runnable() {
@Override
public void run() {
try {
// 真实SDK接口示例
// WeWorkSDK.getCorpInfo(APP_SECRET, new CorpInfoCallback() {
// @Override
// public void onSuccess(CorpInfo info) {
// Message msg = Message.obtain();
// msg.what = MSG_GET_CORP_INFO_SUCCESS;
// msg.obj = "企业名称:" + info.getCorpName() + "企业ID" + info.getCorpId();
// mWeWorkHandler.sendMessage(msg);
// }
//
// @Override
// public void onFailure(String errorMsg) {
// Message msg = Message.obtain();
// msg.what = MSG_GET_CORP_INFO_FAILED;
// msg.obj = errorMsg;
// mWeWorkHandler.sendMessage(msg);
// }
// });
// 调试模拟休眠1秒模拟异步获取
Thread.sleep(1000);
// 模拟获取成功
Message successMsg = Message.obtain();
successMsg.what = MSG_GET_CORP_INFO_SUCCESS;
successMsg.obj = "企业名称WinBoLL Studio企业ID" + CORP_ID;
mWeWorkHandler.sendMessage(successMsg);
// 模拟获取失败
// Message failMsg = Message.obtain();
// failMsg.what = MSG_GET_CORP_INFO_FAILED;
// failMsg.obj = "AppSecret错误或权限不足";
// mWeWorkHandler.sendMessage(failMsg);
} catch (InterruptedException e) {
e.printStackTrace();
Message msg = Message.obtain();
msg.what = MSG_GET_CORP_INFO_FAILED;
msg.obj = "线程中断:" + e.getMessage();
mWeWorkHandler.sendMessage(msg);
}
}
}).start();
}
/**
* 检查当前用户是否已授权(同步操作,示例)
*/
private void checkAuthStatus() {
if (!isSDKInitialized()) {
showToast("请先初始化SDK");
return;
}
// 真实SDK接口示例
// boolean isAuthorized = WeWorkSDK.isAuthorized();
// 调试模拟默认返回true
boolean isAuthorized = true;
if (isAuthorized) {
showToast("用户已授权");
LogUtils.d(TAG, "当前用户已授权企业微信应用");
} else {
showToast("用户未授权,请先授权");
LogUtils.d(TAG, "当前用户未授权企业微信应用");
// 真实项目中可调用授权接口:
// WeWorkSDK.requestAuth(TestWeWorkSpecSDK.this, new AuthCallback() {
// @Override
// public void onSuccess(String code) {
// showToast("授权成功code" + code);
// }
//
// @Override
// public void onFailure(String errorMsg) {
// showToast("授权失败:" + errorMsg);
// }
// });
}
}
// ------------------- 工具方法 -------------------
/**
* 检查SDK是否已初始化模拟方法实际项目中替换为SDK的真实状态检查
*/
private boolean isSDKInitialized() {
// 真实SDK可通过静态方法检查状态
// return WeWorkSDK.isInitialized();
// 调试模拟假设Handler不为空即表示已初始化
return mWeWorkHandler != null;
}
/**
* 显示Toast提示Java 7 简化封装)
*/
private void showToast(String msg) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
// ------------------- 点击事件处理 -------------------
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.btn_init_sdk) {
initWeWorkSDK();
} else if (id == R.id.btn_get_corp_info) {
getCorpInfo();
} else if (id == R.id.btn_check_auth) {
checkAuthStatus();
}
}
// ------------------- 生命周期管理 -------------------
@Override
protected void onDestroy() {
super.onDestroy();
// 释放Handler资源避免内存泄漏
if (mWeWorkHandler != null) {
mWeWorkHandler.removeCallbacksAndMessages(null);
mWeWorkHandler = null;
}
// 真实SDK需调用销毁方法
// WeWorkSDK.destroy();
}
}

View File

@@ -0,0 +1,83 @@
package cc.winboll.studio.winboll.utils;
import android.os.Handler;
import android.os.Looper;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* OkHttp网络请求工具类
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class OkHttpUtil {
private static OkHttpClient sOkHttpClient;
private static Handler sMainHandler = new Handler(Looper.getMainLooper());
static {
sOkHttpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.build();
}
/**
* GET请求
* @param url 请求地址
* @param callback 回调
*/
public static void get(String url, final OnResultCallback callback) {
Request request = new Request.Builder()
.url(url)
.get()
.build();
sOkHttpClient.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, final IOException e) {
sMainHandler.post(new Runnable() {
@Override
public void run() {
if (callback != null) {
callback.onFailure(e.getMessage());
}
}
});
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
final String result = response.body().string();
sMainHandler.post(new Runnable() {
@Override
public void run() {
if (callback != null) {
if (response.isSuccessful()) {
callback.onSuccess(result);
} else {
callback.onFailure("请求失败:" + response.code());
}
}
}
});
}
});
}
/**
* 回调接口
*/
public interface OnResultCallback {
void onSuccess(String result);
void onFailure(String errorMsg);
}
}

View File

@@ -0,0 +1,26 @@
package cc.winboll.studio.winboll.utils;
import cc.winboll.studio.libappbase.LogUtils;
/**
* 日志工具类(适配项目规范)
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class SpecUtil {
private static final boolean isDebug = true;
public static void WWSpecLogInfo(String tag, String msg) {
if (isDebug) {
LogUtils.i(tag, msg);
}
}
public static void WWSpecLogError(String tag, String msg) {
if (isDebug) {
LogUtils.e(tag, msg);
}
}
}

View File

@@ -0,0 +1,100 @@
package cc.winboll.studio.winboll.utils;
import cc.winboll.studio.winboll.WxPayConfig;
import com.alibaba.fastjson.JSONObject;
/**
* 微信支付服务端接口封装
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class WxPayApi {
/**
* 统一下单(生成二维码)
* @param callback 回调
*/
public static void createOrder(final OnCreateOrderCallback callback) {
// 拼接请求参数服务端测试接口需支持GET传参若为POST需修改为表单/JSON
String url = WxPayConfig.CREATE_ORDER_URL +
"?body=" + WxPayConfig.ORDER_BODY +
"&totalFee=" + WxPayConfig.TOTAL_FEE +
"&tradeType=" + WxPayConfig.TRADE_TYPE;
OkHttpUtil.get(url, new OkHttpUtil.OnResultCallback() {
@Override
public void onSuccess(String result) {
try {
JSONObject jsonObject = JSONObject.parseObject(result);
String outTradeNo = jsonObject.getString("out_trade_no");
String codeUrl = jsonObject.getString("code_url");
if (callback != null) {
callback.onSuccess(outTradeNo, codeUrl);
}
} catch (Exception e) {
if (callback != null) {
callback.onFailure("解析统一下单结果失败:" + e.getMessage());
}
}
}
@Override
public void onFailure(String errorMsg) {
if (callback != null) {
callback.onFailure("统一下单请求失败:" + errorMsg);
}
}
});
}
/**
* 订单查询
* @param outTradeNo 商户订单号
* @param callback 回调
*/
public static void queryOrder(String outTradeNo, final OnQueryOrderCallback callback) {
String url = WxPayConfig.QUERY_ORDER_URL + "?outTradeNo=" + outTradeNo;
OkHttpUtil.get(url, new OkHttpUtil.OnResultCallback() {
@Override
public void onSuccess(String result) {
try {
JSONObject jsonObject = JSONObject.parseObject(result);
String tradeState = jsonObject.getString("trade_state");
boolean isSuccess = "SUCCESS".equals(tradeState);
if (callback != null) {
callback.onSuccess(isSuccess, tradeState);
}
} catch (Exception e) {
if (callback != null) {
callback.onFailure("解析订单查询结果失败:" + e.getMessage());
}
}
}
@Override
public void onFailure(String errorMsg) {
if (callback != null) {
callback.onFailure("订单查询请求失败:" + errorMsg);
}
}
});
}
/**
* 统一下单回调接口
*/
public interface OnCreateOrderCallback {
void onSuccess(String outTradeNo, String codeUrl);
void onFailure(String errorMsg);
}
/**
* 订单查询回调接口
*/
public interface OnQueryOrderCallback {
void onSuccess(boolean isPaySuccess, String tradeState);
void onFailure(String errorMsg);
}
}

View File

@@ -0,0 +1,75 @@
package cc.winboll.studio.winboll.utils;
import android.graphics.Bitmap;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.journeyapps.barcodescanner.BarcodeEncoder;
import java.util.HashMap;
import java.util.Map;
/**
* ZXing二维码生成工具类
* 依赖com.google.zxing:core:3.4.1 + com.journeyapps:zxing-android-embedded:3.6.0
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2026/01/07
*/
public class ZXingUtils {
/**
* 生成二维码Bitmap核心方法使用journeyapps工具类
* @param content 内容如微信支付的code_url
* @param width 二维码宽度px
* @param height 二维码高度px
* @return 二维码Bitmap失败返回null
*/
public static Bitmap createQRCodeBitmap(String content, int width, int height) {
// 1. 入参合法性校验
if (content == null || content.trim().isEmpty()) {
return null;
}
if (width <= 0 || height <= 0) {
return null;
}
// 2. 配置二维码参数
Map<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); // 字符编码
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 高容错级别H级可容忍30%遮挡)
hints.put(EncodeHintType.MARGIN, 1); // 边距值越小二维码越紧凑建议1-4
try {
// 3. 生成BitMatrix二维码矩阵
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(
content,
BarcodeFormat.QR_CODE,
width,
height,
hints
);
// 4. 转换BitMatrix为Bitmap关键使用journeyapps的BarcodeEncoder
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
return barcodeEncoder.createBitmap(bitMatrix);
} catch (WriterException e) {
e.printStackTrace();
return null;
}
}
/**
* 重载方法:生成正方形二维码(宽度=高度)
* @param content 内容
* @param size 二维码边长px
* @return 二维码Bitmap
*/
public static Bitmap createQRCodeBitmap(String content, int size) {
return createQRCodeBitmap(content, size, size);
}
}

View File

@@ -0,0 +1,210 @@
package com.tencent.wework;
import java.util.Map;
import java.util.HashMap;;
/**
* @warning: 1. 不要修改成员变量名native方法内有反射调用
* 2. 调用本地方法需保持包结构本工具需放在包com.tencent.wework内
* 3. 不允许继承类名和函数名均不可修改会影响本地方法的引用详见javah生成本地方法头文件
*/
public final class SpecCallbackSDK {
/**
* @description 调用本地方法后实例化的对象指针
*/
private long specCallbackSDKptr = 0;
public long GetPtr() { return specCallbackSDKptr; }
/**
* @description: 回包的headers
*/
private Map<String, String> responseHeaders;
public Map<String, String> GetResponseHeaders() { return responseHeaders; }
/**
* @description: 回包的加密后的body
*/
private String responseBody;
public String GetResponseBody() { return responseBody; }
/**
* @description: 每个请求构造一个SpecCallbackSDK示例,
* SpecCallbackSDK仅持有headers和body的引用,
* 因此需保证headers和body的生存期比SpecCallbackSDK长
* @param method: 请求方法GET/POST
* @param headers: 请求header
* @param body: 请求body
* @example:
* SpecCallbackSDK sdk = new SpecCallbackSDK(method, headers, body);
* if (sdk.IsOk()) {
* String corpid = sdk.GetCorpId();
* String agentid = sdk.GetAgentId();
* String call_type = sdk.GetCallType();
* String data = sdk.GetData();
* //do something...
* }
* String response = ...;
* sdk.BuildResponseHeaderBody(response);
* Map<String, String> responseHeaders = sdk.GetResponseHeaders();
* String body = sdk.GetResponseBody();
* //do response
*
* @return errorcode 示例如下:
* -920001: 未设置请求方法
* -920002: 未设置请求header
* -920003: 未设置请求body
* */
public SpecCallbackSDK(String method, Map<String, String> headers, String body) {
try {
specCallbackSDKptr = NewCallbackSDK(method, headers, body);
} catch (Exception e) {
SpecUtil.WWSpecLogError("SpecCallbackSDK exception caught", e.getMessage());
}
}
private native long NewCallbackSDK(String method, Map<String, String> headers, String body);
/**
* @usage 在Java对象的内存回收前析构C++对象
*/
@Override
protected void finalize() throws Throwable {
DeleteCPPInstance(specCallbackSDKptr);
super.finalize();
}
private native void DeleteCPPInstance(long specCallbackSDKptr);
/**
* @description: 判断构造函数中传入的请求是否解析成功
* @return: 成功与否
* */
public boolean IsOk() {
return IsOk(specCallbackSDKptr);
}
private native boolean IsOk(long specCallbackSDKptr);
/**
* @description: 获取请求的企业
* @require: 仅当IsOk() == true可调用
* @return: corpid
* */
public String GetCorpId() {
return GetCorpId(specCallbackSDKptr);
}
private native String GetCorpId(long specCallbackSDKptr);
/**
* @description: 获取请求的应用
* @require: 仅当IsOk() == true可调用
* @return: agentid
* */
public long GetAgentId() {
return GetAgentId(specCallbackSDKptr);
}
private native long GetAgentId(long specCallbackSDKptr);
/**
* @description: 获取请求的类型
* @require: 仅当IsOk() == true可调用
* @return: 1 - 来自[应用调用专区]的请求
* 2 - 来自企业微信的回调事件
* */
public long GetCallType() {
return GetCallType(specCallbackSDKptr);
}
private native long GetCallType(long specCallbackSDKptr);
/**
* @description: 获取请求数据
* @require: 仅当IsOk() == true可调用
* @return: 请求数据,根据call_type可能是:
* - 企业微信回调事件
* - [应用调用专区]接口中的request_data
* */
public String GetData() {
return GetData(specCallbackSDKptr);
}
private native String GetData(long specCallbackSDKptr);
/**
* @description: 是否异步请求
* @require: 仅当IsOk() == true可调用
* @return: 是否异步请求
* */
public boolean GetIsAsync() {
return GetIsAsync(specCallbackSDKptr);
}
private native boolean GetIsAsync(long specCallbackSDKptr);
/**
* @description: 获取请求的job_info,
* @require: 仅当IsOk() == true可调用
* @return: job_info,无需理解内容,
* 在同一个请求上下文中使用SpecSDK的时候传入
* */
public String GetJobInfo() {
return GetJobInfo(specCallbackSDKptr);
}
private native String GetJobInfo(long specCallbackSDKptr);
/**
* @description: 获取请求的ability_id,[应用调用专区]接口时指定
* @require: 仅当IsOk() == true可调用
* @return: ability_id
* */
public String GetAbilityId() {
return GetAbilityId(specCallbackSDKptr);
}
private native String GetAbilityId(long specCallbackSDKptr);
/**
* @description: 获取请求的notify_id,用于[应用同步调用专区程序]接口
* @require: 仅当IsOk() == true可调用
* @return: notify_id
* */
public String GetNotifyId() {
return GetNotifyId(specCallbackSDKptr);
}
private native String GetNotifyId(long specCallbackSDKptr);
/**
* @description: 对返回包计算签名&加密
* @param response: 待加密的回包明文.如果IsOk()==false,传入空串即可
* @note 本接口的执行问题可查看日志
* */
public void BuildResponseHeaderBody(String response) {
try {
responseHeaders = new HashMap<String, String>();
responseBody = "";
BuildResponseHeaderBody(specCallbackSDKptr, response);
} catch (Exception e) {
SpecUtil.WWSpecLogError("SpecCallbackSDK exception caught", e.getMessage());
}
}
private native void BuildResponseHeaderBody(long specCallbackSDKptr, String response);
// 静态代码块内还无法调用native日志函数这里的日志在管理系统无法查询
static {
try {
Class.forName("com.tencent.wework.SpecUtil");
} catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
}
}

View File

@@ -0,0 +1,163 @@
package com.tencent.wework;
/**
* @warning: 1. 不要修改成员变量名native方法内有反射调用
* 2. 调用本地方法需保持包结构本工具需放在包com.tencent.wework内
* 3. 不允许继承类名和函数名均不可修改会影响本地方法的引用详见javah生成本地方法头文件
*/
public final class SpecSDK {
/**
* @description 调用本地方法后实例化的对象指针
*/
private long specSDKptr = 0;
/**
* @usage invoke的请求
* @example "{\"limit\":1}
*/
private String request;
public void SetRequest(String request) {
this.request = request;
}
/**
* @usage 访问上一次invoke的结果
*/
private String response;
public String GetResponse() {
return response;
}
/**
* @param corpid: 企业corpid必选参数
* @param agentid: 应用id必选参数
* @param ability_id: 能力ID可选参数
* @param job_info: job_info可选参数
* */
public SpecSDK(String corpId, long agentId) {
specSDKptr = NewSDK1(corpId, agentId);
}
private native long NewSDK1(String corpId, long agentId);
public SpecSDK(String corpId, long agentId, String abilityId) {
specSDKptr = NewSDK2(corpId, agentId, abilityId);
}
private native long NewSDK2(String corpId, long agentId, String abilityId);
public SpecSDK(String corpId, long agentId, String abilityId, String jobInfo) {
specSDKptr = NewSDK3(corpId, agentId, abilityId, jobInfo);
}
private native long NewSDK3(String corpId, long agentId, String abilityId, String jobInfo);
/**
* @description 使用callback的请求来初始化
* @param callback_sdk: 要求IsOk()==true
* @return C++内部指针创建失败时指针仍为0并输出错误日志
* */
public SpecSDK(SpecCallbackSDK callbackSDK) {
specSDKptr = NewSDK4(callbackSDK.GetPtr());
}
private native long NewSDK4(long callbackSDK);
/**
* @usage 在Java对象的内存回收前析构C++对象
*/
@Override
protected void finalize() throws Throwable {
DeleteCPPInstance(specSDKptr);
super.finalize();
}
private native void DeleteCPPInstance(long specSDKptr);
/**
* @description 用于在专区内调用企业微信接口
* @param api_name 接口名
* @param request json格式的请求数据
* @param response json格式的返回数据
* @return errorcode 参考如下:
* 0: 成功
* -910001: SDK没有初始化
* -910002: 没有设置请求体
* -910003: 没有设置请求的API
* -910004: 在SDK成员内找不到成员"response",注意lib内有反射机制,不要修改成员变量名
* -910005: 使用未初始化的callback初始化SDK
* -910006: invoke调用失败,应检查日志查看具体原因
* -910007: 响应体为空
* @note 当返回0时,表示没有网络或请求协议层面或调用方法的失败,
* 调用方需继续检查response中的errcode字段确保业务层面的成功
*
* @usage 当前版本sdk支持的接口列表,每个接口的具体协议请查看企业微信文档:
* https://developer.work.weixin.qq.com/document/path/91201
*
* +--------------------------------+--------------------------------+
* |接口名 |描述 |
* |--------------------------------|--------------------------------|
* |program_async_job_call_back |上报异步任务结果 |
* |sync_msg |获取会话记录 |
* |get_group_chat |获取内部群信息 |
* |get_agree_status_single |获取单聊会话同意情况 |
* |get_agree_status_room |获取群聊会话同意情况 |
* |set_hide_sensitiveinfo_config |设置成员会话组件敏感信息隐藏配置|
* |get_hide_sensitiveinfo_config |获取成员会话组件敏感信息隐藏配置|
* |search_chat |会话名称搜索 |
* |search_msg |会话消息搜索 |
* |create_rule |新增关键词规则 |
* |get_rule_list |获取关键词列表 |
* |get_rule_detail |获取关键词规则详情 |
* |update_rule |修改关键词规则 |
* |delete_rule |删除关键词规则 |
* |get_hit_msg_list |获取命中关键词规则的会话记录 |
* |create_sentiment_task |创建情感分析任务 |
* |get_sentiment_result |获取情感分析结果 |
* |create_summary_task |创建摘要提取任务 |
* |get_summary_result |获取摘要提取结果 |
* |create_customer_tag_task |创建标签匹配任务 |
* |get_customer_tag_result |获取标签任务结果 |
* |create_recommend_dialog_task |创建话术推荐任务 |
* |get_recommend_dialog_result |获取话术推荐结果 |
* |create_private_task |创建自定义模型任务 |
* |get_private_task_result |获取自定义模型结果 |
* |(废弃)document_list |获取知识集列表 |
* |create_spam_task |会话反垃圾创建分析任务 |
* |get_spam_result |会话反垃圾获取任务结果 |
* |create_chatdata_export_job |创建会话内容导出任务 |
* |get_chatdata_export_job_status |获取会话内容导出任务结果 |
* |spec_notify_app |专区通知应用 |
* |create_program_task |创建自定义程序任务 |
* |get_program_task_result |获取自定义程序结果 |
* |knowledge_base_list |获取企业授权给应用的知识集列表 |
* |knowledge_base_create |创建知识集 |
* |knowledge_base_detail |获取知识集详情 |
* |knowledge_base_add_doc |添加知识集內容 |
* |knowledge_base_remove_doc |删除知识集內容 |
* |knowledge_base_modify_name |修改知识集名称 |
* |knowledge_base_delete |删除知识集 |
* |search_contact_or_customer |员工或者客户名称搜索 |
* |create_ww_model_task |创建企微通用模型任务 |
* |get_ww_model_result |获取企微通用模型结果 |
* |get_msg_list_by_page_id |page_id获取消息列表 |
* +-----------------------------------------------------------------+
* */
public int Invoke(String apiName) {
return Invoke(specSDKptr, apiName, request);
}
private native int Invoke(long sdk, String apiName, String request);
// 静态代码块内还无法调用native日志函数这里的日志在管理系统无法查询
static {
try {
Class.forName("com.tencent.wework.SpecUtil");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,171 @@
package com.tencent.wework;
//import java.lang.management.ManagementFactory;
//import java.lang.management.RuntimeMXBean;
/**
* @warning: 1. 不要修改成员变量名native方法内有反射调用
* 2. 调用本地方法需保持包结构本工具需放在包com.tencent.wework内
* 3. 不允许继承类名和函数名均不可修改会影响本地方法的引用详见javah生成本地方法头文件
* 4. 使用其他工具打印的日志将无法被查询如需使用SLF4j风格的日志或性能更好的日志框架
* 请自行封装SpecUtil.SpecLog或SpecUtil.SpecLogNative方法
*
* @usage: 1. 获取SDK的版本号
* 2. 打印三个级别的日志
* 3. 开启调试模式
*/
public final class SpecUtil {
/**
* @description SDK版本号
* @usage 可用于校对不同SDK版本或后续针对不同的SDK版本添加业务逻辑
*/
private static final String SDK_VERSION = "1.4.0";
public static String GetSDKVersion() {
return SDK_VERSION;
}
/**
* @description 正确的包名SDK必须存放在"com.tencent.wework"下,否则会影响本地方法的调用
*/
private static final String EXPECTED_PACKAGE_NAME = "com.tencent.wework";
public static String GetExpectedPackageName() {
return EXPECTED_PACKAGE_NAME;
}
private static final String LINE_SEPERATOR = System.getProperty("line.separator");
public static void WWSpecLogInfo(String... args) {
SpecLog('I', args);
}
public static void WWSpecLogError(String... args) {
SpecLog('E', args);
}
public static void WWSpecLogDebug(String... args) {
SpecLog('D', args);
}
public static void WWSpecLogInfoWithReqId(String reqId, String... args) {
SpecLogWithReqId(reqId, 'I', args);
}
public static void WWSpecLogErrorWithReqId(String reqId, String... args) {
SpecLogWithReqId(reqId, 'E', args);
}
public static void WWSpecLogDebugWithReqId(String reqId, String... args) {
SpecLogWithReqId(reqId, 'D', args);
}
/**
* @usage 打印标准日志
* @note 只有使用SpecLog和SpecLogNative函数打印的日志能被调试平台查询其他框架的日志仅能本地查看
* @param logLevel 日志级别使用char传递目前支持I——INFO、E——ERROR、D——DEBUG
* @param args 自定义参数
*/
public static void SpecLog(char logLevel, String... args) {
StackTraceElement element = Thread.currentThread().getStackTrace()[3];
SpecLogNative(
logLevel,
element.getFileName(),
element.getLineNumber(),
String.join(",", args).replace(LINE_SEPERATOR, " ")
);
}
/**
* @usage 打印标准日志
* @note 只有使用SpecLog和SpecLogNative函数打印的日志能被调试平台查询其他框架的日志仅能本地查看
* @param reqid 请求id
* @param logLevel 日志级别使用char传递目前支持I——INFO、E——ERROR、D——DEBUG
* @param args 自定义参数
*/
public static void SpecLogWithReqId(String reqId, char logLevel, String... args) {
StackTraceElement element = Thread.currentThread().getStackTrace()[3];
SpecLogNativeWithReqId(
reqId,
logLevel,
element.getFileName(),
element.getLineNumber(),
String.join(",", args).replace(LINE_SEPERATOR, " ")
);
}
/**
* @usage 打印标准日志
* @note 只有使用SpecLog和SpecLogNative函数打印的日志能被调试平台查询其他框架的日志仅能本地查看
* 如需SLF4J风格的接口或对日志性能有进一步需求开发者可以自行封装该函数
* @param logLevel 日志级别使用char传递目前支持I——INFO、E——ERROR、D——DEBUG
* @param fileName 文件名(类名)
* @param lineNumber 行号
* @param argsString 自定义参数
*/
public static native void SpecLogNative(char logLevel, String fileName, int lineNumber, String argsString);
/**
* @usage 打印标准日志
* @note 只有使用SpecLog和SpecLogNative函数打印的日志能被调试平台查询其他框架的日志仅能本地查看
* 如需SLF4J风格的接口或对日志性能有进一步需求开发者可以自行封装该函数
* @param reqid 请求id
* @param logLevel 日志级别使用char传递目前支持I——INFO、E——ERROR、D——DEBUG
* @param fileName 文件名(类名)
* @param lineNumber 行号
* @param argsString 自定义参数
*/
public static native void SpecLogNativeWithReqId(String reqId, char logLevel, String fileName, int lineNumber, String argsString);
/**
* @usage 开启调试模式,进程级别开关
* @param debugToken 调试凭证,在管理端获取
* @param accessToken 应用access token
* @return 是否开启成功
*/
public static boolean SpecOpenDebugMode(String debugToken, String accessToken) {
return SpecOpenDebugModeNative(debugToken, accessToken);
}
private static native boolean SpecOpenDebugModeNative(String debugToken, String accessToken);
/**
* @usage 生成notify id。用户可调用本接口生成notify id也可完全自定义生成
* @return 新的notify id支持纳秒级隔离内部异常时会输出日志并返回空串
* @note 1. 用户可先生成notify id将其与回调数据关联存储后再使用该notify id通知应用
* 从而保证回调数据被请求时已存储完毕
*/
public static String GenerateNotifyId() {
return GenerateNotifyIdNative();
}
private static native String GenerateNotifyIdNative();
static {
// 检查包名
String packageName = SpecUtil.class.getPackage().getName();
if (!EXPECTED_PACKAGE_NAME.equals(packageName)) {
// 静态代码块内还无法调用native日志函数这里的日志在管理系统无法查询
System.out.println("SpecUtil class must be in package com.tencent.wework");
System.exit(1);
}
// 加载so库
try {
System.loadLibrary("WeWorkSpecSDK");
} catch (UnsatisfiedLinkError e) {
System.out.println("libWeWorkSpecSDK.so not found in java.library.path");
e.printStackTrace();
System.exit(1);
} catch (Exception e) {
System.out.println("unexpected exception: " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
SpecUtil.WWSpecLogInfo("SDK init done", "packageName=" + packageName, "SDK_VERSION=" + SDK_VERSION);
}
}

View File

@@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,12V14H5V12H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3,15V17H5V15H3M14,15H20V19H14V15M3,18V20H5V18H3M6,18V20H8V18H6M9,18V20H11V18H9Z"/>
</vector>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"/>
</vector>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M22,6C22,4.9 21.1,4 20,4H4C2.9,4 2,4.9 2,6V18C2,19.1 2.9,20 4,20H20C21.1,20 22,19.1 22,18V6M20,6L12,11L4,6H20M20,18H4V8L12,13L20,8V18Z"/>
</vector>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M24,7H22V13H24V7M24,15H22V17H24V15M20,6C20,4.9 19.1,4 18,4H2C0.9,4 0,4.9 0,6V18C0,19.1 0.9,20 2,20H18C19.1,20 20,19.1 20,18V6M18,6L10,11L2,6H18M18,18H2V8L10,13L18,8V18Z"/>
</vector>

View File

@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1565dp"
android:height="1565dp"
android:viewportWidth="1565"
android:viewportHeight="1565">
<path
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="4.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M793.8 222.7C782.5 239.2 736.3 298.6 685.6 361.9 647 410.2 633.3 428.9 633.6 432.7 633.7 433.4 633.8 434.6 633.9 435.3 634.1 437.8 647.9 440.7 663.8 441.5 706.7 443.8 717 445.3 724.9 450.6 733.7 456.4 735.9 467.4 736 504.2 736 504.2 736 521.9 736 521.9 736 521.9 730.8 522.4 730.8 522.4 727.9 522.8 691.8 525.3 650.5 528 609.3 530.8 571.9 533.3 567.5 533.6 531.8 536 503.4 540.5 487.4 546 475 550.3 442.2 566.5 428.2 575.2 392.1 597.6 360.1 629.2 338 664.3 317 697.7 304.6 729.6 292.5 781 287.8 801 283.9 805.6 267.2 811 255.1 814.9 248.7 818.3 243.4 823.5 239.7 827.2 239.2 828.4 237.7 836.5 236.7 841.5 235.5 850 235 855.5 234.3 863.9 232.6 911.1 232.6 924.5 232.6 934.6 234.2 959.8 235 963 237.4 972 242.3 975.8 258.7 981.7 271.7 986.3 277.4 989.5 280.4 993.9 283.1 997.9 286.5 1008.7 287.4 1016.5 289.3 1031.7 293.3 1050.2 297.7 1064 306.4 1091.9 317.6 1107.7 330 1109.5 332.4 1109.9 334.7 1110.3 335 1110.5 335.3 1110.6 339.1 1111.1 343.5 1111.4 347.9 1111.8 353.8 1112.3 356.5 1112.5 370 1113.7 407.8 1115.8 430 1116.5 439.6 1116.8 453.4 1117.3 460.5 1117.5 467.7 1117.8 482.3 1118.2 493 1118.5 503.7 1118.8 520.8 1119.2 531 1119.5 587.8 1121.1 683 1122 794.5 1122 918.8 1122 996.1 1121 1075 1118.5 1083.5 1118.2 1098.6 1117.8 1108.5 1117.4 1118.4 1117.1 1129.4 1116.7 1133 1116.5 1136.6 1116.3 1144.7 1115.8 1151 1115.5 1183.3 1114 1207.5 1110.9 1221.5 1106.3 1235.3 1101.9 1244.8 1094.1 1249.9 1083.2 1253.5 1075.4 1253.7 1074.4 1259 1044 1266.4 1001.7 1269.1 993.5 1276.9 989.2 1278.9 988.1 1284.7 986.1 1289.9 984.6 1305.8 980.1 1313.3 975.5 1314.4 969.7 1316.2 959.5 1317.1 881.4 1315.7 859.5 1314 834.8 1313.1 831.4 1307 824.7 1301.2 818.3 1295 814.8 1283 811 1278 809.5 1272.4 807 1270.5 805.6 1264 800.6 1259.5 790.1 1252.5 763 1243.5 728.4 1235.9 706.8 1224.6 683.5 1202.3 637.7 1167.5 602.5 1111.8 569.1 1087.6 554.7 1054.4 542.7 1028.1 539 1024.1 538.4 1020.5 537.8 1020.1 537.6 1019.8 537.4 1016.4 536.9 1012.7 536.5 1009 536.2 1005.1 535.7 1004.2 535.5 999.7 534.7 988.4 533.6 973.5 532.5 969.7 532.2 964.5 531.8 962 531.5 959.5 531.2 940.4 530.1 919.5 529 851.7 525.4 836.1 523.7 829.5 519.4 821.2 514 825.2 495.6 837.6 481.8 843.8 474.9 844.2 474.3 856.8 448 862.6 436 868.9 425.2 879.9 408.7 888.2 396.2 895 385.5 895 385.1 895 384.6 889.7 383.3 883.3 382 851.1 375.9 812.7 367.8 806.9 365.9 792.4 361.2 790.7 358.7 790.2 342.5 789.7 326.8 792.4 303.4 800 258.5 802.1 246.1 803.3 220.9 801.9 219.6 801.7 219.4 800.5 218.9 799.3 218.6 797.4 218 796.5 218.7 793.8 222.7Z"/>
<path
android:fillColor="#FF62686C"
android:strokeColor="#FF62686C"
android:strokeWidth="4.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M570.4 704.1C553.5 706.1 539.7 713 532.9 722.7 523.5 736.3 519.9 764.2 519.6 826 519.5 859.4 519.7 860.6 530.1 872.9 543.4 888.6 560.4 900 574.1 902.1 586.7 904 601.5 898.9 615.7 887.5 632.5 874.1 633.5 868.9 632.7 793.6 632.2 742.5 631.6 736 627 725.2 620.5 710 596.2 700.9 570.4 704.1Z"/>
<path
android:fillColor="#FF62686C"
android:strokeColor="#FF62686C"
android:strokeWidth="4.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M949.2 705.5C935.1 708.7 927 716.8 922.6 732.4 918.4 746.7 917.8 757.3 917.3 816.5 917.1 847.8 917.3 874 917.7 874.6 919.2 876.7 945.3 892.3 955.5 897.1 973.4 905.5 983.5 905.4 978.9 896.8 977.1 893.4 979.1 892.6 985.9 893.9 993.6 895.4 997.8 894.3 1005.2 889.1 1010.9 885 1020.2 873.6 1023.8 866.5 1029.6 854.9 1031.1 841.6 1031.1 800.5 1031.1 750.1 1028.6 737.6 1014.9 720.4 1009.4 713.5 1004.6 709.8 996.9 706.8 992.2 704.9 989.1 704.6 973.5 704.4 960.6 704.1 953.7 704.5 949.2 705.5Z"/>
<path
android:fillColor="#FF62686C"
android:strokeColor="#FF62686C"
android:strokeWidth="4.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M717 988.7C671.1 990.4 640.9 994.2 635.6 998.8 631.5 1002.5 636.3 1017.5 643.6 1024 650.9 1030.3 661.7 1032.5 694 1034 721.9 1035.3 829.3 1035.3 857 1034 891.4 1032.4 901.4 1029.9 908.9 1021.3 914.5 1015 917.9 1003.4 915.2 999.4 910.4 992.1 856 987.9 772 988.2 745.9 988.3 721.1 988.5 717 988.7Z"/>
</vector>

View File

@@ -9,5 +9,5 @@
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/ic_iw"/>
android:drawable="@drawable/ic_launcher"/>
</layer-list>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:layout_width="24dp"
android:layout_height="24dp">
<item android:drawable="@drawable/ic_launcher_background"/>
<item
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/ic_launcher_foreground_disable"/>
</layer-list>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
</vector>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#FF808080"
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp"
android:gravity="center_horizontal">
<Button
android:id="@+id/btn_init_sdk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="初始化企业微信SDK"
android:layout_marginBottom="10dp"/>
<Button
android:id="@+id/btn_get_corp_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取企业基本信息"
android:layout_marginBottom="10dp"/>
<Button
android:id="@+id/btn_check_auth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="检查用户授权状态"/>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:padding="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="定额支付测试0.01元)"
android:textSize="20sp"/>
<ImageView
android:id="@+id/iv_qrcode"
android:layout_width="250dp"
android:layout_height="250dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/tv_order_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商户订单号:"
android:textSize="16sp"/>
<TextView
android:id="@+id/tv_pay_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="支付状态:未支付"
android:textSize="16sp"
android:textColor="@android:color/black"/>
<Button
android:id="@+id/btn_create_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="生成支付二维码"/>
</LinearLayout>

View File

@@ -9,7 +9,7 @@
android:id="@+id/toolbar_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_iw"
android:src="@drawable/ic_launcher"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"

View File

@@ -7,4 +7,7 @@
<item
android:id="@+id/item_settings"
android:title="Settings"/>
<item
android:id="@+id/item_wxpayactivity"
android:title="WXPayActivity"/>
</menu>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB