mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 08:42:38 +00:00
add version support range
This commit is contained in:
4 files changed
+6
-3
No files matched your search
@@ -172,7 +172,7 @@ fun MainScreen(
|
||||
GamePackageUtils.getGameVersionCode(context.packageManager)
|
||||
}
|
||||
|
||||
if (gdVersion < Constants.SUPPORTED_VERSION_CODE) {
|
||||
if (gdVersion < Constants.SUPPORTED_VERSION_CODE_MIN) {
|
||||
val versionName = remember {
|
||||
GamePackageUtils.getUnifiedVersionName(context.packageManager)
|
||||
}
|
||||
|
||||
@@ -63,10 +63,11 @@ fun UpdateWarning(inSafeMode: Boolean = false, onDismiss: () -> Unit) {
|
||||
preferenceKey = PreferenceUtils.Key.DISMISSED_GJ_UPDATE
|
||||
)
|
||||
|
||||
val onUnsupportedVersion = gdVersionCode < Constants.SUPPORTED_VERSION_CODE_MIN || gdVersionCode > Constants.SUPPORTED_VERSION_CODE
|
||||
val canDismissRelease = gdVersionCode >= Constants.SUPPORTED_VERSION_CODE
|
||||
val shouldDismiss = canDismissRelease && gdVersionCode == lastDismissedVersion
|
||||
|
||||
if (gdVersionCode != Constants.SUPPORTED_VERSION_CODE && !shouldDismiss) {
|
||||
if (onUnsupportedVersion && !shouldDismiss) {
|
||||
AlertDialog(
|
||||
icon = {
|
||||
Icon(
|
||||
|
||||
@@ -143,7 +143,7 @@ class LaunchViewModel(private val application: Application): ViewModel() {
|
||||
return _uiState.emit(LaunchUIState.Cancelled(LaunchCancelReason.LAST_LAUNCH_CRASHED))
|
||||
}
|
||||
|
||||
if (GamePackageUtils.getGameVersionCode(packageManager) < Constants.SUPPORTED_VERSION_CODE) {
|
||||
if (GamePackageUtils.getGameVersionCode(packageManager) < Constants.SUPPORTED_VERSION_CODE_MIN) {
|
||||
return _uiState.emit(LaunchUIState.Cancelled(LaunchCancelReason.GAME_OUTDATED))
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ object Constants {
|
||||
@SuppressLint("SdCardPath")
|
||||
const val GJ_DATA_DIR = "/data/data/${PACKAGE_NAME}"
|
||||
|
||||
const val SUPPORTED_VERSION_CODE_MIN = 38L
|
||||
const val SUPPORTED_VERSION_CODE = 39L
|
||||
|
||||
const val SUPPORTED_VERSION_STRING = "2.2.142"
|
||||
}
|
||||
Reference in new issue
Block a user