@@ -24,6 +24,13 @@ if (flutterVersionName == null) {
2424apply plugin : ' com.android.application'
2525apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
2626
27+
28+ def keystoreProperties = new Properties ()
29+ def keystorePropertiesFile = rootProject. file(' key.properties' )
30+ if (keystorePropertiesFile. exists()) {
31+ keystoreProperties. load(new FileInputStream (keystorePropertiesFile))
32+ }
33+
2734android {
2835 compileSdkVersion 27
2936
@@ -41,11 +48,27 @@ android {
4148 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
4249 }
4350
51+ signingConfigs {
52+ release {
53+ keyAlias keystoreProperties[' keyAlias' ]
54+ keyPassword keystoreProperties[' keyPassword' ]
55+ storeFile file(keystoreProperties[' storeFile' ])
56+ storePassword keystoreProperties[' storePassword' ]
57+ }
58+ debug {
59+ keyAlias keystoreProperties[' keyAlias' ]
60+ keyPassword keystoreProperties[' keyPassword' ]
61+ storeFile file(keystoreProperties[' storeFile' ])
62+ storePassword keystoreProperties[' storePassword' ]
63+ }
64+ }
65+
4466 buildTypes {
4567 release {
46- // TODO: Add your own signing config for the release build.
47- // Signing with the debug keys for now, so `flutter run --release` works.
48- signingConfig signingConfigs. debug
68+ signingConfig signingConfigs. release
69+ minifyEnabled true
70+ useProguard false
71+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
4972 }
5073 }
5174}
0 commit comments