Compare commits
46 Commits
projects_k
...
5fc59f3305
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fc59f3305 | ||
|
|
b6ba73126f | ||
|
|
bdd8d1e2b6 | ||
|
|
138ca80e35 | ||
|
|
7a3b54b78b | ||
|
|
db804d1897 | ||
|
|
039c8fcd98 | ||
|
|
ae63d1ec0a | ||
|
|
9e9486b488 | ||
|
|
4b8967b253 | ||
|
|
b1059c3f46 | ||
|
|
f3d723fbee | ||
|
|
e3c30ea9a3 | ||
|
|
ab4cef21f0 | ||
| 2754a2ad7c | |||
| 8876896cbc | |||
| 28e6a8ee78 | |||
| 7d872fd14c | |||
| d6fab2133f | |||
| 45821b8daa | |||
| edd312a525 | |||
| aec680e36e | |||
| 1c6f7783e5 | |||
|
|
193011a80d | ||
|
|
eb3d8f4806 | ||
| aa1b701c8b | |||
| fc20bd56b4 | |||
| e92538850f | |||
| 81b7af0ec4 | |||
| e2b4bddb61 | |||
| cbca61ad84 | |||
| 28bc3a86e3 | |||
| 79f7f682b3 | |||
| 8fa09a9f99 | |||
| 555c5deef9 | |||
| 3707891e0b | |||
| 0c9c6c9fd4 | |||
| be3d042ade | |||
|
|
33dc49267e | ||
| e3166b639e | |||
| 3d26bbe090 | |||
| cd375cefc5 | |||
| 025c095bcd | |||
| c88a0a52a8 | |||
| dc4eeefa55 | |||
| c7d79e160b |
@@ -1,5 +1,5 @@
|
|||||||
#!/system/bin/sh
|
#!/system/bin/sh
|
||||||
## 合并其他项目分支的模块源码到projects_keeper分支。
|
## 合并其他项目分支的模块源码到projects-keeper分支。
|
||||||
|
|
||||||
# ====================== 0. 进入目标目录 ======================
|
# ====================== 0. 进入目标目录 ======================
|
||||||
TARGET_DIR="/sdcard/AppProjects/Projects_Keeper"
|
TARGET_DIR="/sdcard/AppProjects/Projects_Keeper"
|
||||||
@@ -36,7 +36,7 @@ fi
|
|||||||
|
|
||||||
# ====================== 3. Git 分支检查 ======================
|
# ====================== 3. Git 分支检查 ======================
|
||||||
CUR_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null)
|
CUR_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null)
|
||||||
TARGET_BRANCH="projects_keeper"
|
TARGET_BRANCH="projects-keeper"
|
||||||
|
|
||||||
if [ "$CUR_BRANCH" != "$TARGET_BRANCH" ]; then
|
if [ "$CUR_BRANCH" != "$TARGET_BRANCH" ]; then
|
||||||
echo "错误:当前不在 $TARGET_BRANCH 分支!"
|
echo "错误:当前不在 $TARGET_BRANCH 分支!"
|
||||||
@@ -72,6 +72,7 @@ libaes
|
|||||||
libappbase
|
libappbase
|
||||||
libdebugtemp
|
libdebugtemp
|
||||||
libgpsrelaysentinel
|
libgpsrelaysentinel
|
||||||
|
libwinboll
|
||||||
local.properties-demo
|
local.properties-demo
|
||||||
mymessagemanager
|
mymessagemanager
|
||||||
positions
|
positions
|
||||||
@@ -81,14 +82,13 @@ winboll
|
|||||||
winboll.properties-demo
|
winboll.properties-demo
|
||||||
)
|
)
|
||||||
|
|
||||||
# ====================== 5. 获取当前目录真实文件列表(兼容过滤 . ..) ======================
|
# ====================== 5. 获取当前目录真实文件列表 ======================
|
||||||
REAL_ITEMS=()
|
REAL_ITEMS=()
|
||||||
# 使用固定排序ls,自动过滤 . 和 ..,不会进入比对数组
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ "$line" != "." && "$line" != ".." ]]; then
|
if [[ "$line" != "." && "$line" != ".." ]]; then
|
||||||
REAL_ITEMS+=("$line")
|
REAL_ITEMS+=("$line")
|
||||||
fi
|
fi
|
||||||
done < <(LC_COLLATE=C ls -a1 --color=none)
|
done < <(ls -a)
|
||||||
|
|
||||||
# ====================== 6. 差异比对函数 ======================
|
# ====================== 6. 差异比对函数 ======================
|
||||||
check_diff() {
|
check_diff() {
|
||||||
@@ -158,7 +158,7 @@ echo -e "## 对象列表结束
|
|||||||
|
|
||||||
## 合并 APP 项目
|
## 合并 APP 项目
|
||||||
MERGE_APP_PROJECT_LIST=(
|
MERGE_APP_PROJECT_LIST=(
|
||||||
WinBoLL
|
DemoAPP
|
||||||
)
|
)
|
||||||
echo -e "#@@@ 开始合并应用型模块源码 @@@#
|
echo -e "#@@@ 开始合并应用型模块源码 @@@#
|
||||||
## 目标合并对象列表:"
|
## 目标合并对象列表:"
|
||||||
@@ -173,6 +173,7 @@ done
|
|||||||
|
|
||||||
## 合并 LIB 项目
|
## 合并 LIB 项目
|
||||||
MERGE_LIB_PROJECT_LIST=(
|
MERGE_LIB_PROJECT_LIST=(
|
||||||
|
WinBoLL
|
||||||
APPBase
|
APPBase
|
||||||
AES
|
AES
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if [ "${NOW_BRANCH}" != "${TARGET_BRANCH}" ];then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 目录结构校验白名单(不含 . ..)
|
# 目录结构校验
|
||||||
MERGE_OBJECTS_LIST=(
|
MERGE_OBJECTS_LIST=(
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
@@ -65,6 +65,7 @@ libaes
|
|||||||
libappbase
|
libappbase
|
||||||
libdebugtemp
|
libdebugtemp
|
||||||
libgpsrelaysentinel
|
libgpsrelaysentinel
|
||||||
|
libwinboll
|
||||||
local.properties-demo
|
local.properties-demo
|
||||||
mymessagemanager
|
mymessagemanager
|
||||||
positions
|
positions
|
||||||
@@ -75,13 +76,9 @@ winboll.properties-demo
|
|||||||
)
|
)
|
||||||
|
|
||||||
REAL_ITEMS=()
|
REAL_ITEMS=()
|
||||||
# 标准排序ls输出,循环强制过滤 . 和 ..
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
# 跳过虚拟目录 . 和 ..
|
[[ $line != "." && $line != ".." ]] && REAL_ITEMS+=("$line")
|
||||||
if [[ "$line" != "." && "$line" != ".." ]]; then
|
done < <(ls -a)
|
||||||
REAL_ITEMS+=("$line")
|
|
||||||
fi
|
|
||||||
done < <(LC_COLLATE=C ls -a1 --color=none)
|
|
||||||
|
|
||||||
check_diff(){
|
check_diff(){
|
||||||
local miss=() extra=()
|
local miss=() extra=()
|
||||||
@@ -92,17 +89,7 @@ check_diff(){
|
|||||||
[[ ! " ${MERGE_OBJECTS_LIST[@]} " =~ " ${i} " ]] && extra+=("$i")
|
[[ ! " ${MERGE_OBJECTS_LIST[@]} " =~ " ${i} " ]] && extra+=("$i")
|
||||||
done
|
done
|
||||||
if [[ ${#miss[@]} -gt 0 || ${#extra[@]} -gt 0 ]];then
|
if [[ ${#miss[@]} -gt 0 || ${#extra[@]} -gt 0 ]];then
|
||||||
echo "========================================"
|
|
||||||
echo "本地目录结构不一致,终止运行"
|
echo "本地目录结构不一致,终止运行"
|
||||||
if [[ ${#miss[@]} -gt 0 ]]; then
|
|
||||||
echo -e "\n缺失条目:"
|
|
||||||
for m in "${miss[@]}"; do echo " $m"; done
|
|
||||||
fi
|
|
||||||
if [[ ${#extra[@]} -gt 0 ]]; then
|
|
||||||
echo -e "\n多余条目:"
|
|
||||||
for e in "${extra[@]}"; do echo " $e"; done
|
|
||||||
fi
|
|
||||||
echo "========================================"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -111,7 +98,7 @@ check_diff
|
|||||||
echo -e "#@@@ 按时间获取最新标签合并模块源码 @@@#"
|
echo -e "#@@@ 按时间获取最新标签合并模块源码 @@@#"
|
||||||
|
|
||||||
# 应用型模块
|
# 应用型模块
|
||||||
MERGE_APP_PROJECT_LIST=(WinBoLL)
|
MERGE_APP_PROJECT_LIST=(DemoAPP)
|
||||||
echo -e "---------- 应用型模块 ----------"
|
echo -e "---------- 应用型模块 ----------"
|
||||||
for name in "${MERGE_APP_PROJECT_LIST[@]}";do
|
for name in "${MERGE_APP_PROJECT_LIST[@]}";do
|
||||||
low_name=$(echo "$name" | tr 'A-Z' 'a-z')
|
low_name=$(echo "$name" | tr 'A-Z' 'a-z')
|
||||||
@@ -133,7 +120,7 @@ for name in "${MERGE_APP_PROJECT_LIST[@]}";do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# 类库模块
|
# 类库模块
|
||||||
MERGE_LIB_PROJECT_LIST=(APPBase AES)
|
MERGE_LIB_PROJECT_LIST=(WinBoLL APPBase AES)
|
||||||
echo -e "---------- 类库模块 ----------"
|
echo -e "---------- 类库模块 ----------"
|
||||||
for name in "${MERGE_LIB_PROJECT_LIST[@]}";do
|
for name in "${MERGE_LIB_PROJECT_LIST[@]}";do
|
||||||
low_name=$(echo "$name" | tr 'A-Z' 'a-z')
|
low_name=$(echo "$name" | tr 'A-Z' 'a-z')
|
||||||
|
|||||||
@@ -1,228 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
# ==============================================================================
|
|
||||||
# WinBoLL 应用发布脚本
|
|
||||||
# 功能:检查Git源码状态 → 编译Stage Release包 → 添加WinBoLL标签 → 提交并推送源码
|
|
||||||
# 依赖:build.properties、app_update_description.txt(项目根目录下)
|
|
||||||
# 使用:./script_name.sh <APP_NAME>
|
|
||||||
# 作者:豆包&ZhanGSKen<zhangsken@qq.com>
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# ==================== 常量定义 ====================
|
|
||||||
# 脚本退出码
|
|
||||||
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"
|
|
||||||
|
|
||||||
# aapt2本地覆盖参数
|
|
||||||
AAPT2_OVERRIDE_ARG="-Pandroid.aapt2FromMavenOverride=/data/data/com.termux/files/usr/bin/aapt2"
|
|
||||||
# 禁用Gradle守护进程
|
|
||||||
GRADLE_NO_DAEMON="--no-daemon"
|
|
||||||
|
|
||||||
# ==================== 函数定义 ====================
|
|
||||||
# 检查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 "[ERROR] 未指定应用名称!使用方式:${0} <APP_NAME>"
|
|
||||||
exit ${EXIT_CODE_ERR_NO_APP_NAME}
|
|
||||||
fi
|
|
||||||
APP_NAME=$1
|
|
||||||
echo "[INFO] 待发布应用名称:${APP_NAME}"
|
|
||||||
|
|
||||||
# 2. 检查并切换到项目根目录(确保build.properties存在)
|
|
||||||
echo "[INFO] 当前工作目录:$(pwd)"
|
|
||||||
if [[ ! -e "${APP_NAME}/build.properties" ]]; then
|
|
||||||
echo "[WARNING] 当前目录不存在${APP_NAME}/build.properties,尝试切换到上级目录..."
|
|
||||||
cd ..
|
|
||||||
echo "[INFO] 切换后工作目录:$(pwd)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 验证最终工作目录是否正确
|
|
||||||
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(携带aapt2覆盖参数 + --no-daemon)
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo " 步骤2:编译Stage Release APK"
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo "[INFO] 开始执行Gradle任务:${GRADLE_TASK_PUBLISH}"
|
|
||||||
# 调试用(注释正式任务,启用调试任务)
|
|
||||||
# bash gradlew ${AAPT2_OVERRIDE_ARG} ${GRADLE_NO_DAEMON} :${APP_NAME}:${GRADLE_TASK_DEBUG}
|
|
||||||
bash gradlew ${AAPT2_OVERRIDE_ARG} ${GRADLE_NO_DAEMON} :${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 "[ERROR] 源码与标签推送失败!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ==================== 主流程结束 ====================
|
|
||||||
echo "============================================="
|
|
||||||
echo " WinBoLL 应用发布完成!"
|
|
||||||
echo "============================================="
|
|
||||||
exit ${EXIT_CODE_SUCCESS}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
# aapt2本地覆盖参数
|
|
||||||
AAPT2_OVERRIDE_ARG="-Pandroid.aapt2FromMavenOverride=/data/data/com.termux/files/usr/bin/aapt2"
|
|
||||||
# Gradle禁用守护进程参数
|
|
||||||
GRADLE_NO_DAEMON="--no-daemon"
|
|
||||||
|
|
||||||
# 检查是否指定了将要发布的类库名称
|
|
||||||
# 使用 `-z` 命令检查变量是否为空
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "No Library name specified : $0"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
## 正式发布使用
|
|
||||||
git pull && bash gradlew ${AAPT2_OVERRIDE_ARG} ${GRADLE_NO_DAEMON} :$1:publishReleasePublicationToWinBoLLReleaseRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1
|
|
||||||
|
|
||||||
## 调试使用
|
|
||||||
#bash gradlew ${AAPT2_OVERRIDE_ARG} ${GRADLE_NO_DAEMON} :$1:publishSnapshotWinBoLLPublicationToWinBoLLSnapshotRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1
|
|
||||||
|
|
||||||
@@ -122,6 +122,7 @@ android {
|
|||||||
// 如果正在调试,就拷贝到 WinBoLL 备份管理文件夹
|
// 如果正在调试,就拷贝到 WinBoLL 备份管理文件夹
|
||||||
//
|
//
|
||||||
if(variant.flavorName == "beta"&&variant.buildType.name == "debug"){
|
if(variant.flavorName == "beta"&&variant.buildType.name == "debug"){
|
||||||
|
//File outBuildBckDir = new File(fWinBoLLStudioDir, "/${rootProject.name}/${variant.buildType.name}")
|
||||||
File outBuildBckDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}")
|
File outBuildBckDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}")
|
||||||
// 创建目标路径目录
|
// 创建目标路径目录
|
||||||
if(!outBuildBckDir.exists()) {
|
if(!outBuildBckDir.exists()) {
|
||||||
@@ -129,7 +130,6 @@ android {
|
|||||||
println "Output Folder Created.(WinBoLLStudio) : " + outBuildBckDir.getAbsolutePath()
|
println "Output Folder Created.(WinBoLLStudio) : " + outBuildBckDir.getAbsolutePath()
|
||||||
}
|
}
|
||||||
if(outBuildBckDir.exists()) {
|
if(outBuildBckDir.exists()) {
|
||||||
def targetApkFile = new File(outBuildBckDir, outputFileName)
|
|
||||||
copy{
|
copy{
|
||||||
from file.outputFile
|
from file.outputFile
|
||||||
into outBuildBckDir
|
into outBuildBckDir
|
||||||
@@ -138,14 +138,6 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (WinBoLLStudio): " + outBuildBckDir.getAbsolutePath() + "/${outputFileName}"
|
println "Output APK (WinBoLLStudio): " + outBuildBckDir.getAbsolutePath() + "/${outputFileName}"
|
||||||
}
|
}
|
||||||
// ========== 设置文件权限为775 ==========
|
|
||||||
if(targetApkFile.exists()){
|
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', targetApkFile.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${targetApkFile.absolutePath}"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查编译标志位配置
|
// 检查编译标志位配置
|
||||||
assert (winbollBuildProps['buildCount'] != null)
|
assert (winbollBuildProps['buildCount'] != null)
|
||||||
assert (winbollBuildProps['libraryProject'] != null)
|
assert (winbollBuildProps['libraryProject'] != null)
|
||||||
@@ -168,6 +160,7 @@ android {
|
|||||||
assert(libraryProjectBuildPropsFile.exists())
|
assert(libraryProjectBuildPropsFile.exists())
|
||||||
java.nio.file.Path sourceFilePath = winbollBuildPropsFile.toPath();
|
java.nio.file.Path sourceFilePath = winbollBuildPropsFile.toPath();
|
||||||
java.nio.file.Path targetFilePath = libraryProjectBuildPropsFile.toPath();
|
java.nio.file.Path targetFilePath = libraryProjectBuildPropsFile.toPath();
|
||||||
|
// 使用copyTo()方法复制文件,如果目标文件存在会被覆盖,可选参数可以选择不覆盖
|
||||||
java.nio.file.Files.copy(sourceFilePath, targetFilePath, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
java.nio.file.Files.copy(sourceFilePath, targetFilePath, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
|
||||||
println "\n\n>>> Library Project build.properties saved.\n\n";
|
println "\n\n>>> Library Project build.properties saved.\n\n";
|
||||||
@@ -179,12 +172,16 @@ android {
|
|||||||
//
|
//
|
||||||
if(variant.flavorName == "stage"&&variant.buildType.name == "release"){
|
if(variant.flavorName == "stage"&&variant.buildType.name == "release"){
|
||||||
// 发布 APK 文件
|
// 发布 APK 文件
|
||||||
|
//
|
||||||
|
// 截取版本号的版本字段为短版本名
|
||||||
String szVersionName = "${versionName}"
|
String szVersionName = "${versionName}"
|
||||||
String[] szlistTemp = szVersionName.split("-")
|
String[] szlistTemp = szVersionName.split("-")
|
||||||
String szShortVersionName = szlistTemp[0]
|
String szShortVersionName = szlistTemp[0]
|
||||||
|
//String szCommonTagAPKName = "${rootProject.name}_" + szShortVersionName + ".apk"
|
||||||
String szCommonTagAPKName = project.rootDir.name + "_" + szShortVersionName + ".apk"
|
String szCommonTagAPKName = project.rootDir.name + "_" + szShortVersionName + ".apk"
|
||||||
println "CommonTagAPKName is : " + szCommonTagAPKName
|
println "CommonTagAPKName is : " + szCommonTagAPKName
|
||||||
|
|
||||||
|
//File outTagDir = new File(fWinBoLLStudioDir, "/${rootProject.name}/tag/")
|
||||||
File outTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/tag/")
|
File outTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/tag/")
|
||||||
// 创建目标路径目录
|
// 创建目标路径目录
|
||||||
if(!outTagDir.exists()) {
|
if(!outTagDir.exists()) {
|
||||||
@@ -195,10 +192,12 @@ android {
|
|||||||
if(outTagDir.exists()) {
|
if(outTagDir.exists()) {
|
||||||
File targetAPK = new File(outTagDir, "${szCommonTagAPKName}")
|
File targetAPK = new File(outTagDir, "${szCommonTagAPKName}")
|
||||||
if(targetAPK.exists()) {
|
if(targetAPK.exists()) {
|
||||||
|
// 标签版本APK文件已经存在,构建拷贝任务停止
|
||||||
assert (!targetAPK.exists())
|
assert (!targetAPK.exists())
|
||||||
|
// 可选择删除并继续输出APK文件
|
||||||
|
//delete targetAPK
|
||||||
}
|
}
|
||||||
// 复制完整版APK
|
// 复制一个备份
|
||||||
def fullApkFile = new File(outTagDir, outputFileName)
|
|
||||||
copy{
|
copy{
|
||||||
from file.outputFile
|
from file.outputFile
|
||||||
into outTagDir
|
into outTagDir
|
||||||
@@ -207,16 +206,7 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${outputFileName}"
|
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${outputFileName}"
|
||||||
}
|
}
|
||||||
// 设置权限775。
|
// 复制一个并重命名为短版本名
|
||||||
if(fullApkFile.exists()){
|
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', fullApkFile.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${fullApkFile.absolutePath}"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 复制短版本名APK
|
|
||||||
def shortApkFile = new File(outTagDir, szCommonTagAPKName)
|
|
||||||
copy{
|
copy{
|
||||||
from file.outputFile
|
from file.outputFile
|
||||||
into outTagDir
|
into outTagDir
|
||||||
@@ -225,14 +215,6 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${szCommonTagAPKName}"
|
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${szCommonTagAPKName}"
|
||||||
}
|
}
|
||||||
// 设置权限775。
|
|
||||||
if(shortApkFile.exists()){
|
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', shortApkFile.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${shortApkFile.absolutePath}"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查编译标志位配置
|
// 检查编译标志位配置
|
||||||
assert (winbollBuildProps['stageCount'] != null)
|
assert (winbollBuildProps['stageCount'] != null)
|
||||||
assert (winbollBuildProps['publishVersion'] != null)
|
assert (winbollBuildProps['publishVersion'] != null)
|
||||||
@@ -257,11 +239,14 @@ android {
|
|||||||
fos.close();
|
fos.close();
|
||||||
|
|
||||||
if(winbollBuildProps['libraryProject'] != "") {
|
if(winbollBuildProps['libraryProject'] != "") {
|
||||||
|
// 如果应用 build.properties 文件设置了类库模块项目文件名
|
||||||
|
// 就拷贝一份新的编译标志配置到类库项目文件夹
|
||||||
File libraryProjectBuildPropsFile = new File("$RootProjectDir/" + winbollBuildProps['libraryProject'] + "/build.properties")
|
File libraryProjectBuildPropsFile = new File("$RootProjectDir/" + winbollBuildProps['libraryProject'] + "/build.properties")
|
||||||
assert(winbollBuildPropsFile.exists())
|
assert(winbollBuildPropsFile.exists())
|
||||||
assert(libraryProjectBuildPropsFile.exists())
|
assert(libraryProjectBuildPropsFile.exists())
|
||||||
java.nio.file.Path sourceFilePath = winbollBuildPropsFile.toPath();
|
java.nio.file.Path sourceFilePath = winbollBuildPropsFile.toPath();
|
||||||
java.nio.file.Path targetFilePath = libraryProjectBuildPropsFile.toPath();
|
java.nio.file.Path targetFilePath = libraryProjectBuildPropsFile.toPath();
|
||||||
|
// 使用copyTo()方法复制文件,如果目标文件存在会被覆盖,可选参数可以选择不覆盖
|
||||||
java.nio.file.Files.copy(sourceFilePath, targetFilePath, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
java.nio.file.Files.copy(sourceFilePath, targetFilePath, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,12 +263,17 @@ android {
|
|||||||
// 如果正在调试发布版,就只生成和输出APK文件,不处理 Git 仓库提交与更新问题。
|
// 如果正在调试发布版,就只生成和输出APK文件,不处理 Git 仓库提交与更新问题。
|
||||||
//
|
//
|
||||||
if(variant.flavorName == "stage"&&variant.buildType.name == "debug"){
|
if(variant.flavorName == "stage"&&variant.buildType.name == "debug"){
|
||||||
|
// 发布 APK 文件
|
||||||
|
//
|
||||||
|
// 截取版本号的版本字段为短版本名
|
||||||
String szVersionName = "${versionName}"
|
String szVersionName = "${versionName}"
|
||||||
String[] szlistTemp = szVersionName.split("-")
|
String[] szlistTemp = szVersionName.split("-")
|
||||||
String szShortVersionName = szlistTemp[0]
|
String szShortVersionName = szlistTemp[0]
|
||||||
|
//String szCommonTagAPKName = "${rootProject.name}_" + szShortVersionName + ".apk"
|
||||||
String szCommonTagAPKName = project.rootDir.name + "_" + szShortVersionName + ".apk"
|
String szCommonTagAPKName = project.rootDir.name + "_" + szShortVersionName + ".apk"
|
||||||
println "CommonTagAPKName is : " + szCommonTagAPKName
|
println "CommonTagAPKName is : " + szCommonTagAPKName
|
||||||
|
|
||||||
|
//File outTagDir = new File(fWinBoLLStudioDir, "/${rootProject.name}/tag/")
|
||||||
File outTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}/")
|
File outTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}/")
|
||||||
// 创建目标路径目录
|
// 创建目标路径目录
|
||||||
if(!outTagDir.exists()) {
|
if(!outTagDir.exists()) {
|
||||||
@@ -294,11 +284,13 @@ android {
|
|||||||
if(outTagDir.exists()) {
|
if(outTagDir.exists()) {
|
||||||
File targetAPK = new File(outTagDir, "${szCommonTagAPKName}")
|
File targetAPK = new File(outTagDir, "${szCommonTagAPKName}")
|
||||||
if(targetAPK.exists()) {
|
if(targetAPK.exists()) {
|
||||||
|
// 标签版本APK文件已经存在,构建拷贝任务停止
|
||||||
println '如果是在调试 Stage 版应用包构建,请删除(注:在debug目录)现有的 Stage 应用包('+targetAPK.getAbsolutePath()+')。再编译一次。'
|
println '如果是在调试 Stage 版应用包构建,请删除(注:在debug目录)现有的 Stage 应用包('+targetAPK.getAbsolutePath()+')。再编译一次。'
|
||||||
assert (!targetAPK.exists())
|
assert (!targetAPK.exists())
|
||||||
|
// 可选择删除并继续输出APK文件
|
||||||
|
//delete targetAPK
|
||||||
}
|
}
|
||||||
// 复制完整版APK
|
// 复制一个备份
|
||||||
def debugFullApk = new File(outTagDir, outputFileName)
|
|
||||||
copy{
|
copy{
|
||||||
from file.outputFile
|
from file.outputFile
|
||||||
into outTagDir
|
into outTagDir
|
||||||
@@ -307,16 +299,7 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${outputFileName}"
|
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${outputFileName}"
|
||||||
}
|
}
|
||||||
// 权限设为775。
|
// 复制一个并重命名为短版本名
|
||||||
if(debugFullApk.exists()){
|
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', debugFullApk.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${debugFullApk.absolutePath}"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 复制短版本名APK
|
|
||||||
def debugShortApk = new File(outTagDir, szCommonTagAPKName)
|
|
||||||
copy{
|
copy{
|
||||||
from file.outputFile
|
from file.outputFile
|
||||||
into outTagDir
|
into outTagDir
|
||||||
@@ -325,13 +308,8 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${szCommonTagAPKName}"
|
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${szCommonTagAPKName}"
|
||||||
}
|
}
|
||||||
// 权限设为775
|
|
||||||
if(debugShortApk.exists()){
|
//不保存编译标志配置
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', debugShortApk.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${debugShortApk.absolutePath}"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,13 +328,6 @@ android {
|
|||||||
}
|
}
|
||||||
println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}"
|
println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}"
|
||||||
}
|
}
|
||||||
// 额外输出文件设置775权限
|
|
||||||
if(apkFile.exists()){
|
|
||||||
exec {
|
|
||||||
commandLine 'chmod', '775', apkFile.absolutePath
|
|
||||||
}
|
|
||||||
println "Set file permission to 775 : ${apkFile.absolutePath}"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 米盟 SDK
|
||||||
|
packagingOptions {
|
||||||
|
doNotStrip "*/*/libmimo_1011.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Jun 29 11:29:30 HKT 2026
|
#Wed Jun 03 07:07:27 HKT 2026
|
||||||
stageCount=18
|
stageCount=15
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.20
|
baseVersion=15.20
|
||||||
publishVersion=15.20.17
|
publishVersion=15.20.14
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.20.18
|
baseBetaVersion=15.20.15
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class AboutActivity extends BaseWinBoLLActivity {
|
|||||||
appInfo.setAppName(getString(R.string.app_name));
|
appInfo.setAppName(getString(R.string.app_name));
|
||||||
appInfo.setAppIcon(R.drawable.ic_winboll);
|
appInfo.setAppIcon(R.drawable.ic_winboll);
|
||||||
appInfo.setAppDescription(getString(R.string.app_description));
|
appInfo.setAppDescription(getString(R.string.app_description));
|
||||||
appInfo.setAppGitName("WinBoLL");
|
appInfo.setAppGitName("AES");
|
||||||
appInfo.setAppGitOwner("Studio");
|
appInfo.setAppGitOwner("Studio");
|
||||||
appInfo.setAppGitAPPBranch(branchName);
|
appInfo.setAppGitAPPBranch(branchName);
|
||||||
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package cc.winboll.studio.aes;
|
|||||||
*/
|
*/
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||||
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
||||||
import cc.winboll.studio.libappbase.CrashActivity;
|
import cc.winboll.studio.libappbase.CrashHandler;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.ToastUtils;
|
import cc.winboll.studio.libappbase.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
||||||
@@ -36,7 +36,7 @@ public class App extends GlobalApplication {
|
|||||||
this,
|
this,
|
||||||
getPackageName(),
|
getPackageName(),
|
||||||
stackTraceStr,
|
stackTraceStr,
|
||||||
CrashActivity.class
|
CrashHandler.CrashActivity.class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package cc.winboll.studio.aes;
|
package cc.winboll.studio.aes;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import cc.winboll.studio.libaes.views.ADsControlView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
|
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
|
||||||
@@ -16,7 +20,7 @@ public class SettingsActivity extends Activity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_settings);
|
setContentView(R.layout.activity_settings);
|
||||||
//ADsControlView adsControlView = (ADsControlView) findViewById(R.id.ads_control_view);
|
ADsControlView adsControlView = (ADsControlView) findViewById(R.id.ads_control_view);
|
||||||
|
|
||||||
// adsControlView.setOnAdsModeSelectedListener(new ADsControlView.OnAdsModeSelectedListener() {
|
// adsControlView.setOnAdsModeSelectedListener(new ADsControlView.OnAdsModeSelectedListener() {
|
||||||
// @Override
|
// @Override
|
||||||
|
|||||||
@@ -6,5 +6,12 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
android:layout_height="match_parent" android:background="@drawable/bg_container_border">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.ADsControlView
|
||||||
|
android:id="@+id/ads_control_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_frame"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sun Jun 28 20:55:57 HKT 2026
|
#Wed Jun 03 06:52:38 HKT 2026
|
||||||
stageCount=35
|
stageCount=26
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.20
|
baseVersion=15.20
|
||||||
publishVersion=15.20.34
|
publishVersion=15.20.25
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.20.35
|
baseBetaVersion=15.20.26
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class AboutActivity extends Activity {
|
|||||||
appInfo.setAppName("APPBase");
|
appInfo.setAppName("APPBase");
|
||||||
appInfo.setAppIcon(R.drawable.ic_winboll);
|
appInfo.setAppIcon(R.drawable.ic_winboll);
|
||||||
appInfo.setAppDescription(getString(R.string.app_description));
|
appInfo.setAppDescription(getString(R.string.app_description));
|
||||||
appInfo.setAppGitName("WinBoLL");
|
appInfo.setAppGitName("APPBase");
|
||||||
appInfo.setAppGitOwner("Studio");
|
appInfo.setAppGitOwner("Studio");
|
||||||
appInfo.setAppGitAPPBranch(branchName);
|
appInfo.setAppGitAPPBranch(branchName);
|
||||||
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
appInfo.setAppGitAPPSubProjectFolder(branchName);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package cc.winboll.studio.appbase;
|
package cc.winboll.studio.appbase;
|
||||||
|
|
||||||
import cc.winboll.studio.libappbase.CrashActivity;
|
import cc.winboll.studio.libappbase.CrashHandler;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.ToastUtils;
|
import cc.winboll.studio.libappbase.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
||||||
@@ -39,7 +39,7 @@ public class App extends GlobalApplication {
|
|||||||
this,
|
this,
|
||||||
getPackageName(),
|
getPackageName(),
|
||||||
stackTraceStr,
|
stackTraceStr,
|
||||||
CrashActivity.class
|
CrashHandler.CrashActivity.class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,15 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 米盟 SDK
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
targetCompatibility JavaVersion.VERSION_1_7
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
doNotStrip "*/*/libmimo_1011.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -53,7 +57,7 @@ dependencies {
|
|||||||
//api 'androidx.fragment:fragment:1.1.0'
|
//api 'androidx.fragment:fragment:1.1.0'
|
||||||
|
|
||||||
// 米盟
|
// 米盟
|
||||||
//api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
||||||
//注意:以下5个库必须要引入
|
//注意:以下5个库必须要引入
|
||||||
//implementation 'androidx.appcompat:appcompat:1.4.1'
|
//implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
api 'androidx.recyclerview:recyclerview:1.0.0'
|
api 'androidx.recyclerview:recyclerview:1.0.0'
|
||||||
@@ -62,9 +66,9 @@ dependencies {
|
|||||||
//annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
|
//annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
|
||||||
|
|
||||||
// WinBoLL库 nexus.winboll.cc 地址
|
// WinBoLL库 nexus.winboll.cc 地址
|
||||||
api 'cc.winboll.studio:libappbase:15.20.34'
|
api 'cc.winboll.studio:libappbase:15.20.25'
|
||||||
// 备用库 jitpack.io 地址
|
// 备用库 jitpack.io 地址
|
||||||
//api 'com.github.ZhanGSKen:libappbase:appbase-v15.20.33'
|
//api 'com.github.ZhanGSKen:libappbase:appbase-v15.20.25'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Jun 29 11:28:11 HKT 2026
|
#Wed Jun 03 07:07:27 HKT 2026
|
||||||
stageCount=18
|
stageCount=15
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.20
|
baseVersion=15.20
|
||||||
publishVersion=15.20.17
|
publishVersion=15.20.14
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.20.18
|
baseBetaVersion=15.20.15
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.view.MenuInflater;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
@@ -22,9 +23,9 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import cc.winboll.studio.libaes.DrawerMenuDataAdapter;
|
import cc.winboll.studio.libaes.DrawerMenuDataAdapter;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
|
||||||
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
|
||||||
import cc.winboll.studio.libaes.models.AESThemeBean;
|
import cc.winboll.studio.libaes.models.AESThemeBean;
|
||||||
import cc.winboll.studio.libaes.models.DrawerMenuBean;
|
import cc.winboll.studio.libaes.models.DrawerMenuBean;
|
||||||
@@ -32,9 +33,11 @@ import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
|||||||
import cc.winboll.studio.libaes.utils.DevelopUtils;
|
import cc.winboll.studio.libaes.utils.DevelopUtils;
|
||||||
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
||||||
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
||||||
|
import cc.winboll.studio.libaes.views.ADsBannerView;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import com.baoyz.widget.PullRefreshLayout;
|
import com.baoyz.widget.PullRefreshLayout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public abstract class DrawerFragmentActivity extends AppCompatActivity implements IWinBoLLActivity, AdapterView.OnItemClickListener {
|
public abstract class DrawerFragmentActivity extends AppCompatActivity implements IWinBoLLActivity, AdapterView.OnItemClickListener {
|
||||||
@@ -88,10 +91,10 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
WinBoLLActivityManager.getInstance().registeRemove(this);
|
WinBoLLActivityManager.getInstance().registeRemove(this);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
// 修复:释放广告资源,避免内存泄漏
|
// 修复:释放广告资源,避免内存泄漏
|
||||||
// ADsBannerView adsBannerView = findViewById(R.id.adsbanner);
|
ADsBannerView adsBannerView = findViewById(R.id.adsbanner);
|
||||||
// if (adsBannerView != null) {
|
if (adsBannerView != null) {
|
||||||
// adsBannerView.releaseAdResources();
|
adsBannerView.releaseAdResources();
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -148,10 +151,10 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
// ADsBannerView adsBannerView = findViewById(R.id.adsbanner);
|
ADsBannerView adsBannerView = findViewById(R.id.adsbanner);
|
||||||
// if (adsBannerView != null) {
|
if (adsBannerView != null) {
|
||||||
// adsBannerView.resumeADs(DrawerFragmentActivity.this);
|
adsBannerView.resumeADs(DrawerFragmentActivity.this);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initRootView() {
|
void initRootView() {
|
||||||
|
|||||||
@@ -56,5 +56,10 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.ADsBannerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/adsbanner"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sun Jun 28 20:55:33 HKT 2026
|
#Wed Jun 03 06:52:38 HKT 2026
|
||||||
stageCount=35
|
stageCount=26
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.20
|
baseVersion=15.20
|
||||||
publishVersion=15.20.34
|
publishVersion=15.20.25
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.20.35
|
baseBetaVersion=15.20.26
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
android:networkSecurityConfig="@xml/network_security_config">
|
android:networkSecurityConfig="@xml/network_security_config">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".CrashActivity"
|
android:name=".CrashHandler$CrashActivity"
|
||||||
android:label="CrashActivity"
|
android:label="CrashActivity"
|
||||||
android:launchMode="singleInstance"
|
android:launchMode="singleInstance"
|
||||||
android:process=":CrashActivity"/>
|
android:process=":CrashActivity"/>
|
||||||
|
|||||||
@@ -1,109 +0,0 @@
|
|||||||
package cc.winboll.studio.libappbase;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ClipData;
|
|
||||||
import android.content.ClipboardManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.HorizontalScrollView;
|
|
||||||
import android.widget.ScrollView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public final class CrashActivity extends Activity implements MenuItem.OnMenuItemClickListener {
|
|
||||||
private static final int MENUITEM_COPY = 0;
|
|
||||||
private static final int MENUITEM_RESTART = 1;
|
|
||||||
|
|
||||||
private String mLog;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(final Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
|
|
||||||
mLog = getIntent().getStringExtra(CrashHandler.EXTRA_CRASH_LOG);
|
|
||||||
setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
|
|
||||||
initLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initLayout() {
|
|
||||||
ScrollView contentView = new ScrollView(this);
|
|
||||||
contentView.setFillViewport(true);
|
|
||||||
|
|
||||||
HorizontalScrollView hw = new HorizontalScrollView(this);
|
|
||||||
hw.setBackgroundColor(0xFFF5F5F5);
|
|
||||||
|
|
||||||
TextView message = new TextView(this);
|
|
||||||
final int padding = dp2px(16);
|
|
||||||
message.setPadding(padding, padding, padding, padding);
|
|
||||||
message.setText(mLog);
|
|
||||||
message.setTextColor(0xFF000000);
|
|
||||||
message.setTextIsSelectable(true);
|
|
||||||
|
|
||||||
hw.addView(message);
|
|
||||||
contentView.addView(hw, ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT);
|
|
||||||
setContentView(contentView);
|
|
||||||
|
|
||||||
getActionBar().setTitle(CrashHandler.TITTLE);
|
|
||||||
getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()) + " Error");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
restartApp();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restartApp() {
|
|
||||||
final Intent intent = getPackageManager()
|
|
||||||
.getLaunchIntentForPackage(getPackageName());
|
|
||||||
if (intent != null) {
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
| Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
||||||
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int dp2px(final float dpValue) {
|
|
||||||
final float scale = Resources.getSystem().getDisplayMetrics().density;
|
|
||||||
return (int) (dpValue * scale + 0.5f);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(final Menu menu) {
|
|
||||||
menu.add(0, MENUITEM_COPY, 0, "Copy")
|
|
||||||
.setOnMenuItemClickListener(this)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
|
||||||
|
|
||||||
menu.add(0, MENUITEM_RESTART, 0, "Restart")
|
|
||||||
.setOnMenuItemClickListener(this)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onMenuItemClick(final MenuItem item) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case MENUITEM_COPY:
|
|
||||||
ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setPrimaryClip(ClipData.newPlainText(getPackageName(), mLog));
|
|
||||||
Toast.makeText(getApplication(), "The text is copied.", Toast.LENGTH_SHORT).show();
|
|
||||||
break;
|
|
||||||
case MENUITEM_RESTART:
|
|
||||||
AppCrashSafetyWire.getInstance().resumeToMaximumImmediately();
|
|
||||||
restartApp();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,27 @@
|
|||||||
package cc.winboll.studio.libappbase;
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.HorizontalScrollView;
|
||||||
|
import android.widget.ScrollView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
import cc.winboll.studio.libappbase.utils.CrashHandleNotifyUtils;
|
||||||
|
|
||||||
@@ -206,5 +220,111 @@ public final class CrashHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ====================== 内部Activity页面 ======================
|
||||||
|
/**
|
||||||
|
* 基础极简崩溃页面
|
||||||
|
* 保险丝熔断时启动,避免复杂布局二次崩溃
|
||||||
|
*/
|
||||||
|
public static final class CrashActivity extends Activity implements MenuItem.OnMenuItemClickListener {
|
||||||
|
private static final int MENUITEM_COPY = 0;
|
||||||
|
private static final int MENUITEM_RESTART = 1;
|
||||||
|
|
||||||
|
private String mLog;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(final Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
AppCrashSafetyWire.getInstance().postResumeCrashSafetyWireHandler(getApplicationContext());
|
||||||
|
mLog = getIntent().getStringExtra(EXTRA_CRASH_LOG);
|
||||||
|
setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
|
||||||
|
initLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态初始化布局
|
||||||
|
*/
|
||||||
|
private void initLayout() {
|
||||||
|
ScrollView contentView = new ScrollView(this);
|
||||||
|
contentView.setFillViewport(true);
|
||||||
|
|
||||||
|
HorizontalScrollView hw = new HorizontalScrollView(this);
|
||||||
|
hw.setBackgroundColor(0xFFF5F5F5);
|
||||||
|
|
||||||
|
TextView message = new TextView(this);
|
||||||
|
final int padding = dp2px(16);
|
||||||
|
message.setPadding(padding, padding, padding, padding);
|
||||||
|
message.setText(mLog);
|
||||||
|
message.setTextColor(0xFF000000);
|
||||||
|
message.setTextIsSelectable(true);
|
||||||
|
|
||||||
|
hw.addView(message);
|
||||||
|
contentView.addView(hw, ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
setContentView(contentView);
|
||||||
|
|
||||||
|
getActionBar().setTitle(TITTLE);
|
||||||
|
getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()) + " Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
restartApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启应用
|
||||||
|
*/
|
||||||
|
private void restartApp() {
|
||||||
|
final Intent intent = getPackageManager()
|
||||||
|
.getLaunchIntentForPackage(getPackageName());
|
||||||
|
if (intent != null) {
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
| Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||||
|
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp转px
|
||||||
|
*/
|
||||||
|
private int dp2px(final float dpValue) {
|
||||||
|
final float scale = Resources.getSystem().getDisplayMetrics().density;
|
||||||
|
return (int) (dpValue * scale + 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||||
|
menu.add(0, MENUITEM_COPY, 0, "Copy")
|
||||||
|
.setOnMenuItemClickListener(this)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
|
||||||
|
menu.add(0, MENUITEM_RESTART, 0, "Restart")
|
||||||
|
.setOnMenuItemClickListener(this)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onMenuItemClick(final MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case MENUITEM_COPY:
|
||||||
|
ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
cm.setPrimaryClip(ClipData.newPlainText(getPackageName(), mLog));
|
||||||
|
Toast.makeText(getApplication(), "The text is copied.", Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case MENUITEM_RESTART:
|
||||||
|
AppCrashSafetyWire.getInstance().resumeToMaximumImmediately();
|
||||||
|
restartApp();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class GlobalApplication extends Application {
|
|||||||
this,
|
this,
|
||||||
getPackageName(),
|
getPackageName(),
|
||||||
stackTraceStr,
|
stackTraceStr,
|
||||||
CrashActivity.class
|
CrashHandler.CrashActivity.class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe
|
|||||||
mCrashLog = getIntent().getStringExtra(CrashHandler.EXTRA_CRASH_LOG);
|
mCrashLog = getIntent().getStringExtra(CrashHandler.EXTRA_CRASH_LOG);
|
||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
intent.putExtra(CrashHandler.EXTRA_CRASH_LOG, mCrashLog);
|
intent.putExtra(CrashHandler.EXTRA_CRASH_LOG, mCrashLog);
|
||||||
CrashHandleNotifyUtils.handleUncaughtException(GlobalApplication.getInstance(), intent, CrashActivity.class);
|
CrashHandleNotifyUtils.handleUncaughtException(GlobalApplication.getInstance(), intent, CrashHandler.CrashActivity.class);
|
||||||
|
|
||||||
StackTraceElement[] stackElements = Thread.currentThread().getStackTrace();
|
StackTraceElement[] stackElements = Thread.currentThread().getStackTrace();
|
||||||
StringBuilder sb = new StringBuilder("GlobalCrashActivity onCreate StackTrace");
|
StringBuilder sb = new StringBuilder("GlobalCrashActivity onCreate StackTrace");
|
||||||
|
|||||||
1
libwinboll/.gitignore
vendored
Normal file
1
libwinboll/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
55
libwinboll/build.gradle
Normal file
55
libwinboll/build.gradle
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
apply from: '../.winboll/winboll_lib_build.gradle'
|
||||||
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
|
android {
|
||||||
|
// 适配MIUI12
|
||||||
|
compileSdkVersion 30
|
||||||
|
buildToolsVersion "30.0.3"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 26
|
||||||
|
targetSdkVersion 30
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_7
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// 网络连接类库
|
||||||
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
|
// Gson
|
||||||
|
api 'com.google.code.gson:gson:2.8.9'
|
||||||
|
// Html 解析
|
||||||
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
|
// 添加JSch依赖(SFTP核心,com.jcraft:jsch:0.1.54)
|
||||||
|
api 'com.jcraft:jsch:0.1.54'
|
||||||
|
|
||||||
|
// 米盟
|
||||||
|
api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
||||||
|
//注意:以下5个库必须要引入
|
||||||
|
//implementation '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'
|
||||||
|
|
||||||
|
// WinBoLL库 nexus.winboll.cc 地址
|
||||||
|
api 'cc.winboll.studio:libappbase:15.20.25'
|
||||||
|
api 'cc.winboll.studio:libaes:15.20.14'
|
||||||
|
|
||||||
|
// 备用库 jitpack.io 地址
|
||||||
|
//api 'com.github.ZhanGSKen:libappbase:appbase-v15.20.25'
|
||||||
|
//api 'com.github.ZhanGSKen:libaes:aes-v15.20.14'
|
||||||
|
|
||||||
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
||||||
8
libwinboll/build.properties
Normal file
8
libwinboll/build.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
|
#Wed Jun 03 07:32:48 HKT 2026
|
||||||
|
stageCount=8
|
||||||
|
libraryProject=libwinboll
|
||||||
|
baseVersion=15.20
|
||||||
|
publishVersion=15.20.7
|
||||||
|
buildCount=0
|
||||||
|
baseBetaVersion=15.20.8
|
||||||
17
libwinboll/proguard-rules.pro
vendored
Normal file
17
libwinboll/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:/tools/adt-bundle-windows-x86_64-20131030/sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# 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 *;
|
||||||
|
#}
|
||||||
12
libwinboll/src/main/AndroidManifest.xml
Normal file
12
libwinboll/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="cc.winboll.studio.libwinboll" >
|
||||||
|
|
||||||
|
<application>
|
||||||
|
<activity
|
||||||
|
android:name=".WinBoLLLibraryActivity">
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cc.winboll.studio.libwinboll;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import cc.winboll.studio.libappbase.ToastUtils;
|
||||||
|
|
||||||
|
public class WinBoLLLibraryActivity extends Activity
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_winbolllibrary);
|
||||||
|
|
||||||
|
ToastUtils.show("WinBoLLLibraryActivity onCreate");
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
libwinboll/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
BIN
libwinboll/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
libwinboll/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
libwinboll/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
BIN
libwinboll/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
11
libwinboll/src/main/res/layout/activity_winbolllibrary.xml
Normal file
11
libwinboll/src/main/res/layout/activity_winbolllibrary.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="cc.winboll.studio.libwinboll.WinBoLLLibraryActivity"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
5
libwinboll/src/main/res/values-v21/styles.xml
Normal file
5
libwinboll/src/main/res/values-v21/styles.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="AppTheme" parent="@android:style/Theme.Material.Light">
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
7
libwinboll/src/main/res/values/strings.xml
Normal file
7
libwinboll/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="lib_name">libwinboll</string>
|
||||||
|
<string name="hello_world">Hello world!</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
5
libwinboll/src/main/res/values/styles.xml
Normal file
5
libwinboll/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -20,11 +20,7 @@ def genVersionName(def versionName){
|
|||||||
android {
|
android {
|
||||||
// 适配MIUI12
|
// 适配MIUI12
|
||||||
compileSdkVersion 30
|
compileSdkVersion 30
|
||||||
|
buildToolsVersion "30.0.3"
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.winboll"
|
applicationId "cc.winboll.studio.winboll"
|
||||||
@@ -40,9 +36,21 @@ android {
|
|||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 米盟 SDK
|
||||||
|
packagingOptions {
|
||||||
|
doNotStrip "*/*/libmimo_1011.so"
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
jniLibs.srcDirs = ['libs'] // 若SO库放在libs目录下
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
api project(':libwinboll')
|
||||||
api 'com.google.code.gson:gson:2.10.1'
|
api 'com.google.code.gson:gson:2.10.1'
|
||||||
|
|
||||||
// 下拉控件
|
// 下拉控件
|
||||||
@@ -72,7 +80,7 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
// 米盟
|
// 米盟
|
||||||
//api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
api 'com.miui.zeus:mimo-ad-sdk:5.3.+'//请使用最新版sdk
|
||||||
//注意:以下5个库必须要引入
|
//注意:以下5个库必须要引入
|
||||||
//implementation 'androidx.appcompat:appcompat:1.4.1'
|
//implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
api 'androidx.recyclerview:recyclerview:1.0.0'
|
api 'androidx.recyclerview:recyclerview:1.0.0'
|
||||||
@@ -100,12 +108,12 @@ dependencies {
|
|||||||
implementation 'androidx.biometric:biometric:1.1.0'
|
implementation 'androidx.biometric:biometric:1.1.0'
|
||||||
|
|
||||||
// WinBoLL库 nexus.winboll.cc 地址
|
// WinBoLL库 nexus.winboll.cc 地址
|
||||||
api 'cc.winboll.studio:libappbase:15.20.34'
|
api 'cc.winboll.studio:libappbase:15.20.25'
|
||||||
api 'cc.winboll.studio:libaes:15.20.17'
|
api 'cc.winboll.studio:libaes:15.20.14'
|
||||||
|
|
||||||
// 备用库 jitpack.io 地址
|
// 备用库 jitpack.io 地址
|
||||||
//api 'com.github.ZhanGSKen:libappbase:appbase-v15.20.33'
|
//api 'com.github.ZhanGSKen:libappbase:appbase-v15.20.25'
|
||||||
//api 'com.github.ZhanGSKen:libaes:aes-v15.20.16'
|
//api 'com.github.ZhanGSKen:libaes:aes-v15.20.14'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Jul 01 03:24:33 CST 2026
|
#Wed Jun 03 07:32:48 HKT 2026
|
||||||
stageCount=9
|
stageCount=8
|
||||||
libraryProject=
|
libraryProject=libwinboll
|
||||||
baseVersion=15.20
|
baseVersion=15.20
|
||||||
publishVersion=15.20.8
|
publishVersion=15.20.7
|
||||||
buildCount=8
|
buildCount=0
|
||||||
baseBetaVersion=15.20.9
|
baseBetaVersion=15.20.8
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ public class MainActivity extends DrawerFragmentActivity {
|
|||||||
} else if (nItemId == R.id.item_termux_env_test) {
|
} else if (nItemId == R.id.item_termux_env_test) {
|
||||||
Intent intent = new Intent(getApplicationContext(), TermuxEnvTestActivity.class);
|
Intent intent = new Intent(getApplicationContext(), TermuxEnvTestActivity.class);
|
||||||
WinBoLLActivityManager.getInstance().startWinBoLLActivity(getApplicationContext(), intent, AboutActivity.class);
|
WinBoLLActivityManager.getInstance().startWinBoLLActivity(getApplicationContext(), intent, AboutActivity.class);
|
||||||
|
} else if (nItemId == R.id.item_library_activity) {
|
||||||
|
Intent intent = new Intent(getApplicationContext(), cc.winboll.studio.libwinboll.WinBoLLLibraryActivity.class);
|
||||||
|
WinBoLLActivityManager.getInstance().startWinBoLLActivity(getApplicationContext(), intent, AboutActivity.class);
|
||||||
} else {
|
} else {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user