Skip to content

Commit 668197f

Browse files
committed
Sign application at build.
1 parent a5b0658 commit 668197f

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.aar
99
*.ap_
1010
*.aab
11+
*.jks
1112
build/*
1213

1314
# Files for the ART/Dalvik VM
@@ -339,3 +340,5 @@ hs_err_pid*
339340

340341
# End of https://www.toptal.com/developers/gitignore/api/flutter,intellij+all,androidstudio,android
341342
build/*
343+
/android/app/.receipt_manager_key.jks
344+
/android/app/receipt_manager_key

android/app/build.gradle

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ apply plugin: 'com.android.application'
2525
apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

28+
def keystoreProperties = new Properties()
29+
def keystorePropertiesFile = rootProject.file('key.properties')
30+
if (keystorePropertiesFile.exists()) {
31+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32+
}
2833
android {
2934
compileSdkVersion 29
3035

@@ -38,18 +43,25 @@ android {
3843

3944
defaultConfig {
4045
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "org.receipt_scanner"
46+
applicationId "org.receipt_manager"
4247
minSdkVersion 21
4348
targetSdkVersion 29
4449
versionCode flutterVersionCode.toInteger()
4550
versionName flutterVersionName
4651
}
4752

53+
54+
signingConfigs {
55+
release {
56+
keyAlias keystoreProperties['keyAlias']
57+
keyPassword keystoreProperties['keyPassword']
58+
storeFile file(keystoreProperties['storeFile'])
59+
storePassword keystoreProperties['storePassword']
60+
}
61+
}
4862
buildTypes {
4963
release {
50-
// TODO: Add your own signing config for the release build.
51-
// Signing with the debug keys for now, so `flutter run --release` works.
52-
signingConfig signingConfigs.debug
64+
signingConfig signingConfigs.release
5365
}
5466
}
5567
}
@@ -60,4 +72,4 @@ flutter {
6072

6173
dependencies {
6274
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63-
}
75+
}

0 commit comments

Comments
 (0)