diff --git a/.gitignore b/.gitignore index 47e0b4d..a0bf167 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ build/ **/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java +**/android/key.properties +**/android/key.jks # iOS/XCode related **/ios/**/*.mode1v3 diff --git a/android/app/build.gradle b/android/app/build.gradle index d013c6c..b64cac4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,6 +24,12 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' 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 27 @@ -41,11 +47,22 @@ android { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + 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 + + minifyEnabled true + useProguard true + + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..babebba --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,7 @@ +#Flutter Wrapper +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6328b82..face58d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,17 +1,7 @@ - - - - diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..b12c36b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,2 @@ org.gradle.jvmargs=-Xmx1536M +extra-gen-snapshot-options=--obfuscate \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index f40fe75..46faa4b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ description: A new Flutter project. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # Read more about versioning at semver.org. -version: 1.0.0 +version: 1.0.0+1 # the 1.0.0 is the version name, the stuff after the + is the version code environment: sdk: ">=2.0.0-dev.68.0 <3.0.0"