Use versionNameSuffix for the gms variant

This commit is contained in:
FooIbar committed 2023-09-23 16:44:56 +08:00
1 parent 13f255529b
commit d974cb56df
2 files changed
+4 -3

No files matched your search

+3 -1
View File
@@ -68,7 +68,8 @@ android {
minSdk = 28
targetSdk = 34
versionCode = 180043
versionName = "1.8.9.6-gms"
versionName = "1.8.9.6"
versionNameSuffix = "-gms"
resourceConfigurations.addAll(
listOf(
"zh",
@@ -89,6 +90,7 @@ android {
buildConfigField("String", "COMMIT_SHA", "\"$commitSha\"")
buildConfigField("String", "BUILD_TIME", "\"$buildTime\"")
buildConfigField("String", "REPO_NAME", "\"$repoName\"")
buildConfigField("String", "VERSION_NAME_SUFFIX", "\"$versionNameSuffix\"")
}
externalNativeBuild {
@@ -21,7 +21,6 @@ import java.util.zip.ZipInputStream
private const val API_URL = "https://api.github.com/repos/${BuildConfig.REPO_NAME}"
private const val RELEASE_URL = "$API_URL/releases"
private const val LATEST_RELEASE_URL = "$RELEASE_URL/latest"
private const val GMS_SUFFIX = "-gms"
object AppUpdater {
suspend fun checkForUpdate(forceCheck: Boolean = false): Release? {
@@ -49,7 +48,7 @@ object AppUpdater {
} else {
val curVersion = BuildConfig.VERSION_NAME
val release = ghRequest(LATEST_RELEASE_URL).executeAndParseAs<GithubRelease>()
val latestVersion = release.version + GMS_SUFFIX
val latestVersion = release.version + BuildConfig.VERSION_NAME_SUFFIX
val description = release.info
if (latestVersion != curVersion) {
val downloadUrl = ghRequest("$RELEASE_URL/tags/$latestVersion")