Compare commits

..

10 Commits

Author SHA1 Message Date
ZhanGSKen
bf17688ebf 发布测试 2025-04-27 08:09:42 +08:00
ZhanGSKen
c2ed7d648b 编译测试 2025-04-27 08:07:06 +08:00
ZhanGSKen
458fa40c40 更换为maven库引用方式的类库依赖。 2025-04-27 08:05:00 +08:00
ZhanGSKen
6190d728db 类库模块移除安卓版本依赖 2025-04-27 02:01:43 +08:00
ZhanGSKen
94375f34e2 编译模块方式调整 2025-04-27 01:08:33 +08:00
ZhanGSKen
a0e5a687d3 调整类库组织类型为子项目模块引用,忽略采用Maven库依赖的方法。 2025-04-27 01:01:12 +08:00
ZhanGSKen
ecccc68b8e 编译测试 2025-04-27 00:44:27 +08:00
ZhanGSKen
7565eb6cf0 <libapputils>Library Release 15.2.2 2025-04-03 11:09:47 +08:00
ZhanGSKen
eee62024cf <apputils>APK 15.2.2 release Publish. 2025-04-03 11:09:25 +08:00
ZhanGSKen
bf6870696d 清理应用介绍模块资源,模块已移动至AES。 2025-04-03 11:08:21 +08:00
895 changed files with 8636 additions and 36592 deletions

16
.gitignore vendored
View File

@@ -87,15 +87,19 @@ lint/tmp/
# Android Profiling
*.hprof
# 忽略 Lint 输出文件
# Custom
.androidide
lint-results.xml
lint-results.html
## 忽略 AndroidIDE 临时文件夹
.androidide
winboll.properties
local.properties
## 忽略模块应用编译配置
/settings.gradle
/gradle.properties
/winboll.properties
/local.properties
## 忽略 srv 纠结问题
/srv/
## 忽略 winboll-x 文件夹
/winboll-x/

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "libjc/jcc/libs"]
path = libjc/jcc/libs
url = https://gitea.winboll.cc/Studio/APP_libjc_jcc_libs.git

View File

@@ -1,4 +1,4 @@
## WinBoLL 主机编译事项提醒
## WinBoll 主机编译事项提醒
## 类库类型源码发布
# 类库发布使用以下面命令

View File

@@ -0,0 +1,3 @@
#!/bin/usr/bash
## Change Back To Beta KeyStore in keystore module.
cd keystore;git reset --hard f5bc75ff45fcb8894b5bd3f49b91bdd8fe3c317e;cd ..

View File

@@ -0,0 +1,3 @@
#!/bin/usr/bash
## Change Back To StageMG KeyStore in keystore module.
cd keystore;git reset --hard d22519b11253f85f495400b01b6373e9657defb4;cd ..

View File

@@ -37,7 +37,7 @@ fi
# 使用grep找到包含"publishVersion="的那一行然后用awk提取其后的值
PUBLISH_VERSION=$(grep -o "publishVersion=.*" $1/build.properties | awk -F '=' '{print $2}')
echo "< $1/build.properties publishVersion : ${PUBLISH_VERSION} >"
## 设新的 WinBoLL 标签
## 设新的 WinBoll 标签
# 脚本调试时使用
#tag="v7.6.4-test1"
# 正式设置标签时使用

View File

@@ -38,24 +38,24 @@ function askAddWorkflowsTag {
fi
}
function addWinBoLLTag {
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 标签
## 设新的 WinBoll 标签
# 脚本调试时使用
#tag="projectname-v7.6.4-test1"
# 正式设置标签时使用
tag=$1"-v"${PUBLISH_VERSION}
echo "< WinBoLL Tag To: $tag >";
# 检查是否已经添加了 WinBoLL Tag
echo "< WinBoll Tag To: $tag >";
# 检查是否已经添加了 WinBoll Tag
if [ "$(git tag -l ${tag})" == "${tag}" ]; then
echo -e "< WinBoLL Tag ${tag} exist! >"
return 1 # WinBoLL标签重复
echo -e "< WinBoll Tag ${tag} exist! >"
return 1 # WinBoll标签重复
fi
# 添加WinBoLL标签
# 添加WinBoll标签
git tag -a ${tag} -F $1/app_update_description.txt
return 0
}
@@ -113,42 +113,42 @@ if [[ $? -eq 0 ]]; then
# 如果Git已经提交了所有代码就执行标签和应用发布操作
# 预先询问是否添加工作流标签
#echo "Add Github Workflows Tag? (yes/No)"
#result=$(askAddWorkflowsTag)
#nAskAddWorkflowsTag=$?
#echo $result
echo "Add Github Workflows Tag? (yes/No)"
result=$(askAddWorkflowsTag)
nAskAddWorkflowsTag=$?
echo $result
# 发布应用
echo "Publishing WinBoLL APK ..."
echo "Publishing WinBoll APK ..."
# 脚本调试时使用
#bash gradlew :$1:assembleBetaDebug
# 正式发布
bash gradlew :$1:assembleStageRelease
echo "Publishing WinBoLL APK OK."
echo "Publishing WinBoll APK OK."
# 添加 WinBoLL 标签
result=$(addWinBoLLTag $1)
# 添加 WinBoll 标签
result=$(addWinBollTag $1)
echo $result
if [[ $? -eq 0 ]]; then
echo $result
# WinBoLL 标签添加成功
# WinBoll 标签添加成功
else
echo -e "${0}: addWinBoLLTag $1\n${result}\nAdd WinBoLL tag cancel."
exit 1 # addWinBoLLTag 异常
echo -e "${0}: addWinBollTag $1\n${result}\nAdd WinBoll tag cancel."
exit 1 # addWinBollTag 异常
fi
# 添加 GitHub 工作流标签
#if [[ $nAskAddWorkflowsTag -eq 1 ]]; then
if [[ $nAskAddWorkflowsTag -eq 1 ]]; then
# 如果用户选择添加工作流标签
#result=$(addWorkflowsTag $1)
#if [[ $? -eq 0 ]]; then
# echo $result
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
else
echo -e "${0}: addWorkflowsTag $1\n${result}\nAdd workflows tag cancel."
exit 1 # addWorkflowsTag 异常
fi
fi
## 清理更新描述文件内容
echo "" > $1/app_update_description.txt

View File

@@ -38,24 +38,24 @@ function askAddWorkflowsTag {
fi
}
function addWinBoLLTag {
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 标签
## 设新的 WinBoll 标签
# 脚本调试时使用
#tag="v7.6.4-test1"
# 正式调试版设置标签时使用
tag=$1"-v"${PUBLISH_VERSION}"-debug"
echo "< WinBoLL Tag To: $tag >";
# 检查是否已经添加了 WinBoLL Tag
echo "< WinBoll Tag To: $tag >";
# 检查是否已经添加了 WinBoll Tag
if [ "$(git tag -l ${tag})" == "${tag}" ]; then
echo -e "< WinBoLL Tag ${tag} exist! >"
return 1 # WinBoLL标签重复
echo -e "< WinBoll Tag ${tag} exist! >"
return 1 # WinBoll标签重复
fi
# 添加WinBoLL标签
# 添加WinBoll标签
git tag -a ${tag} -F $1/app_update_description.txt
return 0
}
@@ -119,22 +119,22 @@ if [[ $? -eq 0 ]]; then
echo $result
# 发布应用
echo "Publishing WinBoLL Debug APK ..."
echo "Publishing WinBoll Debug APK ..."
# 脚本调试时使用
#bash gradlew :$1:assembleBetaDebug
# 正式发布调试版
bash gradlew :$1:assembleStageDebug
echo "Publishing WinBoLL Debug APK OK."
echo "Publishing WinBoll Debug APK OK."
# 添加 WinBoLL 标签
result=$(addWinBoLLTag $1)
# 添加 WinBoll 标签
result=$(addWinBollTag $1)
echo $result
if [[ $? -eq 0 ]]; then
echo $result
# WinBoLL 标签添加成功
# WinBoll 标签添加成功
else
echo -e "${0}: addWinBoLLTag $1\n${result}\nAdd WinBoLL tag cancel."
exit 1 # addWinBoLLTag 异常
echo -e "${0}: addWinBollTag $1\n${result}\nAdd WinBoll tag cancel."
exit 1 # addWinBollTag 异常
fi
# 添加 GitHub 工作流标签

View File

@@ -8,7 +8,7 @@ if [ -z "$1" ]; then
fi
## 正式发布使用
git pull && bash gradlew :$1:publishReleasePublicationToWinBoLLReleaseRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1
git pull && bash gradlew :$1:publishReleasePublicationToWinBollReleaseRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1
## 调试使用
#bash gradlew :$1:publishSnapshotWinBoLLPublicationToWinBoLLSnapshotRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1
#bash gradlew :$1:publishSnapshotWinBollPublicationToWinBollSnapshotRepository && bash .winboll/bashCommitLibReleaseBuildFlagInfo.sh $1

View File

@@ -1,12 +1,7 @@
// WinBoLL 应用签名配置
// WinBoll 应用签名配置
//
android {
def winbollProps = new Properties()
def winbollPropsFile = rootProject.file("${winbollFilePath}")
assert(winbollPropsFile.exists())
winbollProps.load(new FileInputStream(winbollPropsFile))
// 读取秘钥配置文件
//
def keyProps = new Properties()
@@ -28,31 +23,26 @@ android {
}
}
buildTypes {
debug {
signingConfig signingConfigs.winboll
}
release {
signingConfig signingConfigs.winboll
minifyEnabled true // 开启混淆(核心开关)
shrinkResources true // 可选:移除无用资源(进一步减小体积)
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), // 官方默认规则(优化版)
'proguard-rules.pro' // 自定义规则文件
}
signingConfig signingConfigs.winboll
}
debug {
signingConfig signingConfigs.winboll
}
}
flavorDimensions "WinBoLLApp"
flavorDimensions "WinBollApp"
productFlavors {
beta {
// 检查编译标志位配置
assert (winbollBuildProps['buildCount'] != null)
dimension "WinBoLLApp"
dimension "WinBollApp"
applicationIdSuffix ".beta"
LocalDateTime localDateTimeNow = LocalDateTime.now(ZoneId.of("Asia/Shanghai"));
versionNameSuffix "-beta" + winbollBuildProps['buildCount'] + "_" + localDateTimeNow.format('mmss')
}
stage {
dimension "WinBoLLApp"
dimension "WinBollApp"
}
}
@@ -71,12 +61,11 @@ android {
}
//
// WinBoLL 应用包输出配置
// WinBoll 应用包输出配置
// 1. 配置 Stage Release 版应用包输出
// 2. 配置 Beta Debug 版应用包输出
//
if((variant.flavorName == "beta" && variant.buildType.name == "debug")
|| (variant.flavorName == "beta" && variant.buildType.name == "release")
|| (variant.flavorName == "stage" && variant.buildType.name == "debug")
|| (variant.flavorName == "stage" && variant.buildType.name == "release")) {
println "Project root directory: " + project.rootDir.toString()
@@ -85,13 +74,13 @@ android {
//def outputFileName="${rootProject.name}_${versionName}.apk"
def outputFileName=project.rootDir.name + "_${versionName}.apk"
// 创建 WinBoLL Studio 发布接口文件夹
// 创建 WinBoll Studio 发布接口文件夹
File fWinBoLLStudioDir = file("/sdcard/WinBoLLStudio/APKs");
if(!fWinBoLLStudioDir.exists()) {
//fWinBoLLStudioDir.mkdirs();
// 如果没有发布接口文件就不用进行APK发布和源码管理操作
// 当前编译环境不是 WinBoLL 主机, 以下将忽略APK发布和源码管理操作。
println 'The current compilation environment is not in WinBoLL host, and the following APK publishing and source management operations will be ignore.'
// 当前编译环境不是 WinBoll 主机, 以下将忽略APK发布和源码管理操作。
println 'The current compilation environment is not in WinBoll host, and the following APK publishing and source management operations will be ignore.'
} else {
/// WINBOLL 主机的 APK 发布和源码管理操作 ///
variant.getAssembleProvider().get().doFirst {
@@ -102,7 +91,7 @@ android {
//
variant.getAssembleProvider().get().doLast {
variant.outputs.forEach{ file->
// 如果正在调试,就拷贝到 WinBoLL 备份管理文件夹
// 如果正在调试,就拷贝到 WinBoll 备份管理文件夹
//
if(variant.flavorName == "beta"&&variant.buildType.name == "debug"){
//File outBuildBckDir = new File(fWinBoLLStudioDir, "/${rootProject.name}/${variant.buildType.name}")
@@ -133,7 +122,6 @@ android {
FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile)
winbollBuildProps.store(fos, "${winbollBuildPropsDesc}");
fos.close();
println "\n\n>>> Project build.properties saved.\n\n";
if(winbollBuildProps['libraryProject'] != "") {
// 如果应用 build.properties 文件设置了类库模块项目文件名
@@ -145,15 +133,14 @@ android {
java.nio.file.Path targetFilePath = libraryProjectBuildPropsFile.toPath();
// 使用copyTo()方法复制文件,如果目标文件存在会被覆盖,可选参数可以选择不覆盖
java.nio.file.Files.copy(sourceFilePath, targetFilePath, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
println "\n\n>>> Library Project build.properties saved.\n\n";
}
}
}
// 如果正在发布,就拷贝到 WinBoLL 标签管理文件夹,和处理 Git 仓库管理任务。
// 如果正在发布,就拷贝到 WinBoll 标签管理文件夹
//
if(variant.flavorName == "stage"&&variant.buildType.name == "release"){
if((variant.flavorName == "stage"&&variant.buildType.name == "debug")
|| (variant.flavorName == "stage"&&variant.buildType.name == "release")){
// 发布 APK 文件
//
// 截取版本号的版本字段为短版本名
@@ -234,7 +221,6 @@ android {
}
// 提交新的编译标志配置
println 'exec bashCommitAppPublishBuildFlagInfoFilePath ...'
def resultCommitBuildFlag = exec {
commandLine 'bash', '--', "${RootProjectDir}/${bashCommitAppPublishBuildFlagInfoFilePath}", "${RootProjectDir}", "${versionName}", variant.buildType.name , rootProject.name
}
@@ -242,78 +228,22 @@ android {
assert(resultCommitBuildFlag.getExitValue() == 0)
}
} // if(variant.buildType.name == "release"){
// 如果正在调试发布版就只生成和输出APK文件不处理 Git 仓库提交与更新问题。
//
if(variant.flavorName == "stage"&&variant.buildType.name == "debug"){
// 发布 APK 文件
//
// 截取版本号的版本字段为短版本名
String szVersionName = "${versionName}"
String[] szlistTemp = szVersionName.split("-")
String szShortVersionName = szlistTemp[0]
//String szCommonTagAPKName = "${rootProject.name}_" + szShortVersionName + ".apk"
String szCommonTagAPKName = project.rootDir.name + "_" + szShortVersionName + ".apk"
println "CommonTagAPKName is : " + szCommonTagAPKName
//File outTagDir = new File(fWinBoLLStudioDir, "/${rootProject.name}/tag/")
File outTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}/")
// 创建目标路径目录
if(!outTagDir.exists()) {
outTagDir.mkdirs();
println "Output Folder Created.(Tags) : " + outTagDir.getAbsolutePath()
}
if(outTagDir.exists()) {
File targetAPK = new File(outTagDir, "${szCommonTagAPKName}")
if(targetAPK.exists()) {
// 标签版本APK文件已经存在构建拷贝任务停止
println '如果是在调试 Stage 版应用包构建,请删除(注在debug目录)现有的 Stage 应用包('+targetAPK.getAbsolutePath()+')。再编译一次。'
assert (!targetAPK.exists())
// 可选择删除并继续输出APK文件
//delete targetAPK
// 如果公共目录存在就拷贝到公共目录并重命名为app.apk
//
File outCommonDir = new File("/sdcard/AppProjects")
String commandAPKName = "app.apk"
if(outCommonDir.exists()) {
copy{
from file.outputFile
into outCommonDir
rename {
String fileName -> "${commandAPKName}"
}
// 复制一个备份
copy{
from file.outputFile
into outTagDir
rename {
String fileName -> "${outputFileName}"
}
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${outputFileName}"
}
// 复制一个并重命名为短版本名
copy{
from file.outputFile
into outTagDir
rename {
String fileName -> "${szCommonTagAPKName}"
}
println "Output APK (Tags): "+ outTagDir.getAbsolutePath() + "/${szCommonTagAPKName}"
}
//不保存编译标志配置
println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}"
}
}
// 如果配置了APK额外输出路径就复制一份拷贝到额外路径。
//
if(winbollProps['ExtraAPKOutputPath'] != null ) {
File apkFile = new File(winbollProps['ExtraAPKOutputPath'])
File outCommonDir = apkFile.getParentFile();
String commandAPKName = apkFile.getName();
if(outCommonDir.exists()) {
copy{
from file.outputFile
into outCommonDir
rename {
String fileName -> "${commandAPKName}"
}
println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}"
}
}
}
}
}// End of (variant.getAssembleProvider().get().doLast {)

View File

@@ -1,4 +1,4 @@
// 本机和 WinBoLL Maven 仓库传输配置。
// 本机和 WinBoll Maven 仓库传输配置。
//
def getDefaultVersion(){
@@ -9,7 +9,7 @@ def getDefaultVersion(){
}
def siteUrl = 'https://winboll.cc/?page=studio/details.php&app=${rootProject.name}' // 项目主页
def gitUrl = 'https://gitea.winboll.cc/WinBoLL/${rootProject.name}' // 项目的git地址
def gitUrl = 'https://gitea.winboll.cc/WinBoll/${rootProject.name}' // 项目的git地址
def DefaultGroupId = 'cc.winboll.studio' // 类库所有者groupId
def DefaultVersion = getDefaultVersion() // 版本号
def DeveloperId='zhangsken' // 开发者账号
@@ -27,10 +27,10 @@ afterEvaluate {
properties.load(file("${RootProjectDir}/${winbollFilePath}").newDataInputStream())
def NexusUserName = properties.getProperty("Nexus.name")
def NexusPassword = properties.getProperty("Nexus.password")
// WinBoLL Release 仓库
// WinBoll Release 仓库
maven{
//仓库的名字和地址
name = "WinBoLLRelease"
name = "WinBollRelease"
url="https://nexus.winboll.cc/repository/maven-releases/"
// 仓库用户名密码
credentials {
@@ -38,10 +38,10 @@ afterEvaluate {
password = NexusPassword
}
}
// WinBoLL Snapshot 仓库
// WinBoll Snapshot 仓库
maven{
//仓库的名字和地址
name = "WinBoLLSnapshot"
name = "WinBollSnapshot"
url="https://nexus.winboll.cc/repository/maven-snapshots/"
// 仓库用户名密码
credentials {
@@ -101,9 +101,9 @@ afterEvaluate {
}
}
// WinBoLL Maven Release 仓库传输任务
// WinBoll Maven Release 仓库传输任务
//
releaseWinBoLL(MavenPublication) {
releaseWinBoll(MavenPublication) {
// 需要使用的变体假设有free和pay两个变体可以选择一个
//from components.free
@@ -154,9 +154,9 @@ afterEvaluate {
} // 创建名为 release 的任务结束
// WinBoLL Maven Snapshot 仓库传输任务
// WinBoll Maven Snapshot 仓库传输任务
//
snapshotWinBoLL(MavenPublication) {
snapshotWinBoll(MavenPublication) {
// 需要使用的变体假设有free和pay两个变体可以选择一个
//from components.free

View File

@@ -1,49 +0,0 @@
#!/bin/bash
# 应用秘钥创建脚本
# Linux 命令行创建JKS秘钥alias和keyAlias可配置文件名含时间戳
# 可配置参数(按需修改)
ALIAS="WinBoLL.CC_Debug" # 别名与keyAlias一致
STORE_PASS="androiddebugkey"
KEY_PASS="androiddebugkey"
COUNTRY="CN" # 国家代码
# 获取当前时间戳
TIMESTAMP=$(date +%Y%m%d%H%M%S)
FILENAME="${ALIAS}_${TIMESTAMP}.jks"
STORENAME="${ALIAS}_${TIMESTAMP}.keystore"
# 生成JKS文件alias与keyAlias同步
keytool -genkeypair \
-alias "${ALIAS}" \
-keyalg RSA \
-keysize 2048 \
-validity 1 \
-keystore "${FILENAME}" \
-dname "CN=WBFans, OU=Studio, O=WinBoLL, L=Shanwei, ST=Guangdong, C=${COUNTRY}" \
-storepass "${STORE_PASS}" \
-keypass "${KEY_PASS}"
# 写入配置文件
cat <<EOF > ${STORENAME}
keyAlias=${ALIAS}
keyPassword=${KEY_PASS}
storeFile=../appkey.jks
storePassword=${STORE_PASS}
EOF
echo "已生成秘钥:${FILENAME}"
echo "配置已写入 ${STORENAME}keyAlias=${ALIAS}"
# 询问是否复制文件
read -p "是否需要将文件复制为 appkey.jks 和 appkey.keystore(y/n): " CONFIRM
if [[ $CONFIRM =~ ^[Yy]$ ]]; then
# 复制 jks 文件为 appkey.jks
cp -v ${FILENAME} ../appkey.jks
# 复制 keystore 文件为 appkey.keystore
cp -v ${STORENAME} ../appkey.keystore
echo "文件复制完成"
else
echo "已取消文件复制"
fi

210
LICENSE
View File

@@ -1,201 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2024 ZhanGSKen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

148
README.md
View File

@@ -1,30 +1,23 @@
# OriginMaster
【OriginMaster】WinBoLL 源生态计划。正如话,我需要一个 Point, 去撬动成个地球。
# ☁ ☁ ☁ WinBoll APP ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ 这是 WinBoll 系列 APP 汇总项目。☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# ☁ ☁ ☁ WinBoll 网站地址 https://www.winboll.cc/studio/app/ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
########
## ☁ ☁ ☁ 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 提问
## WinBoll 提问
同样是 /sdcard 目录,在开发 Android 应用时,
能否实现手机编译与电脑编译的源码同步。
☁因而 WinBoLL 项目组诞生了。
☁因而 WinBoll 项目组诞生了。
## WinBoLL 项目组研发计划
致力于把 WinBoLL-APP 应用在手机端 Android 项目开发。
也在探索 https://gitea.winboll.cc/<WinBoLL 项目组>/APP.git 应用于 WinBoLL-APP APK 分发。
更想进阶 https://github.com/<WinBoLL 项目组>/APP.git 应用于 WinBoLL-APP Beta APK 分发。
## WinBoll 项目组研发计划
致力于把 WinBoll-APP 应用在手机端 Android 项目开发。
也在探索 https://gitea.winboll.cc/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP APK 分发。
更想进阶 https://github.com/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP Beta APK 分发。
## WinBoLL-APP 汗下...
## WinBoll-APP 汗下...
#### ☁应用何置如此呢。且观用户云云。
#### ☁ 正当下 ☁ ###
#### ☁ 且容傻家叙说 ☁ WinBoLL-APP 应用场景
### ☁ WinBoLL 设备资源概述
#### ☁ 且容傻家叙说 ☁ WinBoll-APP 应用场景
### ☁ WinBoll 设备资源概述
#### ☁ 1. Raid Disk.
概述:这是一个矩阵存储类设备。
优点:该设备具有数据容错存储功能,
@@ -47,58 +40,58 @@
设备位于操作系统内部文件系统。
数据持久性与操作系统挂钩。
#### ☁ 4. WinBoLL 用户资源概述。
1> /home/<用户名> 位于 WinBoLL 操作系统目录下。
#### ☁ 4. WinBoll 用户资源概述。
1> /home/<用户名> 位于 WinBoll 操作系统目录下。
2> /rdisk/<用户名> 挂载用户 Raid Disk.
3> /data/<用户名> 挂载用户 Data Disk.
4> /sdcard/<用户名> 挂载用户 SSD Disk.
#### ☁ 5. WinBoLL-APP 用户资源概述。
#### ☁ 5. WinBoll-APP 用户资源概述。
1> /sdcard 挂载用户手机 SD 存储/storage/emulated/0
### ☁ 稍稍歇 ☁ ###
### ☁ 急急停 ☁ WinBoLL 应用前置条件
☁ WinBoLL 主机建立 1Panel MySQL 应用。
☁ WinBoLL 主机建立 1Panel Gitea 应用。
☁ WinBoLL 主机设置 WinBoLL 应用为非登录状态。
☁ WinBoLL 主机建立 WinBoLL 账户与 WinBoLL 用户组。
☁ WinBoLL 账户 User ID 为: J。
☁ WinBoLL 用户组 Group ID 为: Studio。
☁ WinBoLL 主机 WinBoLL 1Panel Gitea 建立 WinBoLL 工作组。
☁ WinBoLL 主机 WinBoLL 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/WinBoLLStudio/<用户名>/APKs/
☁ WinBoLL 项目配置文件示例为 "<WinBoLL 项目根目录>/.winboll/winboll.properties-demo"(WinBoLL 项目已设置)
☁ WinBoLL 项目配置文件为 "<WinBoLL 项目根目录>/.winboll/winboll.properties"
☁ WinBoLL 项目配置文件设定为源码提交时忽略。(WinBoLL 项目已设置)
☁ Gradle 项目配置文件示例为 "<WinBoLL 项目根目录>/.winboll/local.properties-demo"(WinBoLL 项目已设置)
☁ Gradle 项目配置文件为 "<WinBoLL 项目根目录>/local.properties"(WinBoLL 项目已设置)
☁ Gradle 项目配置文件设定为源码提交时忽略。(WinBoLL 项目已设置)
### ☁ 急急停 ☁ WinBoll 应用前置条件
☁ WinBoll 主机建立 1Panel MySQL 应用。
☁ WinBoll 主机建立 1Panel Gitea 应用。
☁ WinBoll 主机设置 WinBoll 应用为非登录状态。
☁ WinBoll 主机建立 WinBoll 账户与 WinBoll 用户组。
☁ WinBoll 账户 User ID 为: J。
☁ WinBoll 用户组 Group ID 为: Studio。
☁ WinBoll 主机 WinBoll 1Panel Gitea 建立 WinBoll 工作组。
☁ WinBoll 主机 WinBoll 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/WinBollStudio/<用户名>/APKs/
☁ WinBoll 项目配置文件示例为 "<WinBoll 项目根目录>/.winboll/winboll.properties-demo"(WinBoll 项目已设置)
☁ WinBoll 项目配置文件为 "<WinBoll 项目根目录>/.winboll/winboll.properties"
☁ WinBoll 项目配置文件设定为源码提交时忽略。(WinBoll 项目已设置)
☁ Gradle 项目配置文件示例为 "<WinBoll 项目根目录>/.winboll/local.properties-demo"(WinBoll 项目已设置)
☁ Gradle 项目配置文件为 "<WinBoll 项目根目录>/local.properties"(WinBoll 项目已设置)
☁ Gradle 项目配置文件设定为源码提交时忽略。(WinBoll 项目已设置)
### ☁ 登高处 ☁ WinBoLL 应用需求规划
☁ WinBoLL 主机建立 WinBoLL 客户端用户数据库为 MySQL winbollclient 数据库。
☁ WinBoLL 主机设置 WinBoLL 客户端用户信息存储在 winbollclient 数据库中。
### ☁ 登高处 ☁ WinBoll 应用需求规划
☁ WinBoll 主机建立 WinBoll 客户端用户数据库为 MySQL winbollclient 数据库。
☁ WinBoll 主机设置 WinBoll 客户端用户信息存储在 winbollclient 数据库中。
☁ MySQL winbollclient 数据库中
WinBoLL 客户端用户信息设定为:
WinBoll 客户端用户信息设定为:
<用户名, 验证密码, 验证邮箱, 验证手机, 唯一存储令牌Token, 备用验证邮箱>
☁ WinBoLL 项目源码仓库托管在 WinBoLL 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/studio/app.git中。
☁ WinBoLL 主机提供 WinBoLL 1Panel Gitea 应用的 WinBoLL 项目源码仓库存取功能。Gitea 应用已提供)
☁ WinBoLL 主机提供 WinBoLL Gitea 项目仓库存档功能。Gitea 应用已提供)
☁ 提供 WinBoLL 客户端用户登录功能。Gitea 应用已提供)
☁ WinBoll 项目源码仓库托管在 WinBoll 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/studio/app.git中。
☁ WinBoll 主机提供 WinBoll 1Panel Gitea 应用的 WinBoll 项目源码仓库存取功能。Gitea 应用已提供)
☁ WinBoll 主机提供 WinBoll Gitea 项目仓库存档功能。Gitea 应用已提供)
☁ 提供 WinBoll 客户端用户登录功能。Gitea 应用已提供)
### ☁ 看远方 ☁ ###
### ☁ 心忧虑 ☁ WinBoLL-APP 应用前置需求
☁ WinBoLL-APP WinBoLL 项目根目录设定为手机的 /sdcard/WinBoLLStudio/Sources 目录。(需要用户手动建立文件夹)
☁ WinBoLL-APP 具有手机 /sdcard/WinBoLL 目录的存储权限。(需要手机操作系统授权)
☁ WinBoLL-APP WinBoLL 项目仓库源码存储路径为 /sdcard/WinBoLLStudio/Sources/APP.git需要用户手动建立文件夹
☁ WinBoLL-APP 项目 APK 编译输出目录为 /sdcard/WinBoLLStudio/APKs/
☁ WinBoLL-APP 应用签名验证可定制化。WinBoLL 项目已提供)
☁ WinBoLL-APP 与系列衍生 APP 应用共享 cc.winboll.studio 命名空间资源。WinBoLL 项目已提供)
☁ WinBoLL-APP 用户客户端信息存储在命名空间为 WinBoLL APP MySQLLite 应用的 winbollappclient 数据库中。
☁ WinBoLL-APP MySQLLite 应用的 winbollappclient 数据库中,
WinBoLL 用户客户端信息设定为:
### ☁ 心忧虑 ☁ WinBoll-APP 应用前置需求
☁ WinBoll-APP WinBoll 项目根目录设定为手机的 /sdcard/WinBollStudio/Sources 目录。(需要用户手动建立文件夹)
☁ WinBoll-APP 具有手机 /sdcard/WinBoll 目录的存储权限。(需要手机操作系统授权)
☁ WinBoll-APP WinBoll 项目仓库源码存储路径为 /sdcard/WinBollStudio/Sources/APP.git需要用户手动建立文件夹
☁ WinBoll-APP 项目 APK 编译输出目录为 /sdcard/WinBollStudio/APKs/
☁ WinBoll-APP 应用签名验证可定制化。WinBoll 项目已提供)
☁ WinBoll-APP 与系列衍生 APP 应用共享 cc.winboll.studio 命名空间资源。WinBoll 项目已提供)
☁ WinBoll-APP 用户客户端信息存储在命名空间为 WinBoll APP MySQLLite 应用的 winbollappclient 数据库中。
☁ WinBoll-APP MySQLLite 应用的 winbollappclient 数据库中,
WinBoll 用户客户端信息设定为:
<用户名, 唯一存储令牌Token>
### ☁ 云游四方 ☁ ###
### ☁ 呔! ☁ WinBoLL-APP 应用需求规划
### ☁ 呔! ☁ WinBoll-APP 应用需求规划
☁ 如要使用 WinBoLL Android 项目的 Gradle 编译功能,则需要设置以下两个文件夹。
☁ 1. 则需要建立数据存储目录 /sdcard/WinBoLLStudio/APKs。
WinBoLL 项目源码编译出来的安装包会拷贝一份到 /sdcard/WinBoLLStudio/APKs 目录下。
@@ -106,23 +99,20 @@
WinBoLL 项目源码编译出来的安装包会拷贝一份并命名 "app.apk" 的安装文件为到 /sdcard/AppProjects 目录下。
### ☁ 吁! ☁ WinBoLL-APP 共享计划前景
☁ WinBoLL-APP 将会实现 https://winboll.cc/api 访问功能。
☁ WinBoLL-APP 将会实现手机端 Android 应用的开发与管理功能。
### ☁ 吁! ☁ WinBoll-APP 共享计划前景
☁ WinBoll-APP 将会实现 https://winboll.cc/api 访问功能。
☁ WinBoll-APP 将会实现手机端 Android 应用的开发与管理功能。
## ☁ WinBoLL ☁ WinBoLL 主机忧虑
☁ WinBoLL 将会提供 gitea.winboll.cc 域名用户注册登录功能。
☁ WinBoLL 将会提供 WinBoLL-APP 及其衍生应用的 Gitea 仓库管理服务。
☁ WinBoLL 将会提供 winboll.cc 域名 WinBoLL 项目组注册登录功能。
## ☁ WinBoll ☁ WinBoll 主机忧虑
☁ WinBoll 将会提供 gitea.winboll.cc 域名用户注册登录功能。
☁ WinBoll 将会提供 WinBoll-APP 及其衍生应用的 Gitea 仓库管理服务。
☁ WinBoll 将会提供 winboll.cc 域名 WinBoll 项目组注册登录功能。
# 本项目要实际运用需要注意以下几个步骤:
# 在项目根目录下:
## . 项目模块编译环境设置(必须)settings.gradle-demo 要复制为 settings.gradle并取消相应项目模块的注释。
## . 项目模块编译环境设置(必须) 在根目录拷贝 gradle.properties-androidx-demo 或者 gradle.properties-android-demo 文件为 gradle.properties
## . 项目 Android SDK 编译环境设置(可选)local.properties-demo 要复制为 local.properties并按需要设置 Android SDK 目录
## ★. 应用签名密钥 keystore 设置问题。一般调试编译只需用【Termux】cd 进 GenKeyStore 目录执行 $ bash gen_debug_keystore.sh 命令即可完成设置。
## ☆. 应用 WiBoLL 签名密钥配置问题<非必须考虑>。设置时需要 clone 【keystore】模块源码并拷贝模块目录的 appkey.jks 与 appkey.keystore 到项目根目录即可。
## ☆. 类库型模块编译环境设置(可选)winboll.properties-demo 要复制为 winboll.properties并按需要设置 WinBoLL Maven 库登录用户信息, 和 APK 文件额外输出路径。
## 1. 项目模块编译环境设置(必须)settings.gradle-demo 要复制为 settings.gradle并取消相应项目模块的注释。
## 2. 项目 Android SDK 编译环境设置(可选)local.properties-demo 要复制为 local.properties并按需要设置 Android SDK 目录
## 3. 类库型模块编译环境设置(可选)winboll.properties-demo 要复制为 winboll.properties并按需要设置 WinBoll Maven 库登录用户信息
# ☆类库型项目编译方法
@@ -131,26 +121,12 @@
设置属性 libraryProject=<类库项目模块文件夹名称>
### 再编译测试项目
$ bash .winboll/bashPublishAPKAddTag.sh <应用项目模块文件夹名称>
#### 测试项目编译后,编译器会复制一份 APK 到 路径:"/sdcard/WinBoLLStudio/APKs/<项目根目录名称>/tag/" 文件夹。
#### 若是 winboll.properties 文件的 [ExtraAPKOutputPath] 属性设置了路径。编译器也会复制一份 APK 到这个路径。
#### 测试项目编译后,编译器会复制一份 APK 到以下路径:"/sdcard/WinBollStudio/APKs/<项目根目录名称>/tag/" 文件夹。
### 最后编译类库项目
$ bash .winboll/bashPublishLIBAddTag.sh <类库项目模块文件夹名称>
#### 类库模块编译命令执行后,编译器会发布到 WinBoLL Nexus Maven 库Maven 库地址可以参阅根项目目录配置 build.gradle 文件。
#### 类库模块编译命令执行后,编译器会发布到 WinBoll Nexus Maven 库Maven 库地址可以参阅根项目目录配置 build.gradle 文件。
# ☆应用型项目编译方法
## 直接调用以下命令编译应用型项目
$ bash .winboll/bashPublishAPKAddTag.sh <应用项目模块文件夹名称>
#### 应用模块编译命令执行后,编译器会复制一份 APK 到
#### 测试项目编译后,编译器会复制一份 APK 到 路径:"/sdcard/WinBoLLStudio/APKs/<项目根目录名称>/tag/" 文件夹。
#### 若是 winboll.properties 文件的 [ExtraAPKOutputPath] 属性设置了路径。编译器也会复制一份 APK 到这个路径。
## ☆应用调试编译方法
使用以下命令编译调试:
### Beta调试使用
$ bash gradlew assembleBetaDebug
### Stage调试使用
$ bash gradlew assembleStageDebug
### 若是 winboll.properties 文件的 [ExtraAPKOutputPath] 属性设置了路径。编译器也会复制一份 APK 到这个路径。
#### 应用模块编译命令执行后,编译器会复制一份 APK 到以下路径:"/sdcard/WinBollStudio/APKs/<项目根目录名称>/tag/" 文件夹。

View File

@@ -1,35 +0,0 @@
# AES
#### 介绍
WinBoLL 安卓可视化元素类库测试应用。
#### 软件架构
适配安卓应用 [AIDE Pro] 的 Gradle 编译结构。
也适配安卓应用 [AndroidIDE] 的 Gradle 编译结构。
#### Gradle 编译说明
调试版编译命令 gradle assembleBetaDebug
阶段版编译命令 bash .winboll/bashPublishAPKAddTag.sh aes
阶段版类库发布命令 git pull &&bash .winboll/bashPublishLIBAddTag.sh libaes
#### 使用说明
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码 : ZhanGSKen(ZhanGSKen<zhangsken@188.com>)
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
#### 参考文档

View File

@@ -18,30 +18,28 @@ def genVersionName(def versionName){
}
android {
// 1. compileSdkVersion必须 ≥ targetSdkVersion建议直接等于 targetSdkVersion30
compileSdkVersion 30
// 2. buildToolsVersion需匹配 compileSdkVersion建议使用 30.x.x 最新稳定版(无需高于 compileSdkVersion
buildToolsVersion "30.0.3" // 这是 30 对应的最新稳定版,避免使用 beta 版
compileSdkVersion 32
buildToolsVersion "32.0.0"
defaultConfig {
applicationId "cc.winboll.studio.aes"
minSdkVersion 23
targetSdkVersion 30
minSdkVersion 24
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置
// 项目模块目录的 build.gradle 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.11"
versionName "15.2"
if(true) {
versionName = genVersionName("${versionName}")
}
}
// 米盟 SDK
packagingOptions {
doNotStrip "*/*/libmimo_1011.so"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Wed Nov 26 15:54:26 GMT 2025
#Thu Apr 03 11:14:05 HKT 2025
stageCount=7
libraryProject=libaes
baseVersion=15.11
publishVersion=15.11.6
buildCount=32
baseBetaVersion=15.11.7
baseVersion=15.2
publishVersion=15.2.6
buildCount=0
baseBetaVersion=15.2.7

132
aes/proguard-rules.pro vendored
View File

@@ -9,129 +9,9 @@
# Add any project specific keep options here:
# ============================== 基础通用规则 ==============================
# 保留系统组件
-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.**
# 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
# 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 *;
#}

View File

@@ -33,10 +33,6 @@
<activity android:name=".AboutActivity"/>
<activity android:name=".TestActivityManagerActivity"/>
<activity android:name=".SettingsActivity"/>
</application>
</manifest>
</manifest>

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 23:52:29
* @Describe AES应用介绍窗口
*/
@@ -12,18 +12,18 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
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.libaes.winboll.APPInfo;
import cc.winboll.studio.libaes.winboll.AboutView;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
public class AboutActivity extends WinBollActivity implements IWinBollActivity {
public static final String TAG = "AboutActivity";
Context mContext;
Toolbar mToolbar;
@Override
public Activity getActivity() {
return this;
@@ -33,7 +33,7 @@ public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -64,13 +64,13 @@ public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
);
layout.addView(aboutView, params);
WinBoLLActivityManager.getInstance().add(this);
GlobalApplication.getWinBollActivityManager().add(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
WinBoLLActivityManager.getInstance().registeRemove(this);
GlobalApplication.getWinBollActivityManager().registeRemove(this);
}
public AboutView CreateAboutView() {
@@ -79,15 +79,15 @@ public class AboutActivity extends WinBoLLActivity implements IWinBoLLActivity {
appInfo.setAppName("AES");
appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll);
appInfo.setAppDescription("AES Description");
appInfo.setAppGitName("APPBase");
appInfo.setAppGitName("APP");
appInfo.setAppGitOwner("Studio");
appInfo.setAppGitAPPBranch(szBranchName);
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
appInfo.setAppHomePage("https://www.winboll.cc/apks/index.php?project=AES");
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES");
appInfo.setAppAPKName("AES");
appInfo.setAppAPKFolderName("AES");
//appInfo.setIsAddDebugTools(false);
//appInfo.setIsAddDebugTools(BuildConfig.DEBUG);
appInfo.setIsAddDebugTools(BuildConfig.DEBUG);
return new AboutView(mContext, appInfo);
}
}

View File

@@ -1,14 +1,13 @@
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/13 19:03:58
* @Describe AES应用类
*/
import android.view.Gravity;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.ToastUtils;
import com.hjq.toast.ToastUtils;
public class App extends GlobalApplication {
@@ -18,16 +17,14 @@ public class App extends GlobalApplication {
@Override
public void onCreate() {
super.onCreate();
setIsDebugging(BuildConfig.DEBUG);
WinBoLLActivityManager.init(this);
// 初始化 Toast 框架
ToastUtils.init(this);
// 设置 Toast 布局样式
ToastUtils.setView(R.layout.view_toast);
//ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
}
@Override
public void onTerminate() {
super.onTerminate();
ToastUtils.release();
}
}

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/13 19:05:52
* @Describe 应用主窗口
*/
@@ -15,10 +15,9 @@ import android.widget.AdapterView;
import android.widget.Toast;
import cc.winboll.studio.aes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.models.DrawerMenuBean;
import cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity;
import cc.winboll.studio.libaes.unittests.TestAButtonFragment;
import cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity;
@@ -26,12 +25,12 @@ import cc.winboll.studio.libaes.unittests.TestAToolbarActivity;
import cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity;
import cc.winboll.studio.libaes.unittests.TestViewPageFragment;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import com.a4455jkjh.colorpicker.ColorPickerDialog;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActivity {
public class MainActivity extends DrawerFragmentActivity implements IWinBollActivity {
public static final String TAG = "MainActivity";
@@ -90,9 +89,9 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActi
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.toolbar_main, menu);
if(App.isDebugging()) {
getMenuInflater().inflate(cc.winboll.studio.libaes.R.menu.toolbar_studio_debug, menu);
getMenuInflater().inflate(R.menu.toolbar_library, menu);
if(App.isDebuging()) {
getMenuInflater().inflate(cc.winboll.studio.libapputils.R.menu.toolbar_studio_debug, menu);
}
return super.onCreateOptionsMenu(menu);
}
@@ -123,10 +122,9 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActi
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int nItemId = item.getItemId();
if (item.getItemId() == R.id.item_testactivitymanager) {
WinBoLLActivityManager.getInstance().startWinBoLLActivity(this, TestActivityManagerActivity.class);
//ToastUtils.show("item_testactivitymanager");
} else
// if (item.getItemId() == R.id.item_log) {
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
// } else
if (nItemId == R.id.item_atoast) {
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
} else if (nItemId == R.id.item_atoolbar) {
@@ -185,10 +183,8 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActi
} else if (nItemId == R.id.item_drawerfragmentactivity) {
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
startActivity(intent);
} else if (nItemId == R.id.item_settings) {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
} else if (nItemId == R.id.item_about) {
}
else if (nItemId == R.id.item_about) {
Intent intent = new Intent(this, AboutActivity.class);
startActivity(intent);
return true;

View File

@@ -1,38 +0,0 @@
package cc.winboll.studio.aes;
import android.app.Activity;
import android.os.Bundle;
import cc.winboll.studio.libaes.enums.ADsMode;
import cc.winboll.studio.libaes.views.ADsControlView;
import cc.winboll.studio.libappbase.ToastUtils;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/11/26 18:01
* @Describe SettingsActivity
*/
public class SettingsActivity extends Activity {
public static final String TAG = "SettingsActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
ADsControlView adsControlView = (ADsControlView) findViewById(R.id.ads_control_view);
// adsControlView.setOnAdsModeSelectedListener(new ADsControlView.OnAdsModeSelectedListener() {
// @Override
// public void onModeSelected(ADsMode selectedMode) {
// if (selectedMode == ADsMode.STANDALONE) {
// // 处理单机模式逻辑(如释放米盟资源)
// ToastUtils.show("STANDALONE");
// } else if (selectedMode == ADsMode.MIMO_SDK) {
// // 处理米盟SDK模式逻辑如初始化SDK
// ToastUtils.show("MIMO_SDK");
// }
// }
// });
}
}

View File

@@ -1,33 +0,0 @@
package cc.winboll.studio.aes;
import android.app.Activity;
import android.os.Bundle;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/09/28 21:07
* @Describe 窗口管理类测试窗口
*/
public class TestActivityManagerActivity extends WinBoLLActivity implements IWinBoLLActivity {
public static final String TAG = "TestActivityManagerActivity";
@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_testactivitymanager);
}
}

View File

@@ -1,60 +0,0 @@
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/09/29 00:11
* @Describe WinBoLL 窗口基础类
*/
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.libappbase.LogUtils;
public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity {
public static final String TAG = "WinBoLLActivity";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onResume() {
super.onResume();
LogUtils.d(TAG, String.format("onResume %s", getTag()));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
/*if (item.getItemId() == R.id.item_log) {
WinBoLLActivityManager.getInstance().startLogActivity(this);
return true;
} else if (item.getItemId() == R.id.item_home) {
startActivity(new Intent(this, MainActivity.class));
return true;
}*/
// 在switch语句中处理每个ID并在处理完后返回true未处理的情况返回false。
return super.onOptionsItemSelected(item);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
WinBoLLActivityManager.getInstance().add(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
WinBoLLActivityManager.getInstance().registeRemove(this);
}
}

View File

@@ -1,21 +1,21 @@
package cc.winboll.studio.mymessagemanager.activitys;
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/31 01:31:17
* @Describe 应用活动窗口基类
*/
import android.app.Activity;
import android.os.Bundle;
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.libappbase.winboll.IWinBollActivity;
import android.view.MenuItem;
public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity {
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/30 00:34:02
* @Describe WinBoll 活动窗口通用基类
*/
public class WinBollActivity extends AppCompatActivity implements IWinBollActivity {
public static final String TAG = "WinBoLLActivity";
public static final String TAG = "WinBollActivity";
protected volatile AESThemeBean.ThemeType mThemeType;
@@ -48,7 +48,7 @@ public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivi
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == android.R.id.home) {

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<cc.winboll.studio.libaes.views.ADsControlView
android:id="@+id/ads_control_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="窗口管理类测试窗口"/>
</LinearLayout>

View File

@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/item_testactivitymanager"
android:title="TestActivityManager"/>
<item
android:id="@+id/item_log"
android:title="LogActivity"/>
@@ -32,7 +29,4 @@
<item
android:id="@+id/item_drawerfragmentactivity"
android:title="Test DrawerFragmentActivity"/>
<item
android:id="@+id/item_settings"
android:title="Settings"/>
</menu>

View File

@@ -1 +0,0 @@

View File

@@ -24,7 +24,7 @@ android {
defaultConfig {
applicationId "cc.winboll.studio.androiddemo"
minSdkVersion 24
targetSdkVersion 30
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
@@ -67,6 +67,6 @@ dependencies {
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
api 'com.android.support:recyclerview-v7:28.0.0'
api 'cc.winboll.studio:libapputils:15.8.5'
api 'cc.winboll.studio:libappbase:15.9.5'
api 'cc.winboll.studio:libapputils:15.2.2'
api 'cc.winboll.studio:libappbase:15.2.2'
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Aug 31 05:11:26 CST 2025
stageCount=1
#Thu Apr 03 03:17:18 GMT 2025
stageCount=0
libraryProject=
baseVersion=15.0
publishVersion=15.0.0
buildCount=0
buildCount=21
baseBetaVersion=15.0.1

View File

@@ -1 +0,0 @@

View File

@@ -24,12 +24,12 @@ android {
defaultConfig {
applicationId "cc.winboll.studio.androidxdemo"
minSdkVersion 24
targetSdkVersion 30
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.1"
versionName "15.0"
if(true) {
versionName = genVersionName("${versionName}")
}
@@ -67,7 +67,7 @@ dependencies {
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
//api 'androidx.fragment:fragment:1.1.0'
api 'cc.winboll.studio:libaes:15.9.3'
api 'cc.winboll.studio:libapputils:15.8.5'
api 'cc.winboll.studio:libappbase:15.9.5'
api 'cc.winboll.studio:libaes:15.2.6'
api 'cc.winboll.studio:libapputils:15.2.2'
api 'cc.winboll.studio:libappbase:15.2.2'
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Aug 31 05:42:50 CST 2025
stageCount=2
#Thu Apr 03 03:15:55 GMT 2025
stageCount=0
libraryProject=
baseVersion=15.1
publishVersion=15.1.1
buildCount=0
baseBetaVersion=15.1.2
baseVersion=15.0
publishVersion=15.0.0
buildCount=18
baseBetaVersion=15.0.1

View File

@@ -22,9 +22,9 @@ import android.widget.HorizontalScrollView;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import cc.winboll.studio.androidxdemo.R;
import cc.winboll.studio.libappbase.GlobalApplication;
import com.hjq.toast.ToastUtils;
import com.hjq.toast.style.WhiteToastStyle;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
@@ -53,8 +53,8 @@ public class App extends GlobalApplication {
// 初始化 Toast 框架
ToastUtils.init(this);
// 设置 Toast 布局样式
//ToastUtils.setView(R.layout.view_toast);
ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setView(R.layout.view_toast);
//ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
//CrashHandler.getInstance().registerGlobal(this);

View File

@@ -19,31 +19,29 @@ def genVersionName(def versionName){
android {
// 1. compileSdkVersion:必须 ≥ targetSdkVersion建议直接等于 targetSdkVersion30
compileSdkVersion 30
// 2. buildToolsVersion需匹配 compileSdkVersion建议使用 30.x.x 最新稳定版(无需高于 compileSdkVersion
buildToolsVersion "30.0.3" // 这是 30 对应的最新稳定版,避免使用 beta 版
compileSdkVersion 32
buildToolsVersion "32.0.0"
defaultConfig {
applicationId "cc.winboll.studio.appbase"
minSdkVersion 23
targetSdkVersion 30
minSdkVersion 24
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.11"
versionName "15.2"
if(true) {
versionName = genVersionName("${versionName}")
}
}
// 确保 Java 7 兼容性(已适配项目技术栈)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Nov 30 17:13:07 HKT 2025
#Sun Apr 27 00:07:35 GMT 2025
stageCount=7
libraryProject=libappbase
baseVersion=15.11
publishVersion=15.11.6
baseVersion=15.2
publishVersion=15.2.6
buildCount=0
baseBetaVersion=15.11.7
baseBetaVersion=15.2.7

View File

@@ -15,112 +15,3 @@
#-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 public class * extends com.winboll.WinBoLLActivity
#-keep public class * extends com.winboll.WinBoLLFragment
# 主包名
-keep class cc.winboll.studio.*.** { *; }
# beta包名
-keep class cc.winboll.studio.*.beta.** { *; }
-keepclassmembers class cc.winboll.studio.*.** { *; }
-keepclassmembers class cc.winboll.studio.*.beta.** { *; }
# 保留所有类中的 public static final String TAG 字段
-keepclassmembers class * {
public static final java.lang.String TAG;
}
# 保留序列化类
-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 文件
-keepclassmembers class **.R$* {
public static <fields>;
}
# 保留 native 方法
-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.**
# ============================== 第三方框架规则 ==============================
# Retrofit + OkHttp
-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-keep class okio.** { *; }
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
# Glide 4.x
-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 *;
}
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
# GreenDAO 3.x
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
# 实体类包名(按实际调整)
#-keep class cc.winboll.studio.appbase.model.** { *; }
# ButterKnife 8.x
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.BindView <fields>;
@butterknife.OnClick <methods>;
}
# EventBus 3.x
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# ============================== 优化与调试 ==============================
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-verbose
-dontpreverify
-dontusemixedcaseclassnames
# 保留行号(便于崩溃定位)
-keepattributes SourceFile,LineNumberTable

View File

@@ -2,10 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<application
tools:replace="android:icon,android:roundIcon"
android:icon="@drawable/ic_winboll_beta"
android:roundIcon="@drawable/ic_winboll_beta">
<application>
<!-- Put flavor specific code here -->

View File

@@ -5,7 +5,7 @@
<application
android:name=".App"
android:icon="@drawable/ic_winboll"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyAPPBaseTheme"
android:resizeableActivity="true"
@@ -24,20 +24,105 @@
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".GlobalApplication$CrashActivity"/>
<activity
android:name=".activities.NewActivity"
android:label="NewActivity"
android:exported="true"
android:resizeableActivity="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
<activity android:name=".activities.New2Activity"
android:label="New2Activity"
android:exported="true"
android:resizeableActivity="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
<service
android:name=".MyTileService"
android:exported="true"
android:label="@string/tileservice_name"
android:icon="@drawable/ic_launcher"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
<service
android:name=".services.MainService"
android:exported="true"/>
<service
android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
android:exported="true"/>
<service
android:name="cc.winboll.studio.appbase.services.TestDemoService"
android:exported="true"/>
<service android:name=".services.AssistantService"/>
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver"
android:exported="true">
<intent-filter>
<action android:name="cc.winboll.studio.appbase.receivers.MainReceiver"/>
</intent-filter>
</receiver>
<receiver
android:name=".widgets.APPNewsWidget"
android:exported="true">
<intent-filter>
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidget.ACTION_WAKEUP_SERVICE"/>
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidget.ACTION_RELOAD_REPORT"/>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_provider_info_sos"/>
</receiver>
<receiver android:name=".receivers.APPNewsWidgetClickListener"
android:exported="true">
<intent-filter>
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_PRE"/>
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_NEXT"/>
</intent-filter>
</receiver>
<meta-data
android:name="android.max_aspect"
android:value="4.0"/>
<activity android:name="cc.winboll.studio.libappbase.activities.CrashCopyReceiverActivity"/>
</application>
</manifest>
</manifest>

View File

@@ -1,43 +1,27 @@
package cc.winboll.studio.appbase;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libappbase.BuildConfig;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2025/01/05 09:54:42
* @Describe 应用全局入口类(继承基础库 GlobalApplication
* 负责应用初始化、全局资源管理与生命周期回调处理,是整个应用的核心入口
* @Describe APPbase 应用类
*/
import cc.winboll.studio.libappbase.GlobalApplication;
import android.content.IntentFilter;
import cc.winboll.studio.libappbase.sos.SOSCenterServiceReceiver;
import cc.winboll.studio.libappbase.sos.SOS;
public class App extends GlobalApplication {
/** 当前应用类的日志 TAG用于调试输出标识日志来源 */
public static final String TAG = "App";
/**
* 应用创建时回调(全局初始化入口)
* 在应用进程启动时执行,仅调用一次,用于初始化全局工具类、第三方库等
*/
SOSCenterServiceReceiver mSOSCenterServiceReceiver;
@Override
public void onCreate() {
super.onCreate(); // 调用父类初始化逻辑(如基础库配置、全局上下文设置)
//setIsDebugging(false);
setIsDebugging(BuildConfig.DEBUG);
// 初始化 Toast 工具类(传入应用全局上下文,确保 Toast 可在任意地方调用)
ToastUtils.init(getApplicationContext());
}
/**
* 应用终止时回调(资源释放入口)
* 仅在模拟环境(如 Android Studio 模拟器)中可靠触发,真机上可能因系统回收进程不执行
* 用于释放全局资源,避免内存泄漏
*/
@Override
public void onTerminate() {
super.onTerminate(); // 调用父类终止逻辑(如基础库资源释放)
// 释放 Toast 工具类资源(销毁全局 Toast 实例,避免内存泄漏)
ToastUtils.release();
super.onCreate();
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(SOS.ACTION_SOS);
registerReceiver(mSOSCenterServiceReceiver, intentFilter);
}
}

View File

@@ -1,140 +1,183 @@
package cc.winboll.studio.appbase;
import android.app.Activity;
import android.content.Context;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toolbar;
import android.widget.CheckBox;
import cc.winboll.studio.appbase.R;
import cc.winboll.studio.libappbase.LogActivity;
import cc.winboll.studio.appbase.activities.NewActivity;
import cc.winboll.studio.appbase.services.MainService;
import cc.winboll.studio.appbase.services.TestDemoBindService;
import cc.winboll.studio.appbase.services.TestDemoService;
import cc.winboll.studio.libappbase.CrashHandler;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.GlobalCrashActivity;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libappbase.sos.SOS;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import cc.winboll.studio.libappbase.widgets.StatusWidget;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 未标注(建议补充创建日期)
* @Describe 应用主界面 Activity入口界面
* 包含功能测试按钮崩溃测试、日志查看、Toast测试、顶部工具栏菜单功能是应用交互的核心入口
*/
public class MainActivity extends Activity {
public class MainActivity extends WinBoLLActivity implements IWinBollActivity {
/** 当前 Activity 的日志 TAG用于调试输出标识日志来源 */
public static final String TAG = "MainActivity";
/** 顶部工具栏(用于展示标题、菜单,绑定布局中的 Toolbar 控件) */
private Toolbar mToolbar;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
Toolbar mToolbar;
//LogView mLogView;
/**
* Activity 创建时回调(初始化界面)
* 在 Activity 首次创建时执行,用于加载布局、初始化控件、设置事件监听
* @param savedInstanceState 保存 Activity 状态的 Bundle如屏幕旋转时的数据恢复
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ToastUtils.show("onCreate"); // 显示 Activity 创建提示(调试用)
setContentView(R.layout.activity_main); // 加载主界面布局
ToastUtils.show("onCreate");
setContentView(R.layout.activity_main);
// 初始化 Toolbar 并设置为 ActionBar
mToolbar = findViewById(R.id.toolbar);
setActionBar(mToolbar); // 将 Toolbar 替代系统默认 ActionBar
setSupportActionBar(mToolbar);
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
//mLogView = findViewById(R.id.activitymainLogView1);
// if (GlobalApplication.isDebuging()) {
// mLogView.start();
// ToastUtils.show("LogView start.");
// }
}
/**
* 创建菜单时回调(加载工具栏菜单)
* 初始化 ActionBar 菜单,加载自定义菜单布局
* @param menu 菜单对象(用于承载菜单项)
* @return true显示菜单false不显示菜单
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// 加载菜单布局R.menu.toolbar_main 为自定义菜单文件)
getMenuInflater().inflate(R.menu.toolbar_main, menu);
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
return super.onCreateOptionsMenu(menu);
}
/**
* 菜单 item 点击时回调(处理菜单事件)
* 响应 Toolbar 菜单项的点击事件,执行对应业务逻辑
* @param item 被点击的菜单项
* @return true消费点击事件false不消费传递给父类
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item_home:
// 点击 "首页/官网" 菜单项,唤起浏览器打开指定网站
openWebsiteInBrowser(this);
break;
// 可扩展其他菜单项(如设置、关于等)的处理逻辑
}
// 在switch语句中处理每个ID并在处理完后返回true未处理的情况返回false。
return super.onOptionsItemSelected(item);
}
/**
* 崩溃测试按钮点击事件(触发应用崩溃,用于调试异常捕获)
* 故意执行非法操作(循环获取不存在的字符串资源),强制应用崩溃
* @param view 触发事件的 View对应布局中的崩溃测试按钮
*/
public void onCrashTest(View view) {
// 循环从 Integer.MIN_VALUE 到 Integer.MAX_VALUE获取不存在的字符串资源 ID触发崩溃
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
getString(i); // i 超出资源 ID 范围,抛出 Resources.NotFoundException 导致崩溃
@Override
protected void onDestroy() {
super.onDestroy();
Intent intentAPPWidget = new Intent(this, StatusWidget.class);
intentAPPWidget.setAction(StatusWidget.ACTION_STATUS_UPDATE);
sendBroadcast(intentAPPWidget);
}
public void onSwitchDebugMode(View view) {
boolean isDebuging = ((CheckBox)view).isChecked();
GlobalApplication.setIsDebuging(isDebuging);
GlobalApplication.saveDebugStatus();
}
public void onPreviewGlobalCrashActivity(View view) {
Intent intent = new Intent(this, GlobalCrashActivity.class);
intent.putExtra(CrashHandler.EXTRA_CRASH_INFO, "Demo log...");
startActivity(intent);
}
public void onStartCenter(View view) {
MainService.startMainService(this);
}
public void onStopCenter(View view) {
MainService.stopMainService(this);
}
public void onTestStopMainServiceWithoutSettingEnable(View view) {
LogUtils.d(TAG, "onTestStopMainServiceWithoutSettingEnable");
stopService(new Intent(this, MainService.class));
}
public void onTestUseComponentStartService(View view) {
LogUtils.d(TAG, "onTestUseComponentStartService");
// 目标服务的包名和类名
String packageName = this.getPackageName();
String serviceClassName = TestDemoService.class.getName();
// 构建Intent
Intent intentService = new Intent();
intentService.setComponent(new ComponentName(packageName, serviceClassName));
startService(intentService);
}
public void onTestDemoServiceSOS(View view) {
Intent intent = new Intent(this, TestDemoService.class);
stopService(intent);
if (App.isDebuging()) {
SOS.sosToAppBaseBeta(this, TestDemoService.class.getName());
} else {
SOS.sosToAppBase(this, TestDemoService.class.getName());
}
}
/**
* 日志测试按钮点击事件(打开日志查看界面)
* 启动 LogActivity用于查看应用运行日志
* @param view 触发事件的 View对应布局中的日志测试按钮
*/
public void onLogTest(View view) {
// 启动日志查看 Activity通过静态方法传入上下文简化跳转逻辑
LogActivity.startLogActivity(this);
public void onSartTestDemoService(View view) {
Intent intent = new Intent(this, TestDemoService.class);
intent.setAction(TestDemoService.ACTION_ENABLE);
startService(intent);
}
public void onStopTestDemoService(View view) {
Intent intent = new Intent(this, TestDemoService.class);
intent.setAction(TestDemoService.ACTION_DISABLE);
startService(intent);
Intent intentStop = new Intent(this, TestDemoService.class);
stopService(intentStop);
}
/**
* Toast 工具测试按钮点击事件(测试全局 Toast 功能)
* 测试主线程、子线程中 Toast 的显示效果,验证 ToastUtils 的可用性
* @param view 触发事件的 View对应布局中的 Toast 测试按钮)
*/
public void onToastUtilsTest(View view) {
LogUtils.d(TAG, "onToastUtilsTest"); // 打印调试日志,标识进入 Toast 测试
ToastUtils.show("Hello, WinBoLL!"); // 主线程显示 Toast
// 开启子线程,延迟 2 秒后显示 Toast测试子线程 Toast 兼容性)
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2000); // 线程休眠 2 秒
// 若 ToastUtils 已处理主线程切换,此处可直接调用;否则需通过 Handler 切换到主线程
ToastUtils.show("Thread.sleep(2000);ToastUtils.show...");
} catch (InterruptedException e) {
// 捕获线程中断异常(如线程被销毁时),不做处理(测试场景)
e.printStackTrace();
}
}
}).start();
public void onStopTestDemoServiceNoSettings(View view) {
Intent intent = new Intent(this, TestDemoService.class);
stopService(intent);
}
/**
* 唤起系统默认浏览器打开指定网站(跳转至应用官网)
* 通过 Intent.ACTION_VIEW 隐式意图,触发浏览器打开目标 URL
* @param context 上下文对象(如 Activity、Application此处为 MainActivity
*/
public void openWebsiteInBrowser(Context context) {
String url = "https://www.winboll.cc"; // 目标网站 URL应用官网
// 构建隐式意图ACTION_VIEW 表示查看指定数据Uri 为网站地址)
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
// 设置标志:在新的任务栈中启动 Activity避免与当前应用任务栈混淆
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 启动意图(唤起浏览器)
context.startActivity(intent);
public void onSartTestDemoBindService(View view) {
Intent intent = new Intent(this, TestDemoBindService.class);
intent.setAction(TestDemoBindService.ACTION_ENABLE);
startService(intent);
}
public void onStopTestDemoBindService(View view) {
Intent intent = new Intent(this, TestDemoBindService.class);
intent.setAction(TestDemoBindService.ACTION_DISABLE);
startService(intent);
Intent intentStop = new Intent(this, TestDemoBindService.class);
stopService(intentStop);
}
public void onStopTestDemoBindServiceNoSettings(View view) {
Intent intent = new Intent(this, TestDemoBindService.class);
stopService(intent);
}
public void onTestOpenNewActivity(View view) {
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
}
}

View File

@@ -1,15 +1,14 @@
package cc.winboll.studio.winboll;
package cc.winboll.studio.appbase;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/13 19:30:10
*/
import android.content.Context;
import cc.winboll.studio.winboll.R;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import cc.winboll.studio.winboll.models.MainServiceBean;
import cc.winboll.studio.winboll.services.MainService;
import cc.winboll.studio.appbase.models.MainServiceBean;
import cc.winboll.studio.appbase.services.MainService;
public class MyTileService extends TileService {
public static final String TAG = "MyTileService";

View File

@@ -0,0 +1,86 @@
package cc.winboll.studio.appbase;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 15:34:16
* @Describe 应用活动窗口基类
*/
import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.widget.Toast;
import cc.winboll.studio.appbase.App;
import cc.winboll.studio.appbase.R;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
public class WinBoLLActivity extends AppCompatActivity implements IWinBollActivity {
public static final String TAG = "WinBollActivityBase";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
WinBollActivityManager getWinBollActivityManager() {
return WinBollActivityManager.getInstance(GlobalApplication.getInstance());
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWinBollActivityManager().add(this);
}
@Override
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
super.onPostCreate(savedInstanceState, persistentState);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
return true;
} else if (item.getItemId() == cc.winboll.studio.libappbase.R.id.item_about) {
Toast.makeText(getApplication(), "item_about", Toast.LENGTH_SHORT).show();
return true;
} else if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
//moveTaskToBack(true);
exit();
}
// 在switch语句中处理每个ID并在处理完后返回true未处理的情况返回false。
return super.onOptionsItemSelected(item);
}
void exit() {
YesNoAlertDialog.show(this, "Exit " + getString(R.string.app_name), "Close all activity and exit?", new YesNoAlertDialog.OnDialogResultListener(){
@Override
public void onYes() {
App.getWinBollActivityManager().finishAll();
}
@Override
public void onNo() {
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
getWinBollActivityManager().registeRemove(this);
}
}

View File

@@ -1,21 +1,22 @@
package cc.winboll.studio.winboll.activities;
package cc.winboll.studio.appbase.activities;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/25 11:46:40
* @Describe 测试窗口2
*/
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.appbase.R;
import cc.winboll.studio.appbase.WinBoLLActivity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
public class New2Activity extends WinBoLLActivity implements IWinBoLLActivity {
public class New2Activity extends WinBoLLActivity implements IWinBollActivity {
public static final String TAG = "New2Activity";
@@ -40,7 +41,7 @@ public class New2Activity extends WinBoLLActivity implements IWinBoLLActivity {
// mLogView = findViewById(R.id.logview);
// mLogView.start();
mToolbar = findViewById(R.id.toolbar);
setActionBar(mToolbar);
setSupportActionBar(mToolbar);
}
@@ -51,26 +52,31 @@ public class New2Activity extends WinBoLLActivity implements IWinBoLLActivity {
}
public void onCloseThisActivity(View view) {
WinBoLLActivityManager.getInstance().finish(this);
GlobalApplication.getWinBollActivityManager().finish(this);
}
public void onCloseAllActivity(View view) {
WinBoLLActivityManager.getInstance().finishAll();
GlobalApplication.getWinBollActivityManager().finishAll();
}
public void onNewActivity(View view) {
WinBoLLActivityManager.getInstance().startWinBoLLActivity(this, NewActivity.class);
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//getMenuInflater().inflate(R.menu.toolbar_main, menu);
getMenuInflater().inflate(R.menu.toolbar_main, menu);
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
return true;
}
// 在switch语句中处理每个ID并在处理完后返回true未处理的情况返回false
return super.onOptionsItemSelected(item);
}

View File

@@ -1,21 +1,21 @@
package cc.winboll.studio.winboll.activities;
package cc.winboll.studio.appbase.activities;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/25 05:04:22
* @Describe
*/
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.appbase.R;
import cc.winboll.studio.appbase.WinBoLLActivity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
public class NewActivity extends WinBoLLActivity implements IWinBoLLActivity {
public class NewActivity extends WinBoLLActivity implements IWinBollActivity {
public static final String TAG = "NewActivity";
@@ -39,7 +39,7 @@ public class NewActivity extends WinBoLLActivity implements IWinBoLLActivity {
// mLogView = findViewById(R.id.logview);
// mLogView.start();
mToolbar = findViewById(R.id.toolbar);
setActionBar(mToolbar);
setSupportActionBar(mToolbar);
}
@@ -50,26 +50,31 @@ public class NewActivity extends WinBoLLActivity implements IWinBoLLActivity {
}
public void onCloseThisActivity(View view) {
WinBoLLActivityManager.getInstance().finish(this);
GlobalApplication.getWinBollActivityManager().finish(this);
}
public void onCloseAllActivity(View view) {
WinBoLLActivityManager.getInstance().finishAll();
GlobalApplication.getWinBollActivityManager().finishAll();
}
public void onNew2Activity(View view) {
WinBoLLActivityManager.getInstance().startWinBoLLActivity(this, New2Activity.class);
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, New2Activity.class);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//getMenuInflater().inflate(R.menu.toolbar_main, menu);
getMenuInflater().inflate(R.menu.toolbar_main, menu);
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
return true;
}
// 在switch语句中处理每个ID并在处理完后返回true未处理的情况返回false
return super.onOptionsItemSelected(item);
}

View File

@@ -1,13 +1,13 @@
package cc.winboll.studio.winboll.handlers;
package cc.winboll.studio.appbase.handlers;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/14 03:51:40
*/
import android.os.Handler;
import android.os.Message;
import cc.winboll.studio.appbase.services.MainService;
import java.lang.ref.WeakReference;
import cc.winboll.studio.winboll.services.MainService;
public class MainServiceHandler extends Handler {
public static final String TAG = "MainServiceHandler";

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.models;
package cc.winboll.studio.appbase.models;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/13 07:06:13
*/
import android.util.JsonReader;

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.models;
package cc.winboll.studio.appbase.models;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/07 12:47:22
* @Describe TestServiceBean
*/

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.models;
package cc.winboll.studio.appbase.models;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/07 12:49:21
* @Describe TestDemoServiceBean
*/

View File

@@ -1,26 +1,26 @@
package cc.winboll.studio.winboll.models;
package cc.winboll.studio.appbase.models;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2025/05/10 09:36
* @Describe WinBoLL 应用消息数据模型
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/17 10:05:09
* @Describe APPSOSReportBean
*/
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.libappbase.BaseBean;
import java.io.IOException;
public class WinBoLLNewsBean extends BaseBean {
public class WinBollNewsBean extends BaseBean {
public static final String TAG = "WinBoLLNewsBean";
public static final String TAG = "WinBollNewsBean";
String message;
protected String message;
public WinBoLLNewsBean() {
public WinBollNewsBean() {
this.message = "";
}
public WinBoLLNewsBean(String message) {
public WinBollNewsBean(String message) {
this.message = message;
}
@@ -34,13 +34,14 @@ public class WinBoLLNewsBean extends BaseBean {
@Override
public String getName() {
return WinBoLLNewsBean.class.getName();
return WinBollNewsBean.class.getName();
}
@Override
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
super.writeThisToJsonWriter(jsonWriter);
jsonWriter.name("message").value(getMessage());
}
@Override

View File

@@ -1,14 +1,14 @@
package cc.winboll.studio.winboll.receivers;
package cc.winboll.studio.appbase.receivers;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 07:11:44
*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.widgets.APPNewsWidget;
public class APPNewsWidgetClickListener extends BroadcastReceiver {

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.receivers;
package cc.winboll.studio.appbase.receivers;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/13 06:58:04
* @Describe 主要广播接收器
*/
@@ -10,17 +10,16 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity;
import cc.winboll.studio.appbase.models.WinBollNewsBean;
import cc.winboll.studio.appbase.services.MainService;
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
import cc.winboll.studio.libappbase.AppUtils;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libapputils.utils.AppUtils;
import cc.winboll.studio.winboll.WinBoLL;
import cc.winboll.studio.winboll.models.WinBoLLModel;
import cc.winboll.studio.winboll.models.WinBoLLNewsBean;
import cc.winboll.studio.winboll.services.MainService;
import cc.winboll.studio.winboll.sos.SOS;
import cc.winboll.studio.winboll.sos.SOSObject;
import cc.winboll.studio.winboll.widgets.APPNewsWidget;
import cc.winboll.studio.libappbase.sos.APPModel;
import cc.winboll.studio.libappbase.sos.SOS;
import cc.winboll.studio.libappbase.sos.SOSObject;
import cc.winboll.studio.libappbase.sos.WinBoll;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.text.SimpleDateFormat;
@@ -43,21 +42,21 @@ public class MainReceiver extends BroadcastReceiver {
String szAction = intent.getAction();
if (szAction.equals(ACTION_BOOT_COMPLETED)) {
ToastUtils.show("ACTION_BOOT_COMPLETED");
} else if (szAction.equals(IWinBoLLActivity.ACTION_BIND)) {
} else if (szAction.equals(WinBoll.ACTION_BIND)) {
LogUtils.d(TAG, "ACTION_BIND");
LogUtils.d(TAG, String.format("context.getPackageName() %s", context.getPackageName()));
LogUtils.d(TAG, String.format("intent.getAction() %s", intent.getAction()));
String szWinBoLLModel = intent.getStringExtra(WinBoLL.EXTRA_WINBOLLMODEL);
LogUtils.d(TAG, String.format("szAPPModel %s", szWinBoLLModel));
if (szWinBoLLModel != null && !szWinBoLLModel.equals("")) {
String szAPPModel = intent.getStringExtra(WinBoll.EXTRA_APPMODEL);
LogUtils.d(TAG, String.format("szAPPModel %s", szAPPModel));
if (szAPPModel != null && !szAPPModel.equals("")) {
try {
WinBoLLModel bean = WinBoLLModel.parseStringToBean(szWinBoLLModel, WinBoLLModel.class);
APPModel bean = APPModel.parseStringToBean(szAPPModel, APPModel.class);
if (bean != null) {
String szAppPackageName = bean.getAppPackageName();
LogUtils.d(TAG, String.format("szAppPackageName %s", szAppPackageName));
String szAppMainServiveName = bean.getAppMainServiveName();
LogUtils.d(TAG, String.format("szAppMainServiveName %s", szAppMainServiveName));
mwrService.get().bindWinBoLLModelConnection(bean);
mwrService.get().bindAPPModelConnection(bean);
}
} catch (IOException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
@@ -81,7 +80,7 @@ public class MainReceiver extends BroadcastReceiver {
String appName = AppUtils.getAppNameByPackageName(context, szObjectPackageName);
LogUtils.d(TAG, String.format("appName %s", appName));
WinBoLLNewsBean appWinBoLLNewsBean = new WinBoLLNewsBean(appName);
WinBollNewsBean appWinBollNewsBean = new WinBollNewsBean(appName);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String currentTime = sdf.format(new Date());
StringBuilder sbLine = new StringBuilder();
@@ -89,9 +88,9 @@ public class MainReceiver extends BroadcastReceiver {
sbLine.append(currentTime);
sbLine.append("] Power to ");
sbLine.append(appName);
appWinBoLLNewsBean.setMessage(sbLine.toString());
appWinBollNewsBean.setMessage(sbLine.toString());
APPNewsWidget.addWinBoLLNewsBean(context, appWinBoLLNewsBean);
APPNewsWidget.addWinBollNewsBean(context, appWinBollNewsBean);
Intent intentWidget = new Intent(context, APPNewsWidget.class);
intentWidget.setAction(APPNewsWidget.ACTION_RELOAD_REPORT);
@@ -111,7 +110,7 @@ public class MainReceiver extends BroadcastReceiver {
IntentFilter filter=new IntentFilter();
filter.addAction(ACTION_BOOT_COMPLETED);
filter.addAction(SOS.ACTION_SOS);
filter.addAction(WinBoLL.ACTION_BIND);
filter.addAction(WinBoll.ACTION_BIND);
//filter.addAction(Intent.ACTION_BATTERY_CHANGED);
service.registerReceiver(this, filter);
}

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.services;
package cc.winboll.studio.appbase.services;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/14 03:38:31
* @Describe 守护进程服务
*/
@@ -11,9 +11,11 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import cc.winboll.studio.appbase.models.MainServiceBean;
import cc.winboll.studio.appbase.services.AssistantService;
import cc.winboll.studio.appbase.services.MainService;
import cc.winboll.studio.libappbase.LogUtils;
import android.os.Binder;
import cc.winboll.studio.winboll.models.MainServiceBean;
public class AssistantService extends Service {

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.services;
package cc.winboll.studio.appbase.services;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/13 06:56:41
* @Describe 拨号主服务
* 参考:
@@ -17,16 +17,16 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Binder;
import android.os.IBinder;
import cc.winboll.studio.appbase.MyTileService;
import cc.winboll.studio.appbase.models.MainServiceBean;
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
import cc.winboll.studio.appbase.receivers.MainReceiver;
import cc.winboll.studio.appbase.services.AssistantService;
import cc.winboll.studio.appbase.threads.MainServiceThread;
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.MyTileService;
import cc.winboll.studio.winboll.handlers.MainServiceHandler;
import cc.winboll.studio.winboll.models.MainServiceBean;
import cc.winboll.studio.winboll.models.WinBoLLModel;
import cc.winboll.studio.winboll.receivers.MainReceiver;
import cc.winboll.studio.winboll.services.AssistantService;
import cc.winboll.studio.winboll.threads.MainServiceThread;
import cc.winboll.studio.winboll.widgets.APPNewsWidget;
import java.util.ArrayList;
import cc.winboll.studio.libappbase.sos.APPModel;
public class MainService extends Service {
@@ -182,7 +182,7 @@ public class MainService extends Service {
}
}
public void bindWinBoLLModelConnection(WinBoLLModel bean) {
public void bindAPPModelConnection(APPModel bean) {
LogUtils.d(TAG, "bindAPPModelConnection(...)");
// 清理旧的绑定链接
for (int i = mAPPModelConnectionList.size() - 1; i > -1; i--) {
@@ -203,7 +203,7 @@ public class MainService extends Service {
Intent intentWidget = new Intent(this, APPNewsWidget.class);
intentWidget.setAction(APPNewsWidget.ACTION_WAKEUP_SERVICE);
WinBoLLModel appSOSBean = new WinBoLLModel(bean.getAppPackageName(), bean.getAppMainServiveName());
APPModel appSOSBean = new APPModel(bean.getAppPackageName(), bean.getAppMainServiveName());
intentWidget.putExtra("APPSOSBean", appSOSBean.toString());
sendBroadcast(intentWidget);
}
@@ -212,7 +212,7 @@ public class MainService extends Service {
ComponentName mComponentName;
boolean isBindToAPP(WinBoLLModel bean) {
boolean isBindToAPP(APPModel bean) {
return mComponentName != null
&& mComponentName.getClassName().equals(bean.getAppMainServiveName())
&& mComponentName.getPackageName().equals(bean.getAppPackageName());

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.services;
package cc.winboll.studio.appbase.services;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/07 12:45:49
* @Describe 启动时申请绑定到APPBase主服务的服务示例
*/
@@ -10,12 +10,11 @@ import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import cc.winboll.studio.appbase.models.TestDemoBindServiceBean;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.App;
import cc.winboll.studio.winboll.WinBoLL;
import cc.winboll.studio.winboll.models.TestDemoBindServiceBean;
import cc.winboll.studio.winboll.services.TestDemoBindService;
import cc.winboll.studio.winboll.sos.SOS;
import cc.winboll.studio.libappbase.sos.WinBoll;
import cc.winboll.studio.appbase.App;
import cc.winboll.studio.libappbase.sos.SOS;
public class TestDemoBindService extends Service {
@@ -157,9 +156,9 @@ public class TestDemoBindService extends Service {
super.run();
LogUtils.d(TAG, "run() start");
if (App.isDebuging()) {
WinBoLL.bindToAPPBaseBeta(mContext, TestDemoBindService.class.getName());
WinBoll.bindToAPPBaseBeta(mContext, TestDemoBindService.class.getName());
} else {
WinBoLL.bindToAPPBase(mContext, TestDemoBindService.class.getName());
WinBoll.bindToAPPBase(mContext, TestDemoBindService.class.getName());
}
while (!isExit()) {

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.winboll.services;
package cc.winboll.studio.appbase.services;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/07 12:39:24
* @Describe 普通服务示例
*/
@@ -10,9 +10,9 @@ import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import cc.winboll.studio.winboll.models.TestDemoServiceBean;
import cc.winboll.studio.appbase.models.TestDemoServiceBean;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.winboll.models.TestDemoServiceBean;
import cc.winboll.studio.libappbase.sos.WinBoll;
public class TestDemoService extends Service {

View File

@@ -1,11 +1,11 @@
package cc.winboll.studio.winboll.threads;
package cc.winboll.studio.appbase.threads;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/14 03:46:44
*/
import android.content.Context;
import cc.winboll.studio.winboll.handlers.MainServiceHandler;
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
import cc.winboll.studio.libappbase.LogUtils;
import java.lang.ref.WeakReference;

View File

@@ -1,6 +1,6 @@
package cc.winboll.studio.winboll.widgets;
package cc.winboll.studio.appbase.widgets;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/02/15 14:41:25
* @Describe TimeWidget
*/
@@ -11,13 +11,13 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
import cc.winboll.studio.appbase.R;
import cc.winboll.studio.appbase.models.WinBollNewsBean;
import cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener;
import cc.winboll.studio.libappbase.AppUtils;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libapputils.utils.AppUtils;
import cc.winboll.studio.winboll.R;
import cc.winboll.studio.winboll.WinBoLL;
import cc.winboll.studio.winboll.models.WinBoLLModel;
import cc.winboll.studio.winboll.models.WinBoLLNewsBean;
import cc.winboll.studio.winboll.receivers.APPNewsWidgetClickListener;
import cc.winboll.studio.libappbase.sos.APPModel;
import cc.winboll.studio.libappbase.sos.WinBoll;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -31,14 +31,14 @@ public class APPNewsWidget extends AppWidgetProvider {
public static final String ACTION_RELOAD_REPORT = APPNewsWidget.class.getName() + ".ACTION_RELOAD_REPORT";
volatile static ArrayList<WinBoLLNewsBean> _WinBoLLNewsBeanList;
volatile static ArrayList<WinBollNewsBean> _WinBollNewsBeanList;
final static int _MAX_PAGES = 10;
final static int _OnePageLinesCount = 5;
volatile static int _CurrentPageIndex = 0;
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
initWinBoLLNewsBeanList(context);
initWinBollNewsBeanList(context);
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
@@ -47,7 +47,7 @@ public class APPNewsWidget extends AppWidgetProvider {
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
initWinBoLLNewsBeanList(context);
initWinBollNewsBeanList(context);
if (intent.getAction().equals(ACTION_RELOAD_REPORT)) {
LogUtils.d(TAG, "ACTION_RELOAD_REPORT");
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
@@ -57,11 +57,11 @@ public class APPNewsWidget extends AppWidgetProvider {
}
}else if (intent.getAction().equals(ACTION_WAKEUP_SERVICE)) {
LogUtils.d(TAG, "ACTION_WAKEUP_SERVICE");
String szWinBoLLModel = intent.getStringExtra(WinBoLL.EXTRA_WINBOLLMODEL);
LogUtils.d(TAG, String.format("szWinBoLLModel %s", szWinBoLLModel));
if (szWinBoLLModel != null && !szWinBoLLModel.equals("")) {
String szAPPModel = intent.getStringExtra(WinBoll.EXTRA_APPMODEL);
LogUtils.d(TAG, String.format("szAPPModel %s", szAPPModel));
if (szAPPModel != null && !szAPPModel.equals("")) {
try {
WinBoLLModel bean = WinBoLLModel.parseStringToBean(szWinBoLLModel, WinBoLLModel.class);
APPModel bean = APPModel.parseStringToBean(szAPPModel, APPModel.class);
if (bean != null) {
String szAppPackageName = bean.getAppPackageName();
LogUtils.d(TAG, String.format("szAppPackageName %s", szAppPackageName));
@@ -71,7 +71,7 @@ public class APPNewsWidget extends AppWidgetProvider {
String appName = AppUtils.getAppNameByPackageName(context, szAppPackageName);
LogUtils.d(TAG, String.format("appName %s", appName));
WinBoLLNewsBean winBollNewsBean = new WinBoLLNewsBean(appName);
WinBollNewsBean winBollNewsBean = new WinBollNewsBean(appName);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String currentTime = sdf.format(new Date());
StringBuilder sbLine = new StringBuilder();
@@ -81,7 +81,7 @@ public class APPNewsWidget extends AppWidgetProvider {
sbLine.append(appName);
winBollNewsBean.setMessage(sbLine.toString());
addWinBoLLNewsBean(context, winBollNewsBean);
addWinBollNewsBean(context, winBollNewsBean);
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, APPNewsWidget.class));
@@ -99,24 +99,24 @@ public class APPNewsWidget extends AppWidgetProvider {
//
// 加入新报告信息
//
public synchronized static void addWinBoLLNewsBean(Context context, WinBoLLNewsBean bean) {
initWinBoLLNewsBeanList(context);
_WinBoLLNewsBeanList.add(0, bean);
public synchronized static void addWinBollNewsBean(Context context, WinBollNewsBean bean) {
initWinBollNewsBeanList(context);
_WinBollNewsBeanList.add(0, bean);
// 控制记录总数
while (_WinBoLLNewsBeanList.size() > _MAX_PAGES * _OnePageLinesCount) {
_WinBoLLNewsBeanList.remove(_WinBoLLNewsBeanList.size() - 1);
while (_WinBollNewsBeanList.size() > _MAX_PAGES * _OnePageLinesCount) {
_WinBollNewsBeanList.remove(_WinBollNewsBeanList.size() - 1);
}
WinBoLLNewsBean.saveBeanList(context, _WinBoLLNewsBeanList, WinBoLLNewsBean.class);
WinBollNewsBean.saveBeanList(context, _WinBollNewsBeanList, WinBollNewsBean.class);
}
synchronized static void initWinBoLLNewsBeanList(Context context) {
if (_WinBoLLNewsBeanList == null) {
_WinBoLLNewsBeanList = new ArrayList<WinBoLLNewsBean>();
WinBoLLNewsBean.loadBeanList(context, _WinBoLLNewsBeanList, WinBoLLNewsBean.class);
synchronized static void initWinBollNewsBeanList(Context context) {
if (_WinBollNewsBeanList == null) {
_WinBollNewsBeanList = new ArrayList<WinBollNewsBean>();
WinBollNewsBean.loadBeanList(context, _WinBollNewsBeanList, WinBollNewsBean.class);
}
if (_WinBoLLNewsBeanList == null) {
_WinBoLLNewsBeanList = new ArrayList<WinBoLLNewsBean>();
WinBoLLNewsBean.saveBeanList(context, _WinBoLLNewsBeanList, WinBoLLNewsBean.class);
if (_WinBollNewsBeanList == null) {
_WinBollNewsBeanList = new ArrayList<WinBollNewsBean>();
WinBollNewsBean.saveBeanList(context, _WinBollNewsBeanList, WinBollNewsBean.class);
}
}
@@ -141,11 +141,11 @@ public class APPNewsWidget extends AppWidgetProvider {
public static String getMessage() {
ArrayList<String> msgTemp = new ArrayList<String>();
if (_WinBoLLNewsBeanList != null) {
if (_WinBollNewsBeanList != null) {
int start = _OnePageLinesCount * _CurrentPageIndex;
start = _WinBoLLNewsBeanList.size() > start ? start : _WinBoLLNewsBeanList.size() - 1;
for (int i = start, j = 0; i < _WinBoLLNewsBeanList.size() && j < _OnePageLinesCount && start > -1; i++, j++) {
msgTemp.add(_WinBoLLNewsBeanList.get(i).getMessage());
start = _WinBollNewsBeanList.size() > start ? start : _WinBollNewsBeanList.size() - 1;
for (int i = start, j = 0; i < _WinBollNewsBeanList.size() && j < _OnePageLinesCount && start > -1; i++, j++) {
msgTemp.add(_WinBollNewsBeanList.get(i).getMessage());
}
String message = String.join("\n", msgTemp);
return message;
@@ -154,7 +154,7 @@ public class APPNewsWidget extends AppWidgetProvider {
}
public static void prePage(Context context) {
if (_WinBoLLNewsBeanList != null) {
if (_WinBollNewsBeanList != null) {
if (_CurrentPageIndex > 0) {
_CurrentPageIndex = _CurrentPageIndex - 1;
}
@@ -165,8 +165,8 @@ public class APPNewsWidget extends AppWidgetProvider {
}
public static void nextPage(Context context) {
if (_WinBoLLNewsBeanList != null) {
if ((_CurrentPageIndex + 1) * _OnePageLinesCount < _WinBoLLNewsBeanList.size()) {
if (_WinBollNewsBeanList != null) {
if ((_CurrentPageIndex + 1) * _OnePageLinesCount < _WinBollNewsBeanList.size()) {
_CurrentPageIndex = _CurrentPageIndex + 1;
}
Intent intentWidget = new Intent(context, APPNewsWidget.class);
@@ -176,11 +176,11 @@ public class APPNewsWidget extends AppWidgetProvider {
}
String getPageInfo() {
if (_WinBoLLNewsBeanList == null) {
if (_WinBollNewsBeanList == null) {
return "0/0";
}
int leftCount = _WinBoLLNewsBeanList.size() % _OnePageLinesCount;
int currentPageCount = _WinBoLLNewsBeanList.size() / _OnePageLinesCount + (leftCount == 0 ?0: 1);
int leftCount = _WinBollNewsBeanList.size() % _OnePageLinesCount;
int currentPageCount = _WinBollNewsBeanList.size() / _OnePageLinesCount + (leftCount == 0 ?0: 1);
return String.format("%d/%d", _CurrentPageIndex + 1, currentPageCount);
}
}

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#81C7F5"/> <!-- 浅蓝色填充 -->
<corners android:radius="8dp"/> <!-- 8dp 圆角 -->
</shape>

View File

@@ -8,4 +8,4 @@
android:fillColor="#ff000000"
android:pathData="M6.5,20Q4.22,20 2.61,18.43 1,16.85 1,14.58 1,12.63 2.17,11.1 3.35,9.57 5.25,9.15 5.88,6.85 7.75,5.43 9.63,4 12,4 14.93,4 16.96,6.04 19,8.07 19,11 20.73,11.2 21.86,12.5 23,13.78 23,15.5 23,17.38 21.69,18.69 20.38,20 18.5,20Z"/>
</vector>
</vector>

View File

@@ -8,4 +8,4 @@
android:fillColor="#ff000000"
android:pathData="M6.5,20Q4.22,20 2.61,18.43 1,16.85 1,14.58 1,12.63 2.17,11.1 3.35,9.57 5.25,9.15 5.88,6.85 7.75,5.43 9.63,4 12,4 14.93,4 16.96,6.04 19,8.07 19,11 20.73,11.2 21.86,12.5 23,13.78 23,15.5 23,17.38 21.69,18.69 20.38,20 18.5,20M6.5,18H18.5Q19.55,18 20.27,17.27 21,16.55 21,15.5 21,14.45 20.27,13.73 19.55,13 18.5,13H17V11Q17,8.93 15.54,7.46 14.08,6 12,6 9.93,6 8.46,7.46 7,8.93 7,11H6.5Q5.05,11 4.03,12.03 3,13.05 3,14.5 3,15.95 4.03,17 5.05,18 6.5,18M12,12Z"/>
</vector>
</vector>

View File

@@ -3,10 +3,9 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
android:layout_height="match_parent">
<android.widget.Toolbar
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toolbar"/>
@@ -17,47 +16,197 @@
android:layout_weight="1.0">
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_vertical"
android:spacing="12dp">
android:gravity="center">
<Button
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="应用崩溃测试"
android:textSize="16sp"
android:textColor="@android:color/white"
android:background="#81C7F5"
android:paddingVertical="12dp"
android:layout_marginHorizontal="24dp"
android:onClick="onCrashTest"
android:layout_margin="10dp"/>
android:layout_height="0dp"
android:layout_weight="1.0"
android:gravity="center_horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="应用日志测试"
android:textSize="16sp"
android:textColor="@android:color/white"
android:background="#81C7F5"
android:paddingVertical="12dp"
android:layout_marginHorizontal="24dp"
android:onClick="onLogTest"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, WinBoll!"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="应用吐司测试"
android:textSize="16sp"
android:textColor="@android:color/white"
android:background="#81C7F5"
android:paddingVertical="12dp"
android:layout_marginHorizontal="24dp"
android:onClick="onToastUtilsTest"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Android版本10的代号是“Q”API级别是29。 Android 10开始谷歌不再公开使用甜品作为版本代号但内部仍保留了大量与“Q”相关的元素。Android 10本身并没有严格对应某个特定的Java版本但在开发Android 10应用时通常可以使用Java 8或更高版本。 Java 8为Android开发带来了诸如Lambda表达式、方法引用等新特性能提高开发效率和代码可读性与Android 10开发适配良好。Java 9及更高版本也可用于Android 10开发能使用一些新的语言特性和API但可能需要注意兼容性和配置问题。"/>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:layout_width="wrap_content">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Debug Mode"
android:layout_weight="1.0"
android:onClick="onSwitchDebugMode"
android:id="@+id/activitymainCheckBox1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Application CrashReport"
android:textAllCaps="false"
android:onClick="onTestApplicationCrashReport"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PreviewGlobalCrashActivity"
android:textAllCaps="false"
android:onClick="onPreviewGlobalCrashActivity"/>
</LinearLayout>
</HorizontalScrollView>
<ScrollView
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StartCenter"
android:textAllCaps="false"
android:onClick="onStartCenter"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopCenter"
android:textAllCaps="false"
android:onClick="onStopCenter"/>
</LinearLayout>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SartTestDemoService"
android:textAllCaps="false"
android:onClick="onSartTestDemoService"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopTestDemoService"
android:textAllCaps="false"
android:onClick="onStopTestDemoService"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopTestDemoServiceNoSettings"
android:textAllCaps="false"
android:onClick="onStopTestDemoServiceNoSettings"/>
</LinearLayout>
</HorizontalScrollView>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SartTestDemoBindService"
android:textAllCaps="false"
android:onClick="onSartTestDemoBindService"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopTestDemoBindService"
android:textAllCaps="false"
android:onClick="onStopTestDemoBindService"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopTestDemoBindServiceNoSettings"
android:textAllCaps="false"
android:onClick="onStopTestDemoBindServiceNoSettings"/>
</LinearLayout>
</HorizontalScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestStopMainServiceWithoutSettingEnable"
android:textAllCaps="false"
android:onClick="onTestStopMainServiceWithoutSettingEnable"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestUseComponentStartService"
android:textAllCaps="false"
android:onClick="onTestUseComponentStartService"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestDemoServiceSOS"
android:textAllCaps="false"
android:onClick="onTestDemoServiceSOS"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestOpenNewActivity"
android:textAllCaps="false"
android:onClick="onTestOpenNewActivity"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toolbar"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NewActivity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CloseThisActivity"
android:textAllCaps="false"
android:onClick="onCloseThisActivity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CloseAllActivity"
android:textAllCaps="false"
android:onClick="onCloseAllActivity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New2Activity"
android:textAllCaps="false"
android:onClick="onNew2Activity"/>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toolbar"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New2Activity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CloseThisActivity"
android:textAllCaps="false"
android:onClick="onCloseThisActivity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CloseAllActivity"
android:textAllCaps="false"
android:onClick="onCloseAllActivity"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NewActivity"
android:textAllCaps="false"
android:onClick="onNewActivity"/>
</LinearLayout>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#FFFFFFFF">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right|center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/tv_title"
android:layout_weight="1.0"
android:text="WinBollNews"
android:textStyle="bold"
android:textSize="16sp"/>
<Button
android:layout_width="48dp"
android:layout_height="48dp"
android:text="⇦"
android:id="@+id/widget_button_pre"/>
<Button
android:layout_width="48dp"
android:layout_height="48dp"
android:text="⇨"
android:id="@+id/widget_button_next"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_msg"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/tv_news"
android:layout_weight="1.0"/>
</LinearLayout>

View File

@@ -1,8 +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:id="@+id/item_home"
android:title="WinBoLL Home"
android:icon="@drawable/ic_winboll"/>
</menu>

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AppBase</string>
<string name="tileservice_name">WinBoll</string>
</resources>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="200dp"
android:minHeight="100dp"
android:updatePeriodMillis="1000"
android:initialLayout="@layout/widget_news">
</appwidget-provider>

View File

@@ -1,35 +0,0 @@
# APPUtils
#### 介绍
应用开发工具套件类
#### 软件架构
适配安卓应用 [AIDE Pro] 的 Gradle 编译结构。
也适配安卓应用 [AndroidIDE] 的 Gradle 编译结构。
#### Gradle 编译说明
调试版编译命令 gradle assembleBetaDebug
阶段版编译命令 git pull && bash .winboll/bashPublishAPKAddTag.sh apputils
阶段版类库发布命令 git pull &&bash .winboll/bashPublishLIBAddTag.sh libapputils
#### 使用说明
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码 : ZhanGSKen(ZhanGSKen<zhangsken@188.com>)
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
#### 参考文档

View File

@@ -24,12 +24,12 @@ android {
defaultConfig {
applicationId "cc.winboll.studio.apputils"
minSdkVersion 26
targetSdkVersion 30
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置
// 项目模块目录的 build.gradle 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.10"
versionName "15.2"
if(true) {
versionName = genVersionName("${versionName}")
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Sep 29 01:16:05 HKT 2025
stageCount=3
#Sat Apr 26 16:55:12 GMT 2025
stageCount=2
libraryProject=libapputils
baseVersion=15.10
publishVersion=15.10.2
buildCount=0
baseBetaVersion=15.10.3
baseVersion=15.2
publishVersion=15.2.1
buildCount=1
baseBetaVersion=15.2.2

View File

@@ -2,20 +2,14 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="cc.winboll.studio.apputils">
<!-- 读取外部存储权限Android 10 以下) -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="@drawable/ic_winboll"
android:label="@string/app_name"
android:theme="@style/MyUtilsTheme"
android:supportsRtl="true"
android:resizeableActivity="true"
android:screenOrientation="unspecified"
android:requestLegacyExternalStorage="true">
android:supportsRtl="true">
<activity
android:name=".MainActivity"
@@ -41,8 +35,6 @@
<activity android:name=".QRCodeDecodeActivity"/>
<activity android:name=".QRGeneratorActivity"/>
</application>
</manifest>
</manifest>

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/12/08 15:10:51
* @Describe 全局应用类
*/

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2025/01/03 11:02:49
* @Describe 一个可以浏览随 APP 附带的 Html 文档的窗口
*/
@@ -15,11 +15,23 @@ import android.view.MenuItem;
import android.widget.Toolbar;
import cc.winboll.studio.apputils.R;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import cc.winboll.studio.libapputils.views.SimpleWebView;
import java.io.IOException;
import java.io.InputStream;
public class AssetsHtmlActivity extends Activity {
public class AssetsHtmlActivity extends WinBollActivityBase implements IWinBollActivity {
@Override
public Activity getActivity() {
return super.getActivity();
}
@Override
public String getTag() {
return TAG;
}
public static final String TAG = "AssetsHtmlActivity";
@@ -31,7 +43,12 @@ public class AssetsHtmlActivity extends Activity {
// Assets 文件夹里的 Html 文件的名称
String mszHtmlFileName;
//
// @Override
// public Activity getActivity() {
// return this;
// }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu);
@@ -40,7 +57,7 @@ public class AssetsHtmlActivity extends Activity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// if (item.getItemId() == android.R.id.home) {
// WinBoLLActivityManager.getInstance(this).finish(this);
// WinBollActivityManager.getInstance(this).finish(this);
// }
return super.onOptionsItemSelected(item);
}

View File

@@ -15,10 +15,9 @@ import android.widget.Toolbar;
import cc.winboll.studio.apputils.R;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.LogView;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import java.util.List;
import java.util.Set;
import cc.winboll.studio.libappbase.LogActivity;
final public class MainActivity extends Activity {
@@ -27,21 +26,21 @@ final public class MainActivity extends Activity {
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
Toolbar mToolbar;
//LogView mLogView;
LogView mLogView;
//
// @Override
// public Activity getActivity() {
// return this;
// }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// mLogView = findViewById(R.id.logview);
// mLogView.start();
mLogView = findViewById(R.id.logview);
mLogView.start();
// 初始化工具栏
mToolbar = findViewById(R.id.toolbar);
@@ -61,9 +60,9 @@ final public class MainActivity extends Activity {
//if (prosessIntents(getIntent())) return;
// 以下正常创建主窗口
// // 设置 WinBoLL 应用 UI 类型
// WinBoLLApplication.setWinBoLLUI_TYPE(WinBoLLApplication.WinBoLLUI_TYPE.Aplication);
// //ToastUtils.show("WinBoLLUI_TYPE " + WinBoLLApplication.getWinBoLLUI_TYPE());
// // 设置 WinBoll 应用 UI 类型
// WinBollApplication.setWinBollUI_TYPE(WinBollApplication.WinBollUI_TYPE.Aplication);
// //ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
// LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
}
@@ -78,7 +77,7 @@ final public class MainActivity extends Activity {
if (intent.getAction() != null) {
// if (intent.getAction().equals(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW)) {
// App.setIsDebug(true);
// //ToastUtils.show!("WinBoLLApplication.setIsDebug(true) by action : " + intent.getAction());
// //ToastUtils.show!("WinBollApplication.setIsDebug(true) by action : " + intent.getAction());
//
// }
}
@@ -131,12 +130,12 @@ final public class MainActivity extends Activity {
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// 缓存当前 activity
//WinBoLLActivityManager.getInstance(this).add(this);
//WinBollActivityManager.getInstance(this).add(this);
}
@Override
public void onDestroy() {
//WinBoLLActivityManager.getInstance(this).registeRemove(this);
//WinBollActivityManager.getInstance(this).registeRemove(this);
super.onDestroy();
}
@@ -146,21 +145,13 @@ final public class MainActivity extends Activity {
}
public void onTestLogActivity(View view) {
/* 分屏代码有效
// 1. 创建启动 SecondActivity 的 Intent
Intent splitIntent = new Intent(MainActivity.this, LogActivity.class);
// Intent intent = new Intent(this, LogActivity.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
// startActivity(intent);
// 2. 添加分屏启动必需的两个标志API 30 兼容)
// FLAG_ACTIVITY_LAUNCH_ADJACENT相邻分屏显示
// FLAG_ACTIVITY_NEW_TASK分屏需要新任务栈
splitIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT
| Intent.FLAG_ACTIVITY_NEW_TASK);
// 3. 启动分屏活动(若设备不支持分屏,会默认全屏启动)
startActivity(splitIntent);
*/
LogActivity.startLogActivity(this);
//WinBollActivityManager.getInstance().printAvtivityListInfo();
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
}
//
@@ -174,7 +165,7 @@ final public class MainActivity extends Activity {
// if (intent.getAction().equals(StringToQrCodeView.ACTION_UNITTEST_QRCODE)) {
// try {
// WinBoLLActivity clazzActivity = UnitTestActivity.class.newInstance();
// WinBollActivity clazzActivity = UnitTestActivity.class.newInstance();
// String tag = clazzActivity.getTag();
// LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag);
// Intent subIntent = new Intent(this, UnitTestActivity.class);
@@ -192,8 +183,8 @@ final public class MainActivity extends Activity {
// }
//
// Files.copy(Paths.get(szSrcPath), Paths.get(file.getPath()));
// //startWinBoLLActivity(subIntent, tag);
// WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(this, subIntent, UnitTestActivity.class);
// //startWinBollActivity(subIntent, tag);
// WinBollActivityManager.getInstance(this).startWinBollActivity(this, subIntent, UnitTestActivity.class);
// } catch (IllegalAccessException | InstantiationException | IOException e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// // 函数处理异常返回失败
@@ -210,8 +201,8 @@ final public class MainActivity extends Activity {
public boolean onCreateOptionsMenu(Menu menu) {
//ToastUtils.show("onCreateOptionsMenu");
getMenuInflater().inflate(R.menu.toolbar_main, menu);
// if (isAddWinBoLLToolBar()) {
// //ToastUtils.show("mIWinBoLL.isAddWinBoLLToolBar()");
// if (isAddWinBollToolBar()) {
// //ToastUtils.show("mIWinBoll.isAddWinBollToolBar()");
// getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
// }
if (App.isDebuging()) {
@@ -226,9 +217,10 @@ final public class MainActivity extends Activity {
if (item.getItemId() == R.id.item_exit) {
//exit();
return true;
} else if (item.getItemId() == R.id.item_testqrgeneratoractivity) {
Intent intent = new Intent(this, QRGeneratorActivity.class);
startActivity(intent);
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
Intent intent = new Intent(this, TestStringToQRCodeViewActivity.class);
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
@@ -238,13 +230,13 @@ final public class MainActivity extends Activity {
}
return true;
} else if (item.getItemId() == R.id.item_log) {
//WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(this, LogActivity.class);
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
return true;
} else if (item.getItemId() == R.id.item_exitdebug) {
//AboutView.setApp2NormalMode(this);
return true;
} else if (item.getItemId() == android.R.id.home) {
//WinBoLLActivityManager.getInstance(this).finish(this);
//WinBollActivityManager.getInstance(this).finish(this);
return true;
}
return super.onOptionsItemSelected(item);
@@ -255,7 +247,7 @@ final public class MainActivity extends Activity {
//
// @Override
// public void onYes() {
// //WinBoLLActivityManager.getInstance(getApplicationContext()).finishAll();
// //WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
// }
//
// @Override
@@ -268,28 +260,28 @@ final public class MainActivity extends Activity {
@Override
public void onBackPressed() {
// if (WinBoLLActivityManager.getInstance(getApplicationContext()).isFirstIWinBoLLActivity(this)) {
// if (WinBollActivityManager.getInstance(getApplicationContext()).isFirstIWinBollActivity(this)) {
// exit();
// } else {
// WinBoLLActivityManager.getInstance(this).finish(this);
// WinBollActivityManager.getInstance(this).finish(this);
// super.onBackPressed();
// }
}
public void onTestAssetsHtmlActivity(View view) {
Intent intent = new Intent(this, AssetsHtmlActivity.class);
intent.putExtra(AssetsHtmlActivity.EXTRA_HTMLFILENAME, "javascript_test.html");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
startActivity(intent);
//WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(this, intent, AssetsHtmlActivity.class);
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
}
@Override
protected void onResume() {
super.onResume();
//mLogView.start();
mLogView.start();
}
/*@Override

View File

@@ -1,323 +1,89 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2025/01/18 10:32:21
* @Describe 二维码解码窗口
* @Describe 二维码扫码解码窗口
*/
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toolbar;
import cc.winboll.studio.apputils.R;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.NotFoundException;
import com.google.zxing.RGBLuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
import com.google.zxing.common.HybridBinarizer;
import com.journeyapps.barcodescanner.BarcodeCallback;
import com.journeyapps.barcodescanner.BarcodeResult;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.DefaultDecoderFactory;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
public class QRCodeDecodeActivity extends Activity {
public static final String TAG = "QRCodeDecodeActivity";
public static final String EXTRA_RESULT = "EXTRA_RESULT";
private static final int REQUEST_CAMERA_PERMISSION = 1;
private static final int REQUEST_PICK_IMAGE = 2;
private static final int REQUEST_READ_STORAGE_PERMISSION = 3;
// 图片压缩阈值超过1000px时压缩避免内存溢出和解码效率低
private static final int MAX_BITMAP_SIZE = 1000;
private TextView resultTextView;
private DecoratedBarcodeView barcodeView;
private Button btnDecodeFromAlbum;
TextView resultTextView;
DecoratedBarcodeView barcodeView;
// @Override
// public Activity getActivity() {
// return this;
// }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrcodedecode);
initToolbar();
initViews();
checkCameraPermission();
setAlbumDecodeClickListener();
}
private void initToolbar() {
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
if (mToolbar != null) {
setActionBar(mToolbar);
if (getActionBar() != null) {
getActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
}
// 初始化工具栏
// Toolbar mToolbar = findViewById(R.id.toolbar);
// setActionBar(mToolbar);
private void initViews() {
resultTextView = (TextView) findViewById(R.id.activityqrcodedecodeTextView1);
barcodeView = (DecoratedBarcodeView) findViewById(R.id.activityqrcodedecodeDecoratedBarcodeView1);
btnDecodeFromAlbum = (Button) findViewById(R.id.btn_decode_from_album);
// 初始化扫码解码器支持所有常见码制避免仅支持QR_CODE的局限
List<BarcodeFormat> formats = new ArrayList<BarcodeFormat>();
formats.add(BarcodeFormat.QR_CODE);
formats.add(BarcodeFormat.CODE_128);
formats.add(BarcodeFormat.EAN_13);
barcodeView.getBarcodeView().setDecoderFactory(new DefaultDecoderFactory(formats));
}
private void setAlbumDecodeClickListener() {
btnDecodeFromAlbum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkSelfPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE},
REQUEST_READ_STORAGE_PERMISSION);
} else {
openAlbum();
}
}
});
}
private void openAlbum() {
Intent pickImageIntent = new Intent(Intent.ACTION_PICK);
pickImageIntent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
startActivityForResult(pickImageIntent, REQUEST_PICK_IMAGE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_PICK_IMAGE && resultCode == RESULT_OK && data != null) {
Uri selectedImageUri = data.getData();
if (selectedImageUri != null) {
try {
// 1. 读取图片并压缩(关键优化:避免大图片解码失败)
InputStream imageStream = getContentResolver().openInputStream(selectedImageUri);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true; // 先获取图片尺寸,不加载像素
BitmapFactory.decodeStream(imageStream, null, options);
imageStream.close(); // 关闭流,重新读取
// 计算压缩比例超过MAX_BITMAP_SIZE时按比例压缩
options.inSampleSize = calculateInSampleSize(options, MAX_BITMAP_SIZE, MAX_BITMAP_SIZE);
options.inJustDecodeBounds = false; // 开始加载压缩后的像素
imageStream = getContentResolver().openInputStream(selectedImageUri);
Bitmap originalBitmap = BitmapFactory.decodeStream(imageStream, null, options);
imageStream.close();
if (originalBitmap == null) {
showToast("图片损坏,无法解析");
return;
}
// 2. 图片预处理:转为灰度图+提高对比度(解决模糊/低对比度图片识别问题)
Bitmap processedBitmap = processBitmap(originalBitmap);
// 3. 解码预处理后的图片
String decodeResult = decodeQrFromBitmap(processedBitmap);
// 4. 结果处理
if (decodeResult != null && !decodeResult.isEmpty()) {
resultTextView.setText("图片解码结果:" + decodeResult);
showDecodeResultDialog(decodeResult);
returnResultToPreviousPage(decodeResult);
} else {
// 尝试直接解码原图(防止预处理过度导致识别失败)
String originalResult = decodeQrFromBitmap(originalBitmap);
if (originalResult != null && !originalResult.isEmpty()) {
resultTextView.setText("图片解码结果:" + originalResult);
showDecodeResultDialog(originalResult);
returnResultToPreviousPage(originalResult);
} else {
new AlertDialog.Builder(this)
.setTitle("解码失败")
.setMessage("图片中未识别到二维码/条码,建议选择清晰、完整的图片")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.show();
}
}
// 回收Bitmap避免内存泄漏
if (!originalBitmap.isRecycled()) originalBitmap.recycle();
if (!processedBitmap.isRecycled() && processedBitmap != originalBitmap) {
processedBitmap.recycle();
}
} catch (Exception e) {
e.printStackTrace();
showToast("图片处理失败:" + e.getMessage());
}
} else {
showToast("未选择图片");
}
}
}
/**
* 核心优化1计算图片压缩比例
*/
private int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
final int halfHeight = height / 2;
final int halfWidth = width / 2;
// 找到最接近reqWidth/reqHeight的压缩比例2的倍数保证图片质量
while ((halfHeight / inSampleSize) >= reqHeight
&& (halfWidth / inSampleSize) >= reqWidth) {
inSampleSize *= 2;
}
}
return inSampleSize;
}
/**
* 核心优化2图片预处理灰度化+提高对比度)
* 解决模糊、低亮度、低对比度图片识别率低的问题
*/
private Bitmap processBitmap(Bitmap bitmap) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
// 创建灰度图
Bitmap grayBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(grayBitmap);
Paint paint = new Paint();
// 1. 灰度化矩阵
ColorMatrix grayMatrix = new ColorMatrix();
grayMatrix.setSaturation(0); // 饱和度设为0转为灰度
// 2. 提高对比度矩阵alpha=1.5,亮度=0可根据需求调整
ColorMatrix contrastMatrix = new ColorMatrix();
contrastMatrix.set(new float[]{
1.5f, 0, 0, 0, 0, // 红通道对比度
0, 1.5f, 0, 0, 0, // 绿通道对比度
0, 0, 1.5f, 0, 0, // 蓝通道对比度
0, 0, 0, 1f, 0 // alpha通道不变
});
// 合并灰度+对比度矩阵
ColorMatrix combinedMatrix = new ColorMatrix();
combinedMatrix.postConcat(grayMatrix);
combinedMatrix.postConcat(contrastMatrix);
paint.setColorFilter(new ColorMatrixColorFilter(combinedMatrix));
canvas.drawBitmap(bitmap, 0, 0, paint);
return grayBitmap;
}
/**
* 核心优化3修复解码参数支持更多场景
*/
private String decodeQrFromBitmap(Bitmap bitmap) {
if (bitmap == null) return null;
try {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
bitmap.getPixels(pixels, 0, width, 0, 0, width, height);
// 修复1使用RGBLuminanceSource避免YUV格式导致的颜色偏差
LuminanceSource source = new RGBLuminanceSource(width, height, pixels);
BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));
// 修复2完善解码参数解决模糊、变形二维码识别问题
Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
// 支持所有常见码制不仅限于QR_CODE
List<BarcodeFormat> formats = new ArrayList<BarcodeFormat>();
formats.add(BarcodeFormat.QR_CODE);
formats.add(BarcodeFormat.CODE_128);
formats.add(BarcodeFormat.EAN_8);
formats.add(BarcodeFormat.EAN_13);
hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);
// 字符编码:支持中文等多语言
hints.put(DecodeHintType.CHARACTER_SET, "UTF-8");
// 容错模式:允许二维码有一定损坏(关键!解决轻微变形/污染的二维码)
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
// 不使用纯条码模式兼容带logo的二维码
hints.put(DecodeHintType.PURE_BARCODE, Boolean.FALSE);
MultiFormatReader reader = new MultiFormatReader();
reader.setHints(hints);
Result result = reader.decode(binaryBitmap);
return result.getText();
} catch (NotFoundException e) {
// 正常未识别到,不打印异常(避免日志冗余)
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
// ==================== 原有逻辑(不变) ====================
private void checkCameraPermission() {
if (checkSelfPermission(android.Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{android.Manifest.permission.CAMERA},
REQUEST_CAMERA_PERMISSION);
} else {
startScanning();
}
//resultTextView = findViewById(R.id.activityqrcodedecodeTextView1);
barcodeView = findViewById(R.id.activityqrcodedecodeDecoratedBarcodeView1);
// 请求相机权限
// if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
// != PackageManager.PERMISSION_GRANTED) {
// ActivityCompat.requestPermissions(this,
// new String[]{android.Manifest.permission.CAMERA},
// REQUEST_CAMERA_PERMISSION);
// } else {
// startScanning();
// }
startScanning();
}
private void startScanning() {
barcodeView.getBarcodeView().setDecoderFactory(null);
barcodeView.decodeContinuous(barcodeCallback);
}
private BarcodeCallback barcodeCallback = new BarcodeCallback() {
@Override
public void onRequestPermissionsResult(int requestCode,
String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_CAMERA_PERMISSION) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startScanning();
} else {
// 权限被拒绝的处理
}
}
}
BarcodeCallback barcodeCallback = new BarcodeCallback(){
@Override
public void barcodeResult(BarcodeResult result) {
if (result != null && result.getText() != null) {
if (result.getText() != null) {
//Toast.makeText(MainActivity.this, "Scanned: " + result.getText(), Toast.LENGTH_SHORT).show();
//ToastUtils.show("Scanned: " + result.getText());
barcodeView.pause();
String decodeResult = result.getText();
resultTextView.setText("扫码结果:" + decodeResult);
showDecodeResultDialog(decodeResult);
returnResultToPreviousPage(decodeResult);
Intent intent = new Intent();
intent.putExtra(EXTRA_RESULT, result.getText());
setResult(RESULT_OK, intent);
finish();
}
}
@@ -326,111 +92,16 @@ public class QRCodeDecodeActivity extends Activity {
}
};
private void showDecodeResultDialog(String result) {
ScrollView scrollView = new ScrollView(this);
scrollView.setPadding(dip2px(16), dip2px(16), dip2px(16), dip2px(16));
TextView dialogTv = new TextView(this);
dialogTv.setTextSize(16);
dialogTv.setTextColor(getResources().getColor(android.R.color.black));
dialogTv.setText(result);
scrollView.addView(dialogTv);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("解码结果");
builder.setView(scrollView);
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
barcodeView.resume();
}
});
builder.setCancelable(false);
builder.show();
}
private void returnResultToPreviousPage(String result) {
Intent intent = new Intent();
intent.putExtra(EXTRA_RESULT, result);
setResult(RESULT_OK, intent);
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == REQUEST_CAMERA_PERMISSION) {
if (grantResults != null && grantResults.length > 0) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startScanning();
} else {
new AlertDialog.Builder(this)
.setTitle("权限申请")
.setMessage("扫码需要相机权限,请在设置中开启")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
})
.setCancelable(false)
.show();
}
}
} else if (requestCode == REQUEST_READ_STORAGE_PERMISSION) {
if (grantResults != null && grantResults.length > 0) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
openAlbum();
} else {
new AlertDialog.Builder(this)
.setTitle("权限申请")
.setMessage("从相册解码需要存储权限,请在设置中开启")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setCancelable(false)
.show();
}
}
}
}
@Override
protected void onResume() {
super.onResume();
if (barcodeView != null) {
barcodeView.resume();
}
barcodeView.resume();
}
@Override
protected void onPause() {
super.onPause();
if (barcodeView != null) {
barcodeView.pause();
}
}
private int dip2px(float dpValue) {
final float scale = getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
@Override
public boolean onOptionsItemSelected(android.view.MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
private void showToast(String message) {
android.widget.Toast.makeText(this, message, android.widget.Toast.LENGTH_SHORT).show();
barcodeView.pause();
}
}

View File

@@ -1,97 +0,0 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
* @Date 2025/09/22 07:09
* @Describe 二维码生成窗口
*/
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.journeyapps.barcodescanner.BarcodeEncoder;
public class QRGeneratorActivity extends Activity {
public static final String TAG = "QrGeneratorActivity";
// 控件引用
private EditText etInputText;
private ImageView ivQrPreview;
private Button btnGenerateQr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrgenerator);
// 初始化控件
initViews();
// 设置按钮点击事件
setGenerateClickListener();
}
/**
* 初始化布局控件
*/
private void initViews() {
etInputText = findViewById(R.id.et_input_text);
ivQrPreview = findViewById(R.id.iv_qr_preview);
btnGenerateQr = findViewById(R.id.btn_generate_qr);
}
/**
* 设置生成按钮点击事件:获取输入文字 → 生成二维码 → 显示到 ImageView
*/
private void setGenerateClickListener() {
btnGenerateQr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// 1. 获取输入框文字(去除前后空格)
String inputText = etInputText.getText().toString().trim();
// 2. 空输入判断
if (inputText.isEmpty()) {
Toast.makeText(QRGeneratorActivity.this, "请先输入要生成二维码的文字", Toast.LENGTH_SHORT).show();
return;
}
// 3. 生成二维码 Bitmap宽高 500px可调整
Bitmap qrBitmap = generateQrCodeBitmap(inputText, 500, 500);
// 4. 显示二维码到 ImageView
if (qrBitmap != null) {
ivQrPreview.setImageBitmap(qrBitmap);
} else {
Toast.makeText(QRGeneratorActivity.this, "二维码生成失败,请重试", Toast.LENGTH_SHORT).show();
}
}
});
}
/**
* 核心方法:生成二维码 Bitmap
* @param content 二维码内容(输入的文字)
* @param width 二维码宽度px
* @param height 二维码高度px
* @return 生成的二维码 Bitmap失败返回 null
*/
private Bitmap generateQrCodeBitmap(String content, int width, int height) {
try {
// 初始化二维码编码器(指定格式为 QR_CODE
BarcodeEncoder encoder = new BarcodeEncoder();
// 生成二维码 Bitmap参数内容、格式、宽、高
return encoder.encodeBitmap(content, BarcodeFormat.QR_CODE, width, height);
} catch (WriterException e) {
// 生成失败(如内容过长、宽高非法),打印异常信息
e.printStackTrace();
return null;
}
}
}

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/23 16:14:45
*/
import android.app.Activity;

View File

@@ -0,0 +1,36 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2025/01/17 19:50:46
*/
import android.app.Activity;
import android.os.Bundle;
import android.widget.Toolbar;
import cc.winboll.studio.apputils.R;
import cc.winboll.studio.libapputils.views.StringToQrCodeView;
public class TestStringToQRCodeViewActivity extends Activity {
public static final String TAG = "TestStringToQrCodeViewActivity";
StringToQrCodeView mStringToQrCodeView;
//
// @Override
// public Activity getActivity() {
// return this;
// }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teststringtoqrcodeview);
// 初始化工具栏
Toolbar mToolbar = findViewById(R.id.toolbar);
mToolbar.setSubtitle(TAG);
setActionBar(mToolbar);
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
}
}

View File

@@ -1,14 +0,0 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2025/05/13 11:15
* @Describe WinBoLLActivity
*/
import android.app.Activity;
public class WinBoLLActivity extends Activity {
public static final String TAG = "WinBoLLActivity";
}

View File

@@ -0,0 +1,52 @@
package cc.winboll.studio.apputils;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 17:11:37
* @Describe 应用活动窗口基类
*/
import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
public class WinBollActivityBase extends AppCompatActivity implements IWinBollActivity {
public static final String TAG = "WinBollActivityBase";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
WinBollActivityManager getWinBollActivityManager() {
return WinBollActivityManager.getInstance(GlobalApplication.getInstance());
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWinBollActivityManager().add(this);
}
@Override
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
super.onPostCreate(savedInstanceState, persistentState);
}
@Override
protected void onDestroy() {
super.onDestroy();
getWinBollActivityManager().registeRemove(this);
}
}

View File

@@ -54,6 +54,13 @@
</LinearLayout>
<cc.winboll.studio.libappbase.LogView
android:layout_width="match_parent"
android:layout_height="0dp"
android:text="Button"
android:id="@+id/logview"
android:layout_weight="1.0"/>
</LinearLayout>
</LinearLayout>

View File

@@ -1,43 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">
<!-- 工具栏(原有) -->
<Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<!-- 扫码控件(原有) -->
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/activityqrcodedecodeDecoratedBarcodeView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<!-- 新增:从相册解码按钮 -->
<Button
android:id="@+id/btn_decode_from_album"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="从相册选图解码"
android:textSize="16sp"
android:textColor="@android:color/white"
android:background="#2196F3"
android:paddingVertical="12dp"
android:layout_margin="16dp"/>
<!-- 结果显示TextView原有 -->
<TextView
android:id="@+id/activityqrcodedecodeTextView1"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="等待扫码或选择图片..."
android:textSize="16sp"/>
android:text="QRCodeDecodeActivity"/>
<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/activityqrcodedecodeDecoratedBarcodeView1"/>
</LinearLayout>

View File

@@ -1,45 +0,0 @@
<?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="top|center_horizontal">
<!-- 文字输入框 -->
<EditText
android:id="@+id/et_input_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入要生成二维码的文字"
android:inputType="textMultiLine"
android:minLines="3"
android:maxLines="5"
android:padding="12dp"
android:background="@android:drawable/editbox_background_normal"
android:layout_marginBottom="16dp"/>
<!-- 生成二维码按钮 -->
<Button
android:id="@+id/btn_generate_qr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="生成二维码"
android:textSize="16sp"
android:background="#4CAF50"
android:textColor="@android:color/white"
android:paddingVertical="12dp"
android:layout_marginBottom="24dp"/>
<!-- 二维码预览图片 -->
<ImageView
android:id="@+id/iv_qr_preview"
android:layout_width="280dp"
android:layout_height="280dp"
android:scaleType="fitCenter"
android:background="@android:drawable/dialog_holo_light_frame"
android:contentDescription="二维码预览"/>
</LinearLayout>

View File

@@ -2,8 +2,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/item_testqrgeneratoractivity"
android:title="TestQRGeneratorActivity"/>
android:id="@+id/item_teststringtoqrcodeview"
android:title="TestStringToQRCodeViewActivity"/>
<item
android:id="@+id/item_testqrcodedecodeactivity"
android:title="TestQRCodeDecodeActivity"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- WinBoLL 默认方案 -->
<!-- WinBoll 默认方案 -->
<color name="colorPrimary">#FF196ABC</color>
<color name="colorPrimaryDark">#FF002B57</color>
<color name="colorAccent">#FF80BFFF</color>

View File

@@ -1,35 +0,0 @@
# AutoInstaller
#### 介绍
APK 文件监控,监控指定文件路径的 APK 文件。
在 APK 文件改变后自动调用系统安装命令安装,或者调用[应用信息查看器]打开。
#### 软件架构
适配安卓应用 [AIDE Pro] 的 Gradle 编译结构。
也适配安卓应用 [AndroidIDE] 的 Gradle 编译结构。
#### Gradle 编译说明
调试版编译命令 gradle assembleBetaDebug
阶段版编译命令 bash .winboll/bashPublishAPKAddTag.sh autoinstaller
#### 使用说明
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码 : ZhanGSKen(ZhanGSKen<zhangsken@188.com>)
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
#### 参考文档

View File

@@ -19,7 +19,7 @@ def genVersionName(def versionName){
android {
compileSdkVersion 32
buildToolsVersion "32.0.0"
buildToolsVersion "33.0.3"
defaultConfig {
applicationId "cc.winboll.studio.autoinstaller"
@@ -29,7 +29,7 @@ android {
// versionName 更新后需要手动设置
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
versionName "15.2"
versionName "5.0"
if(true) {
versionName = genVersionName("${versionName}")
}
@@ -41,33 +41,30 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api 'cc.winboll.studio:libaes:15.6.0'
api 'cc.winboll.studio:libapputils:15.3.4'
api 'cc.winboll.studio:libappbase:15.7.6'
// SSH
api 'com.jcraft:jsch:0.1.55'
// Html 解析
api 'org.jsoup:jsoup:1.13.1'
// 二维码类库
api 'com.google.zxing:core:3.4.1'
api 'com.journeyapps:zxing-android-embedded:3.6.0'
// 应用介绍页类库
api 'cc.winboll.studio:winboll-shared:1.1.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'
// AndroidX 类库
api 'androidx.appcompat:appcompat:1.1.0'
api 'com.google.android.material:material:1.4.0'
//api 'androidx.viewpager:viewpager:1.0.0'
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
//api 'androidx.fragment:fragment:1.1.0'
api 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.fragment:fragment:1.0.0'
api 'com.google.android.material:material:1.0.0'
api 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
api 'androidx.lifecycle:lifecycle-livedata:1.0.0'
//api 'cc.winboll.studio:libaes:6.3.2'
//api 'cc.winboll.studio:libapputils:8.3.8'
api fileTree(dir: 'libs', include: ['*.jar'])
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Tue Jun 24 09:54:47 HKT 2025
stageCount=3
#Thu Jan 02 02:39:56 HKT 2025
stageCount=4
libraryProject=
baseVersion=15.2
publishVersion=15.2.2
baseVersion=5.0
publishVersion=5.0.3
buildCount=0
baseBetaVersion=15.2.3
baseBetaVersion=5.0.4

View File

@@ -23,8 +23,6 @@
<!-- MANAGE_EXTERNAL_STORAGE -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<application
android:name=".App"
@@ -35,7 +33,7 @@
android:persistent="true"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/MyAppTheme">
android:theme="@style/Theme.Application">
<activity
android:name=".MainActivity"
@@ -56,21 +54,6 @@
<service android:name=".services.AssistantService"/>
<service
android:name=".AppBaseTileService"
android:exported="true"
android:label="@string/tileservice_name"
android:icon="@drawable/ic_launcher"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
<receiver
android:name=".receivers.MainReceiver"
android:enabled="true"

View File

@@ -1,28 +1,27 @@
package cc.winboll.studio.autoinstaller;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/04/28 02:39:58
* @Describe 全局应用类
*/
import android.view.Gravity;
import cc.winboll.studio.libappbase.GlobalApplication;
import com.hjq.toast.ToastUtils;
import com.hjq.toast.style.WhiteToastStyle;
import cc.winboll.studio.shared.app.WinBollApplication;
public class App extends GlobalApplication {
public class App extends WinBollApplication {
public static final String TAG = "App";
@Override
public void onCreate() {
super.onCreate();
setIsDebug(BuildConfig.DEBUG);
// 初始化 Toast 框架
ToastUtils.init(this);
// 设置 Toast 布局样式
//ToastUtils.setView(R.layout.view_toast);
ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setView(R.layout.toast_custom_view);
//ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
}
}

View File

@@ -1,12 +0,0 @@
package cc.winboll.studio.autoinstaller;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2025/04/15 09:24:46
* @Describe 磁贴工具服务类
*/
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import cc.winboll.studio.autoinstaller.models.AppConfigs;

View File

@@ -1,7 +1,7 @@
package cc.winboll.studio.autoinstaller;
import android.os.FileObserver;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.shared.log.LogUtils;
public class FileListener extends FileObserver {
public final static String TAG = "FileListener";

View File

@@ -6,24 +6,21 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.SimpleAdapter;
import android.widget.Switch;
import android.widget.TextClock;
import android.widget.Toast;
import androidx.core.content.FileProvider;
import cc.winboll.studio.shared.log.LogUtils;
import cc.winboll.studio.shared.log.LogView;
import cc.winboll.studio.autoinstaller.MainActivity;
import cc.winboll.studio.autoinstaller.models.APKModel;
import cc.winboll.studio.autoinstaller.models.AppConfigs;
import cc.winboll.studio.autoinstaller.beans.AppConfigs;
import cc.winboll.studio.autoinstaller.services.MainService;
import cc.winboll.studio.autoinstaller.utils.NotificationUtil;
import cc.winboll.studio.autoinstaller.utils.PackageUtil;
import cc.winboll.studio.autoinstaller.views.ListViewForScrollView;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.LogView;
import com.hjq.toast.ToastUtils;
import java.io.File;
import java.util.ArrayList;
@@ -33,13 +30,8 @@ import java.util.Map;
public class MainActivity extends Activity {
public static final String TAG = "MainActivity";
public static final int MSG_UPDATE_STATUS = 0;
private static final int INSTALL_PERMISSION_CODE = 1;
static MainActivity _MainActivity;
ArrayList<APKModel> _APKModelList = new ArrayList<APKModel>();
LogView mLogView;
TextClock mTextClock;
EditText mEditText;
@@ -68,11 +60,9 @@ public class MainActivity extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
_MainActivity = this;
initView();
String action = getIntent().getAction();
if ((action != null) && action.equals(ACTION_NEW_INSTALLTASK)) {
if (getIntent().getAction().equals(ACTION_NEW_INSTALLTASK)) {
mszInstalledPackageName = getIntent().getStringExtra(EXTRA_INSTALLED_PACKAGENAME);
mszInstalledAPKFilePath = getIntent().getStringExtra(EXTRA_INSTALLED_APKFILEPATH);
installAPK();
@@ -86,7 +76,11 @@ public class MainActivity extends Activity {
mLogView = findViewById(R.id.logview);
mLogView.start();
AppConfigs appConfigs = AppConfigs.getInstance(this).loadAppConfigs(this);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(this);
if (appConfigs == null) {
appConfigs = new AppConfigs();
AppConfigs.saveAppConfigs(this, appConfigs);
}
if (appConfigs.getSetupMode() == AppConfigs.SetupMode.WATCHOUTPUTINSTALLER) {
((RadioButton)findViewById(R.id.activitymainRadioButton1)).setChecked(true);
@@ -137,44 +131,23 @@ public class MainActivity extends Activity {
}
String getLastApkPackageName() {
APKModel.loadBeanList(this, _APKModelList, APKModel.class);
if (_APKModelList.size() > 0) {
return _APKModelList.get(_APKModelList.size() - 1).getApkPackageName();
}
return "";
}
public void onOpenAPP(View view) {
String szInstalledPackageName = getLastApkPackageName();
LogUtils.d(TAG, "szInstalledPackageName : " + szInstalledPackageName);
if (szInstalledPackageName.trim().equals("")) {
if (mszInstalledPackageName.trim().equals("")) {
ToastUtils.show("Installed APP package name is null.");
return;
}
PackageUtil.openAPP(this, szInstalledPackageName);
Intent intent = getPackageManager().getLaunchIntentForPackage(mszInstalledPackageName);
if (intent != null) {
startActivity(intent);
} else {
// 若没能获取到启动意图,可进行相应提示等操作,比如跳转到应用商店让用户下载该应用(示例)
Intent marketIntent = new Intent(Intent.ACTION_VIEW);
marketIntent.setData(Uri.parse("market://details?id=" + mszInstalledPackageName));
startActivity(marketIntent);
}
}
// public void onOpenAPP(View view) {
// String szInstalledPackageName = getLastApkPackageName();
// if (szInstalledPackageName.trim().equals("")) {
// ToastUtils.show("Installed APP package name is null.");
// return;
// }
//
// Intent intent = getPackageManager().getLaunchIntentForPackage(mszInstalledPackageName);
// if (intent != null) {
// //ToastUtils.show("startActivity");
// startActivity(intent);
// } else {
// // 若没能获取到启动意图,可进行相应提示等操作,比如跳转到应用商店让用户下载该应用(示例)
// Intent marketIntent = new Intent(Intent.ACTION_VIEW);
// marketIntent.setData(Uri.parse("market://details?id=" + mszInstalledPackageName));
// startActivity(marketIntent);
// }
// }
public void onInstallAPK(View view) {
installAPK();
}
@@ -212,22 +185,17 @@ public class MainActivity extends Activity {
}
public void onLockPath(View view) {
AppConfigs appConfigs = AppConfigs.loadAppConfigs(this);
Switch sw = (Switch)view;
setMainServiceStatus(sw.isChecked());
}
public void setMainServiceStatus(boolean isEnable) {
AppConfigs appConfigs = AppConfigs.getInstance(this).loadAppConfigs(this);
Switch sw = (Switch)findViewById(R.id.activitymainSwitch1);
if (isEnable) {
if (sw.isChecked()) {
String szFilePath = mEditText.getText().toString();
// 设置空路径时退出
//
if (szFilePath.trim().equals("")) {
sw.setChecked(false);
ToastUtils.show("监控路径为空。");
Toast.makeText(getApplication(), "监控路径为空。", Toast.LENGTH_SHORT).show();
return;
}
@@ -268,7 +236,7 @@ public class MainActivity extends Activity {
stopWatchingFile();
}
AppConfigs.getInstance(this).saveAppConfigs(this, appConfigs);
AppConfigs.saveAppConfigs(this, appConfigs);
}
void stopWatchingFile() {
@@ -283,6 +251,8 @@ public class MainActivity extends Activity {
Intent intentService = new Intent(MainActivity.this, MainService.class);
//intentService.putExtra(MainService.EXTRA_APKFILEPATH, szAPKFilePath);
startService(intentService);
}
/*
@@ -328,7 +298,7 @@ public class MainActivity extends Activity {
}*/
public void onChangeSetupMode(View view) {
AppConfigs appConfigs = AppConfigs.getInstance(this).loadAppConfigs(this);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(this);
if (view.getId() == R.id.activitymainRadioButton1) {
appConfigs.setSetupMode(AppConfigs.SetupMode.WATCHOUTPUTINSTALLER);
@@ -337,42 +307,6 @@ public class MainActivity extends Activity {
appConfigs.setSetupMode(AppConfigs.SetupMode.NEWAPKINFONEWAPKINFO);
((RadioButton)findViewById(R.id.activitymainRadioButton1)).setChecked(false);
}
AppConfigs.getInstance(this).saveAppConfigs(this, appConfigs);
}
// 定义Handler
static Handler _Handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_UPDATE_STATUS) {
if (_MainActivity != null) {
boolean isEnableMainService = (boolean)msg.obj;
// 处理消息,这里更新 MainService 的状态
_MainActivity.setMainServiceStatus(isEnableMainService);
}
}
}
};
static void updateMainServiceStatus(boolean isEnable) {
if (_Handler != null) {
Message msg = new Message();
msg.obj = isEnable;
msg.what = MSG_UPDATE_STATUS;
_Handler.sendMessage(msg);
}
}
public static void stopMainService() {
if (_MainActivity != null && _Handler != null) {
updateMainServiceStatus(false);
}
}
public static void startMainService() {
if (_MainActivity != null && _Handler != null) {
updateMainServiceStatus(true);
}
AppConfigs.saveAppConfigs(this, appConfigs);
}
}

View File

@@ -1,21 +1,20 @@
package cc.winboll.studio.autoinstaller.models;
package cc.winboll.studio.autoinstaller.beans;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/05/27 17:36:01
* @Describe 应用配置数据类
*/
import android.content.Context;
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.autoinstaller.models.AppConfigs;
import cc.winboll.studio.autoinstaller.beans.AppConfigs;
import cc.winboll.studio.autoinstaller.utils.FileUtil;
import cc.winboll.studio.libappbase.LogUtils;
import com.hjq.toast.ToastUtils;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.io.StringWriter;
import cc.winboll.studio.shared.log.LogUtils;
public class AppConfigs implements Serializable {
@@ -27,21 +26,6 @@ public class AppConfigs implements Serializable {
NEWAPKINFONEWAPKINFO // 调用[应用信息查看器]打开应用包
};
static volatile AppConfigs _AppConfigs;
Context mContext;
AppConfigs(Context context) {
mContext = context.getApplicationContext();
}
public static synchronized AppConfigs getInstance(Context context) {
if (_AppConfigs == null) {
_AppConfigs = new AppConfigs(context);
_AppConfigs.loadAppConfigs(_AppConfigs.mContext);
}
return _AppConfigs;
}
// 监控文件路径
private String watchingFilePath = "";
@@ -101,8 +85,8 @@ public class AppConfigs implements Serializable {
return "";
}
public AppConfigs parseAppConfigs(String szAppConfigs) {
AppConfigs appConfigs = new AppConfigs(mContext);
public static AppConfigs parseAppConfigs(String szAppConfigs) {
AppConfigs appConfigs = new AppConfigs();
// 创建 JsonWriter 对象
StringReader stringReader = new StringReader(szAppConfigs);
JsonReader jsonReader = new
@@ -137,35 +121,20 @@ public class AppConfigs implements Serializable {
static String getDataPath(Context context) {
return context.getExternalFilesDir(TAG) + "/" + TAG + ".json";
}
public AppConfigs loadAppConfigs() {
public static AppConfigs loadAppConfigs(Context context) {
AppConfigs appConfigs = null;
try {
String szJson = FileUtil.readFile(getDataPath(mContext));
appConfigs = AppConfigs.getInstance(mContext).parseAppConfigs(szJson);
String szJson = FileUtil.readFile(getDataPath(context));
appConfigs = AppConfigs.parseAppConfigs(szJson);
} catch (IOException e) {
LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace());
}
return appConfigs;
}
public AppConfigs loadAppConfigs(Context context) {
AppConfigs appConfigs = null;
public static void saveAppConfigs(Context context, AppConfigs appConfigs) {
try {
String szJson = FileUtil.readFile(getDataPath(context.getApplicationContext()));
appConfigs = AppConfigs.getInstance(mContext).parseAppConfigs(szJson);
if(appConfigs != null) {
_AppConfigs = appConfigs;
}
} catch (IOException e) {
LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace());
}
return _AppConfigs;
}
public void saveAppConfigs(Context context, AppConfigs appConfigs) {
try {
ToastUtils.show(String.format("AppConfigs set enable service to %s", appConfigs.isEnableService()));
//LogUtils.d(TAG, "appConfigs is : " + appConfigs.toString());
String szJson = appConfigs.toString();
FileUtil.writeFile(getDataPath(context), szJson);
@@ -173,8 +142,4 @@ public class AppConfigs implements Serializable {
LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace());
}
}
public void saveAppConfigs() {
saveAppConfigs(mContext, this);
}
}

View File

@@ -1,75 +0,0 @@
package cc.winboll.studio.autoinstaller.models;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Date 2025/04/02 20:50:29
* @Describe 监控的 APK 安装文件对应的应用信息数据模型
*/
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.libappbase.BaseBean;
import java.io.IOException;
public class APKModel extends BaseBean {
public static final String TAG = "APPModel";
// 每次更新的 APK 文件对应的应用包名称
String apkPackageName;
public APKModel() {
this.apkPackageName = "";
}
public APKModel(String apkPackageName) {
this.apkPackageName = apkPackageName;
}
public void setApkPackageName(String apkPackageName) {
this.apkPackageName = apkPackageName;
}
public String getApkPackageName() {
return apkPackageName;
}
@Override
public String getName() {
return APKModel.class.getName();
}
@Override
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
super.writeThisToJsonWriter(jsonWriter);
jsonWriter.name("appPackageName").value(getApkPackageName());
}
@Override
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
if (name.equals("appPackageName")) {
setApkPackageName(jsonReader.nextString());
} else {
return false;
}
}
return true;
}
@Override
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String name = jsonReader.nextName();
if (!initObjectsFromJsonReader(jsonReader, name)) {
jsonReader.skipValue();
}
}
// 结束 JSON 对象
jsonReader.endObject();
return this;
}
}

View File

@@ -4,12 +4,12 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import cc.winboll.studio.autoinstaller.models.AppConfigs;
import cc.winboll.studio.autoinstaller.beans.AppConfigs;
import cc.winboll.studio.autoinstaller.services.MainService;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.shared.log.LogUtils;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/06 13:19:38
* @Describe 应用消息接收类
*/
@@ -23,7 +23,7 @@ public class MainReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String szAction = intent.getAction();
if (szAction.equals(ACTION_BOOT_COMPLETED)) {
AppConfigs appConfigs = AppConfigs.getInstance(context).loadAppConfigs(context);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(context);
if (appConfigs.isEnableService()) {
Intent intentService = new Intent(context, MainService.class);
//intentService.putExtra(MainService.EXTRA_APKFILEPATH, appConfigs.getWatchingFilePath());

View File

@@ -6,11 +6,11 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import cc.winboll.studio.autoinstaller.models.AppConfigs;
import cc.winboll.studio.autoinstaller.beans.AppConfigs;
import cc.winboll.studio.autoinstaller.utils.ServiceUtil;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
* @Author ZhanGSKen@QQ.COM
* @Date 2024/05/27 20:16:00
* @Describe MainService 守护进程服务
*/
@@ -46,7 +46,7 @@ public class AssistantService extends Service {
public int onStartCommand(Intent intent, int flags, int startId) {
//LogUtils.d(TAG, "call onStartCommand(...)");
run();
AppConfigs appConfigs = AppConfigs.getInstance(AssistantService.this).loadAppConfigs(AssistantService.this);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(AssistantService.this);
return appConfigs.isEnableService() ? Service.START_STICKY: super.onStartCommand(intent, flags, startId);
}
@@ -68,7 +68,7 @@ public class AssistantService extends Service {
//
void run() {
//LogUtils.d(TAG, "call run()");
AppConfigs appConfigs = AppConfigs.getInstance(AssistantService.this).loadAppConfigs(AssistantService.this);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(AssistantService.this);
if (appConfigs.isEnableService()) {
if (mIsThreadAlive == false) {
// 设置运行状态
@@ -101,7 +101,7 @@ public class AssistantService extends Service {
@Override
public void onServiceDisconnected(ComponentName name) {
//LogUtils.d(TAG, "call onServiceDisconnected(...)");
AppConfigs appConfigs = AppConfigs.getInstance(AssistantService.this).loadAppConfigs(AssistantService.this);
AppConfigs appConfigs = AppConfigs.loadAppConfigs(AssistantService.this);
if (appConfigs.isEnableService()) {
wakeupAndBindMain();
}

Some files were not shown because too many files have changed in this diff Show More