mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-22 10:23:45 +02:00
Fix versionCode issue (#2505) + Flutter upgrades
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
import com.android.build.api.variant.FilterConfiguration.FilterType.*
|
||||
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
@@ -86,18 +87,17 @@ android {
|
||||
|
||||
val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3)
|
||||
|
||||
androidComponents {
|
||||
onVariants { variant ->
|
||||
variant.outputs.forEach { output ->
|
||||
val name = output.filters.find { it.filterType == ABI }?.identifier
|
||||
val baseAbiCode = abiCodes[name] ?: 0
|
||||
if (baseAbiCode != null) {
|
||||
output.versionCode.set(baseAbiCode + ((output.versionCode.get() ?: 0) * 10))
|
||||
}
|
||||
android.applicationVariants.configureEach {
|
||||
val variant = this
|
||||
variant.outputs.forEach { output ->
|
||||
val abiVersionCode = abiCodes[output.filters.find { it.filterType == "ABI" }?.identifier]
|
||||
if (abiVersionCode != null) {
|
||||
(output as ApkVariantOutputImpl).versionCodeOverride = variant.versionCode * 10 + abiVersionCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
||||
}
|
||||
|
Reference in New Issue
Block a user