diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c909ec8..50bc02b 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,3 +1,8 @@ +import kotlin.text.all +import kotlin.text.find +import kotlin.text.isNotEmpty +import kotlin.text.replace + plugins { id("com.android.application") id("kotlin-android") @@ -37,6 +42,22 @@ android { signingConfig = signingConfigs.getByName("debug") } } + + applicationVariants.all { + val variant = this + variant.outputs.all { + val output = this + // Get the architecture (ABI) for the current output. Note: Flutter often uses 'armeabi-v7a', 'arm64-v8a', etc. + val abi = output.filters.find { it.filterType == "ABI" }?.identifier?.replace("armeabi-", "") ?: "" + + // Make sure we are dealing with an APK output + if (output is com.android.build.gradle.internal.api.ApkVariantOutputImpl) { + // Append the ABI to the filename, with a hyphen if it exists + val abiSuffix = if (abi.isNotEmpty()) "-$abi" else "" + output.outputFileName = "Hadi & Hoda v${variant.versionName}+${variant.versionCode}${abiSuffix}.apk" + } + } + } } flutter { diff --git a/pubspec.yaml b/pubspec.yaml index 62fc865..1f2bfd4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: hadi_hoda_flutter description: "A new Flutter project." publish_to: 'none' -version: 1.0.0+1 +version: 0.1.4+1 environment: sdk: ^3.9.2