From 5178af91f654efda99c6450052bdd236621dc7aa Mon Sep 17 00:00:00 2001 From: WaterRain <109326062+CATMIAOZHI@users.noreply.github.com> Date: Fri, 17 Jul 2026 22:26:16 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=89=E5=85=A8=E4=B8=8E=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=88=90=E7=86=9F=E5=BA=A6=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除通用 WebView 登录入口(半成品功能,凭据无法正确映射到 Repository) 2. allowBackup=false,移除空模板备份规则引用 3. 版本号修正:versionCode=5, versionName=1.5 4. 签名密码默认值改为空字符串(CI 注入 Secret) 5. release workflow 注入签名密码环境变量 6. 新增 ci.yml:push/PR 触发单测+Debug 编译 7. 新增 LICENSE 文件(MIT) 8. CommandCodeGoRepository 注释修正(顺序执行非并行) 9. README 安全声明更新} --- .github/workflows/ci.yml | 25 +++++++++++++++++++ .github/workflows/release.yml | 4 +++ LICENSE | 21 ++++++++++++++++ README.md | 4 +-- app/build.gradle.kts | 8 +++--- app/src/main/AndroidManifest.xml | 4 +-- .../repository/CommandCodeGoRepository.kt | 2 +- .../ui/servicedetail/ServiceDetailScreen.kt | 2 +- .../token/ui/settings/CredentialEditScreen.kt | 9 ++----- 9 files changed, 61 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8f27e18 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - uses: android-actions/setup-android@v3 + with: + packages: 'platforms;android-35 build-tools;35.0.0' + - name: Run unit tests + run: | + chmod +x gradlew + ./gradlew testDebugUnitTest + - name: Assemble Debug + run: ./gradlew assembleDebug \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ff9266..07617c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,10 @@ jobs: - name: Decode Keystore run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > release.jks - name: Build Release APK + env: + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: | chmod +x gradlew ./gradlew assembleRelease diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7508038 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Rainy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 679c320..d04bf5c 100644 --- a/README.md +++ b/README.md @@ -185,9 +185,9 @@ chmod +x ./setup_android_env.sh - ✅ API Key / Session 凭据存入 **Android Keystore**(AES-256 GCM 加密) - ✅ 网络请求仅向 DeepSeek / OpenCode 官方 API 发出 -- ✅ API Key / Session 由 Android Keystore 加密;应用数据备份规则由 `data_extraction_rules.xml` / `backup_rules.xml` 控制 +- ✅ `allowBackup=false`:凭据密文、用量数据均不参与系统备份,避免换机恢复后密文无法解密 - ✅ 签名密钥固定,每次 Release 可覆盖安装 -- ✅ GitHub Secrets 加密存储签名密钥,CI 中解码使用 +- ✅ GitHub Secrets 加密存储签名密钥及密码,CI 中解码使用 --- diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 34dfc7a..094cf9c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,8 +14,8 @@ android { applicationId = "com.rainy.token" minSdk = 31 targetSdk = 35 - versionCode = 1 - versionName = "1.0" + versionCode = 5 + versionName = "1.5" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -26,9 +26,9 @@ android { signingConfigs { create("release") { storeFile = rootProject.file("release.jks") - storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "RainyToken2026!" + storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "" keyAlias = System.getenv("KEYSTORE_ALIAS") ?: "rainy" - keyPassword = System.getenv("KEY_PASSWORD") ?: "RainyToken2026!" + keyPassword = System.getenv("KEY_PASSWORD") ?: "" } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 316fc4a..fc63127 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,10 +7,8 @@