diff --git a/.gitignore b/.gitignore index cc2cc7e..b35b8a1 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ app.*.map.json /android/app/release #keystore -clave-crcivan.jks \ No newline at end of file +clave-crcivan.jks +keystore-crcivan.jks +key.properties \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 15b21f5..32231a2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -4,6 +4,12 @@ plugins { id "dev.flutter.flutter-gradle-plugin" } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -26,7 +32,21 @@ android { namespace "com.asociacionador.crcivan" compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion + signingConfigs { + release { + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword = keystoreProperties['storePassword'] + } + } + buildTypes { + release { + signingConfig = signingConfigs.release + debuggable false + } + } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -50,14 +70,6 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName } - - 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 - } - } } flutter {