From dc87ee6e4a6f92e5b47d8882802d64b76636627d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 1 May 2025 15:59:35 +0300 Subject: [PATCH] chore: fix apk release config --- .gitignore | 1 + android/app/build.gradle.kts | 26 ++++++++++++++++++++++++-- lib/main.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 29a3a50..c3a017a 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release +android/key.properties diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d3dc388..efa93dc 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.util.Properties +import java.io.FileInputStream + plugins { id("com.android.application") id("kotlin-android") @@ -5,6 +8,12 @@ plugins { id("dev.flutter.flutter-gradle-plugin") } +val keystoreProperties = Properties() +val keystorePropertiesFile = rootProject.file("key.properties") +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) +} + android { namespace = "dev.mi6e4ka.openstore" compileSdk = flutter.compileSdkVersion @@ -29,14 +38,27 @@ android { versionCode = flutter.versionCode versionName = flutter.versionName } - + signingConfigs { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = keystoreProperties["storeFile"]?.let { file(it) } + storePassword = keystoreProperties["storePassword"] as String + } + } 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.getByName("debug") + signingConfig = signingConfigs.getByName("release") } } + dependenciesInfo { + // Disables dependency metadata when building APKs (for IzzyOnDroid/F-Droid) + includeInApk = false + // Disables dependency metadata when building Android App Bundles (for Google Play) + includeInBundle = false + } } flutter { diff --git a/lib/main.dart b/lib/main.dart index abb992d..ce12f8a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -136,7 +136,7 @@ class HomePage extends StatelessWidget { : Container(), ], ), - const Text("v1.2.0") + const Text("v1.2.1") ], ), ) diff --git a/pubspec.yaml b/pubspec.yaml index d352742..ae1ab9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.0+1 +version: 1.2.1+2 environment: sdk: ">=3.4.3 <4.0.0"