From 597bd021b8ff3741bf7af6020724d77812c8373d Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 6 Apr 2025 14:22:47 +0800 Subject: [PATCH] Bug fix --- .../main/java/com/v2ray/ang/handler/UpdateCheckerManager.kt | 3 +-- V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/handler/UpdateCheckerManager.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/handler/UpdateCheckerManager.kt index fa5d0bcc..518c780b 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/handler/UpdateCheckerManager.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/handler/UpdateCheckerManager.kt @@ -31,8 +31,7 @@ object UpdateCheckerManager { val latestRelease = if (includePreRelease) { JsonUtil.fromJson(response, Array::class.java) - .filter { it.prerelease } - .maxByOrNull { it.publishedAt } + .firstOrNull() ?: throw IllegalStateException("No pre-release found") } else { JsonUtil.fromJson(response, GitHubRelease::class.java) diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt index 3157316f..da79f3ed 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt @@ -105,11 +105,11 @@ class AboutActivity : BaseActivity() { } } - //If it is the Google Play version, not be displayed within 2 days after update + //If it is the Google Play version, not be displayed within 1 days after update if (Utils.isGoogleFlavor()) { val lastUpdateTime = AppManagerUtil.getLastUpdateTime(this) val currentTime = System.currentTimeMillis() - if ((currentTime - lastUpdateTime) < 2 * 24 * 60 * 60 * 1000L) { + if ((currentTime - lastUpdateTime) < 1 * 24 * 60 * 60 * 1000L) { binding.layoutCheckUpdate.visibility = View.GONE } }