Skip to content

Commit

Permalink
feat: add keystore
Browse files Browse the repository at this point in the history
Note: one needs to follow the key generation steps from here: https://docs.flutter.dev/deployment/android#signing-the-app
  • Loading branch information
bonomat committed Sep 5, 2023
1 parent 7bf7be9 commit 5639f83
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 33

Expand Down Expand Up @@ -70,11 +76,17 @@ android {
}
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
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
}
}
}
Expand Down

0 comments on commit 5639f83

Please sign in to comment.