Compare commits
55 Commits
1aab8b2d45
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62294598ca | ||
|
|
acddb7d53e | ||
|
|
fc5c0e7a0a | ||
|
|
1d7799f561 | ||
|
|
8d54f1c9dc | ||
|
|
5ae2a05a3d | ||
|
|
f7172869af | ||
|
|
427e9166b3 | ||
|
|
9455720516 | ||
|
|
697a6cae87 | ||
|
|
ccafe90442 | ||
|
|
871f6637ac | ||
|
|
b85bc11c2a | ||
|
|
958e232983 | ||
|
|
1095eb557d | ||
| 2687aabae5 | |||
| 033e5c24cd | |||
| 29ca63bbbd | |||
| f436275b7d | |||
| 8fb3af5518 | |||
| 1d4cc5fede | |||
| 07cd627f60 | |||
| 4415f28d08 | |||
| ffb6677cfd | |||
| 6165baa4c7 | |||
| 1d0cac0d1a | |||
| 306e479764 | |||
| 150e259205 | |||
| 539b076fac | |||
| 97c701e691 | |||
| df063dc38e | |||
| d0048c1d1c | |||
| 9f1c6052e5 | |||
| a4d2e67fd6 | |||
| 16a32f6367 | |||
| 3dff4be357 | |||
| a082d76620 | |||
| 5e6b1b72b5 | |||
| f53336b013 | |||
| 6d83103b09 | |||
| 917b69e2aa | |||
| 20c29a9a57 | |||
| a624dae001 | |||
| 65adbee8b8 | |||
| 6b051846fc | |||
| 84d6a8fea9 | |||
| 11521e29bd | |||
| d2ec0c9b01 | |||
| a7c6e6b909 | |||
| 3ee14eabe6 | |||
| 247f5f31a5 | |||
| 44fe4d963c | |||
| 0fe9ed4998 | |||
| 4ed5368614 | |||
| 1896f42f1b |
61
.gitignore
vendored
61
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
@@ -13,6 +14,8 @@
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
build/
|
||||
!app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
@@ -24,18 +27,17 @@ local.properties
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
misc.xml
|
||||
deploymentTargetSelector.xml
|
||||
markdown.xml
|
||||
migrations.xml
|
||||
runConfigurations.xml
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
@@ -45,7 +47,7 @@ captures/
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (API key)
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
@@ -53,19 +55,46 @@ freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastjson
|
||||
fastjson/
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Test folder
|
||||
test/
|
||||
tests/
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# Android generated crash logs
|
||||
crashlytics-build.properties
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# Airtest
|
||||
*.log
|
||||
*.png
|
||||
report/
|
||||
# AirTest
|
||||
airtest.log
|
||||
log.txt
|
||||
storage/
|
||||
|
||||
# Project specific
|
||||
NUL
|
||||
my-release.jks
|
||||
app/my-release.jks
|
||||
|
||||
# 个别文件
|
||||
需求表.md
|
||||
push.bat
|
||||
|
||||
#测试文件
|
||||
test*.py
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
#Sat Feb 28 12:39:22 CST 2026
|
||||
gradle.version=8.2
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
#Sat Feb 28 14:32:19 CST 2026
|
||||
java.home=C\:\\Program Files\\Android\\Android Studio\\jbr
|
||||
Binary file not shown.
1
.idea/.name
generated
1
.idea/.name
generated
@@ -1 +0,0 @@
|
||||
InspectionCamera
|
||||
6
.idea/AndroidProjectSystem.xml
generated
6
.idea/AndroidProjectSystem.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/compiler.xml
generated
6
.idea/compiler.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/deploymentTargetSelector.xml
generated
10
.idea/deploymentTargetSelector.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
18
.idea/gradle.xml
generated
18
.idea/gradle.xml
generated
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/markdown.xml
generated
8
.idea/markdown.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownSettings">
|
||||
<option name="previewPanelProviderInfo">
|
||||
<ProviderInfo name="Compose (experimental)" className="com.intellij.markdown.compose.preview.ComposePanelProvider" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/migrations.xml
generated
10
.idea/migrations.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/misc.xml
generated
10
.idea/misc.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
17
.idea/runConfigurations.xml
generated
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
149
README.md
149
README.md
@@ -1,16 +1,141 @@
|
||||
# CheckShot
|
||||
# 巡检相机 - Android 巡检图片处理工具
|
||||
|
||||
Android 图片检查与拼图工具。实现了水印、拼图、设置等核心功能,配合 AirTest 自动化测试。
|
||||
巡检相机是一个面向 Android 的巡检图片处理工具,包含水印处理、拼图合成、以及丰富的设置能力,配合 AirTest 自动化测试用例,帮助实现端到端的图像工作流。
|
||||
|
||||
核心特性
|
||||
- 水印模块:时间水印、地点水印、三种预设样式。
|
||||
- 拼图模块:多图合成,固定模板,图片替换/删除,合成质量控制。
|
||||
- 设置:默认合成布局、默认水印样式、默认主题、巡检员信息等。
|
||||
- 测试:AirTest 集成用例,覆盖水印、相册、拼图、设置等场景。
|
||||
## 软件界面截图
|
||||
|
||||
快速开始
|
||||
- 构建:./gradlew assembleDebug
|
||||
- 安装:adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
- AirTest:airtest run test/airtest/...
|
||||
启动应用后,可以看到以下主要界面:
|
||||
|
||||
如需更多安装与运行指南,请查看 respective CI/CD 或文档。
|
||||
### 1. 相机界面
|
||||

|
||||
|
||||
*主相机界面,支持拍照、自动/手动对焦、曝光调节,拍摄后自动叠加水印*
|
||||
|
||||
### 2. 相册界面
|
||||

|
||||
|
||||
*相册管理界面,支持本地存储、分类管理、预览、导出/分享*
|
||||
|
||||
### 3. 拼图界面
|
||||

|
||||
|
||||
*多图拼图合成界面,支持 2x2 和 3x3 网格布局*
|
||||
|
||||
### 4. 设置界面
|
||||

|
||||
|
||||
*应用设置界面,支持水印样式、地点获取方式、合成布局、图片质量、文件名模板、记录人信息等配置*
|
||||
|
||||
## 功能特点
|
||||
|
||||
- **相机模块**:✅ 使用 CameraX 库实现拍照、自动/手动对焦、曝光调节,拍摄后自动叠加水印(时间 + 地点)
|
||||
- **水印处理**:✅ 支持时间水印(格式固定为 "yyyy 年 MM 月 d 日 HH:mm:ss")和地点水印(优先联网解析,失败时显示经纬度),提供三种预设样式(默认/简约/醒目)
|
||||
- **EXIF 元数据**:✅ 自动写入 GPS 坐标、拍摄时间、相机型号、作者信息到照片 EXIF
|
||||
- **多图拼图(合成)模块**:✅ 支持 2x2、1x3、3x1 等多种网格布局,图片自动缩放裁剪,支持图片替换、删除、添加和质量控制(高/标准/低)
|
||||
- **文字编辑模块**:✅ 在合成图片的顶部(标题 + 日期时间)和底部(内容 + 记录人)添加带背景的文字说明,支持智能换行
|
||||
- **图片管理**:✅ 本地存储、按日期分组查看(今天/昨天/上月/更早)、预览、删除、导出/分享
|
||||
- **文件名模板**:✅ 支持自定义文件名格式,可用占位符:`{project}` `{device}` `{inspector}` `{date}` `{time}`
|
||||
- **设置与通用配置**:✅ 水印样式、地点获取方式(网络/GPS)、合成布局、图片质量、文件名模板、记录人信息等均可配置
|
||||
- **测试与自动化**:✅ 集成 AirTest 测试用例 + JUnit 单元测试,覆盖拼图等场景
|
||||
|
||||
## 安装步骤
|
||||
|
||||
1. **克隆项目**:
|
||||
```bash
|
||||
git clone http://124.223.26.33:3000/xiaji/anroid-CheckShot.git
|
||||
cd anroid-CheckShot
|
||||
```
|
||||
|
||||
2. **构建调试 APK**:
|
||||
```bash
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
3. **安装到设备**:
|
||||
```bash
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
4. **安装 AirTest 依赖(用于测试)**:
|
||||
```bash
|
||||
pip install airtest pocoui
|
||||
```
|
||||
|
||||
## 使用示例
|
||||
|
||||
### 基本使用
|
||||
|
||||
1. **启动应用**:在 Android 设备/模拟器上安装并打开巡检相机
|
||||
2. **拍照**:点击相机按钮拍照,自动添加水印
|
||||
3. **拼图**:选择多张图片进行拼图合成
|
||||
4. **查看相册**:浏览和管理拍摄的照片
|
||||
|
||||
### 构建发布 APK
|
||||
|
||||
```bash
|
||||
# 构建签名 APK(需配置好 keystore)
|
||||
./gradlew assembleRelease
|
||||
|
||||
# 构建产物位置
|
||||
app/build/outputs/apk/release/app-release.apk
|
||||
```
|
||||
|
||||
### 运行测试
|
||||
|
||||
```bash
|
||||
# 确保设备已连接
|
||||
adb devices
|
||||
|
||||
# 运行 AirTest 拼图测试
|
||||
airtest run test/airtest/test_puzzle_merge.py --device Android:///
|
||||
|
||||
# 运行手动测试脚本
|
||||
python test_android.py # 基础功能测试
|
||||
python test_camera.py # 相机功能测试
|
||||
python test_gallery.py # 相册功能测试
|
||||
```
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
anroid-CheckShot/
|
||||
├── app/ # App 模块
|
||||
│ ├── src/main/ # 主代码
|
||||
│ │ ├── java/ # Kotlin/Java 代码
|
||||
│ │ └── res/ # 资源文件
|
||||
│ ├── build.gradle.kts # App 级构建配置
|
||||
│ └── my-release.jks # 签名密钥(本地)
|
||||
├── test/ # 测试代码
|
||||
│ └── airtest/ # AirTest UI 测试
|
||||
├── gradle.properties # Gradle 属性(含签名配置)
|
||||
├── build.gradle.kts # 项目级构建配置
|
||||
├── settings.gradle.kts # 项目设置
|
||||
└── README.md # 项目说明
|
||||
```
|
||||
|
||||
## 贡献指南
|
||||
|
||||
1. Fork 项目仓库
|
||||
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
||||
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
||||
5. 提交 Pull Request
|
||||
|
||||
## 常见问题 (FAQ)
|
||||
|
||||
**Q: 如何修改水印样式?**
|
||||
A: 在设置界面中选择水印样式(默认/简约/醒目),可实时预览效果。
|
||||
|
||||
**Q: AirTest 测试失败怎么办?**
|
||||
A: 确保设备已连接且已安装 AirTest 依赖,检查设备是否开启开发者选项和 USB 调试。
|
||||
|
||||
**Q: 拼图功能支持哪些布局?**
|
||||
A: 支持 2x2、1x3、3x1 等多种网格布局,图片会自动缩放裁剪以适配网格。
|
||||
|
||||
**Q: 如何自定义文件名格式?**
|
||||
A: 在设置界面的"文件名模板"中编辑,支持占位符:`{project}`(项目)、`{device}`(设备 ID)、`{inspector}`(记录人)、`{date}`(日期)、`{time}`(时间)。
|
||||
|
||||
## 联系方式/反馈渠道
|
||||
|
||||
- 问题反馈:请在仓库中提交 Issue
|
||||
- 代码贡献:欢迎提交 Pull Request
|
||||
|
||||
@@ -20,13 +20,24 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = file(project.properties["RELEASE_STORE_FILE"] as String? ?: "my-release.jks")
|
||||
storePassword = project.properties["RELEASE_STORE_PASSWORD"] as String? ?: "android123"
|
||||
keyAlias = project.properties["RELEASE_KEY_ALIAS"] as String? ?: "my-key"
|
||||
keyPassword = project.properties["RELEASE_KEY_PASSWORD"] as String? ?: "android123"
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -49,7 +60,7 @@ android {
|
||||
}
|
||||
lint {
|
||||
abortOnError = false
|
||||
checkReleaseBuilds = true
|
||||
checkReleaseBuilds = false
|
||||
warningsAsErrors = false
|
||||
}
|
||||
}
|
||||
@@ -89,6 +100,9 @@ dependencies {
|
||||
// Accompanist permissions
|
||||
implementation("com.google.accompanist:accompanist-permissions:0.32.0")
|
||||
|
||||
// ExifInterface
|
||||
implementation("androidx.exifinterface:exifinterface:1.3.7")
|
||||
|
||||
// Testing
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1,2 +0,0 @@
|
||||
#- File Locator -
|
||||
listingFile=../../../outputs/apk/debug/output-metadata.json
|
||||
@@ -1,2 +0,0 @@
|
||||
appMetadataVersion=1.1
|
||||
androidGradlePluginVersion=8.2.0
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "COMPATIBLE_SCREEN_MANIFEST",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.inspection.camera",
|
||||
"variantName": "debug",
|
||||
"elements": []
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
12
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user