Skip to content

Commit 87fb589

Browse files
committed
Sign apk with fixed key
1 parent 2ab1fce commit 87fb589

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/ubuntu.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
run: |
2323
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
2424
cargo install cargo-ndk
25+
- name: Setup Keystore
26+
run: |
27+
echo $ANDROID_KEYSTORE | base64 --decode > ./android/app/key.jks
28+
echo $ANDROID_KEY_PROPERTIES | base64 --decode > ./android/key.properties
2529
- name: Build for Android
2630
env:
2731
SDK_REGISTRY_TOKEN: ${{ secrets.MAP_SDK_SECRET_KEY }}

android/app/build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
def keystorePropertiesFile = rootProject.file("key.properties")
2+
def keystoreProperties = new Properties()
3+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
4+
15
def localProperties = new Properties()
26
def localPropertiesFile = rootProject.file('local.properties')
37
if (localPropertiesFile.exists()) {
@@ -50,11 +54,18 @@ android {
5054
versionName flutterVersionName
5155
}
5256

57+
signingConfigs {
58+
release {
59+
storeFile file(keystoreProperties['storeFile'])
60+
storePassword keystoreProperties['storePassword']
61+
keyAlias keystoreProperties['keyAlias']
62+
keyPassword keystoreProperties['keyPassword']
63+
}
64+
}
65+
5366
buildTypes {
5467
release {
55-
// TODO: Add your own signing config for the release build.
56-
// Signing with the debug keys for now, so `flutter run --release` works.
57-
signingConfig signingConfigs.debug
68+
signingConfig signingConfigs.release
5869
}
5970
}
6071
}

0 commit comments

Comments
 (0)