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 @@