File tree Expand file tree Collapse file tree
composeApp/src/androidGithub/kotlin/me/knighthat/updater Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,13 +34,21 @@ object Updater {
3434 */
3535 @Throws(NoSuchFileException ::class )
3636 private fun extractBuild ( assets : List <GithubRelease .Build > ): GithubRelease .Build {
37+ // Ignore the warning `BuildConfig.FLAVOR_env == "nightly"` either `true` or `false`
38+ // This condition is different based on the build
39+ val suffix = if ( BuildConfig .FLAVOR_env == " nightly" )
40+ BuildConfig .FLAVOR_env
41+ else when ( BuildConfig .FLAVOR_arch ) {
42+ " universal" -> " release"
43+ " arm32" -> " armeabi-v7a"
44+ " arm64" -> " arm64-v8a"
45+ " x86" -> " x86"
46+ " x86_64" -> " x86_64"
47+ else -> throw IllegalStateException (" Unknown architecture ${BuildConfig .FLAVOR_arch } " )
48+ }
3749 // e.g. Release version will have name 'Kreate-release.apk'
38- val filename = " %s-%s.apk" .format(
39- BuildConfig .APP_NAME ,
40- // Ignore the warning `BuildConfig.FLAVOR_env == "nightly"` either `true` or `false`
41- // This condition is different based on the build
42- if ( BuildConfig .FLAVOR_env == " nightly" ) " nightly" else " release"
43- )
50+ val filename = " %s-%s.apk" .format(BuildConfig .APP_NAME , suffix)
51+
4452 return assets.fastFirstOrNull {
4553 // Get the first build that has name matches 'Kreate-<buildType>.apk'
4654 // with the exception of nightly build, which is `Kreate-nightly.apk`
You can’t perform that action at this time.
0 commit comments