最新リリースのバージョン確認の正規表現を修正

This commit is contained in:
tateisu 2022-07-17 07:06:34 +09:00
parent b0ba829343
commit d32780f415
1 changed files with 5 additions and 2 deletions

View File

@ -116,10 +116,13 @@ class SideMenuAdapter(
// 使用中のアプリバージョンより新しいリリースがある?
val newVersion =
(newRelease?.string("name")?.notEmpty() ?: newRelease?.string("tag_name"))
?.replace("""(v|version)\s*""".toRegex(RegexOption.IGNORE_CASE), "")
?.replace("""(v(ersion)?)\s*""".toRegex(RegexOption.IGNORE_CASE), "")
?.trim()
?.notEmpty()
?.takeIf { VersionString(it) > VersionString(currentVersion) }
?.takeIf {
log.i("newVersion=$it, currentVersion=$currentVersion")
VersionString(it) > VersionString(currentVersion)
}
val releaseMinSdkVersion = newRelease?.int("minSdkVersion")
?: Build.VERSION.SDK_INT