Skip to content

Commit

Permalink
fix 0
Browse files Browse the repository at this point in the history
  • Loading branch information
UjuiUjuMandan committed Jan 9, 2025
1 parent 66c6ec0 commit d6dd2f9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions V2rayNG/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@ android {
androidComponents {
onVariants { variant ->
val abiCodes = mapOf(
"universal" to 0, "arm64-v8a" to 1, "armeabi-v7a" to 2, "x86_64" to 3, "x86" to 4
"arm64-v8a" to 1, "armeabi-v7a" to 2, "x86_64" to 3, "x86" to 4
)
val isAAB = variant.flavorName.toString() == "playstore"
variant.outputs
.forEach { output ->
val abi = output.filters.find { it.filterType == ABI }?.identifier ?: "universal"
val abi = output.filters.find { it.filterType == ABI }?.identifier
val baseAbiCode = abiCodes[abi]
output.versionCode.set(
(output.versionCode.get() * 100 + abiCodes[abi]!! + 5000000).takeUnless { isAAB }
?: (1000000 * 4 + output.versionCode.get())
if (baseAbiCode != null && !isAAB ) {
(output.versionCode.get() * 100 + baseAbiCode + 5000000)
} else {
(1000000 * 4 + output.versionCode.get())
}
)
if (output is com.android.build.api.variant.impl.VariantOutputImpl) {
output.outputFileName = "v2rayNG_${output.versionName.get()}_${abi}.apk"
Expand Down

0 comments on commit d6dd2f9

Please sign in to comment.