From f22812f11bca7de0b654f12fa81b922efaa1359f Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify1@users.noreply.github.com> Date: Tue, 22 Aug 2023 08:39:40 +0000 Subject: [PATCH] new: add signing to android --- .github/workflows/ci.yml | 17 +++++++++++++++++ android/app/build.gradle | 13 +++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ff09f43..cc916f79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,6 +127,23 @@ jobs: run: | make ${{ matrix.platform }}-libs + - name: Signing properties + env: + ANDROID_SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} + ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + ANDROID_SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} + ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }} + run: | + cd android + touch signing.properties + echo $ANDROID_SIGNING_KEY | base64 -d > release.keystore + echo "keystore.path=release.keystore" > release.properties + echo keystore.password="$ANDROID_SIGNING_STORE_PASSWORD" >> release.properties + echo key.alias="$ANDROID_SIGNING_KEY_ALIAS" >> release.properties + echo key.password="$ANDROID_SIGNING_KEY_PASSWORD" >> release.properties + cp release.* app/ + cat release.properties + cd .. - name: Release ${{ matrix.platform }} run: | make ${{ matrix.platform }}-release diff --git a/android/app/build.gradle b/android/app/build.gradle index fd7ed6a6..64c58595 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -66,10 +66,19 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release + } + } + signingConfigs { + release { + def properties = new Properties() + properties.load(new FileInputStream(rootProject.file('release.properties'))) + keyAlias properties['key.alias'] + keyPassword properties['key.password'] + storeFile file(properties['keystore.path']) + storePassword properties['keystore.password'] } } - buildFeatures { viewBinding true