diff --git a/.github/signkey.jks b/.github/signkey.jks new file mode 100644 index 0000000..a692c63 Binary files /dev/null and b/.github/signkey.jks differ diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 7068bef..791ab83 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -7,10 +7,9 @@ on: branches: [ "master" ] jobs: + build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up JDK 11 @@ -27,7 +26,7 @@ jobs: - name: Download package run: "curl -H 'x-rpc-client_type: 2' -H 'x-rpc-app_version: 2.37.1' -H 'x-rpc-channel: miyousheluodi' https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease | jq --raw-output '.data.package_url' | xargs curl -o origin.apk" - name: Patch package - run: "java -jar gradle/lspatch/jar-v0.5.1-361-release.jar -f -l 2 -m app/build/outputs/apk/release/app-release-unsigned.apk -o pout origin.apk" + run: "java -jar gradle/lspatch/jar-v0.5.1-361-release.jar -f -l 2 -m app/build/outputs/apk/release/app-release.apk -o pout origin.apk" - name: Upload build artifacts uses: actions/upload-artifact@v3.1.0 with: diff --git a/app/build.gradle b/app/build.gradle index ad76b2c..f82e94b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,10 +19,20 @@ android { } } + signingConfigs { + release { + storeFile file('.github/signkey.jks') + keyAlias System.getenv("SIGNING_KEY_ALIAS") + keyPassword System.getenv("SIGNING_KEY_PASSWORD") + storePassword System.getenv("SIGNING_KEY_PASSWORD") + } + } + buildTypes { release { minifyEnabled true shrinkResources true + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } }