From 237e4cb27aa1dab8a94f109b0642d4f6b098feec Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Tue, 8 Sep 2026 06:09:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(update):=20APK=20asset=20URL=20used=20stale?= =?UTF-8?q?=20'-release'=20filename=20=E2=80=94=20downloads=20404'd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since v4.4.6-ba7opf.9.9 releases are uploaded as Look4Sat-.apk (no '-release' suffix), but parseRelease still built the download URL as Look4Sat--release.apk. Update check succeeded (page parses) while the download 404'd ('下载失败请重试'). Align the generated URL with the actual asset name; mirror-prefixed URLs fixed too. --- .../look4sat/core/data/repository/UpdateRepository.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/data/src/main/java/com/rtbishop/look4sat/core/data/repository/UpdateRepository.kt b/core/data/src/main/java/com/rtbishop/look4sat/core/data/repository/UpdateRepository.kt index bb0d969b..b476bd8e 100644 --- a/core/data/src/main/java/com/rtbishop/look4sat/core/data/repository/UpdateRepository.kt +++ b/core/data/src/main/java/com/rtbishop/look4sat/core/data/repository/UpdateRepository.kt @@ -66,16 +66,18 @@ class UpdateRepository( .replace("<", "<").replace(">", ">").replace("&", "&") .replace(""", "\"").replace("'", "'") .trim() - // The release APK asset follows the fixed naming scheme used by the build: - // Look4Sat--release.apk. When the page was fetched + // The release APK asset naming: Look4Sat-.apk + // (since v4.4.6-ba7opf.9.9 the releases are uploaded with the bare + // versioned filename, no "-release" suffix). When the page was fetched // through an accelerator mirror (https:///https://github.com/...), // download through the same mirror — raw github.com is unreachable on the // networks that needed the mirror in the first place. val mirrorPrefix = sourceUrl.substringBefore("https://github.com") + val apkName = "Look4Sat-${tag.removePrefix("v")}.apk" val apkUrl = if (mirrorPrefix.isEmpty()) { - "$DOWNLOAD_BASE_URL/$tag/Look4Sat-${tag.removePrefix("v")}-release.apk" + "$DOWNLOAD_BASE_URL/$tag/$apkName" } else { - "${mirrorPrefix}https://github.com/atsunatsu/Look4Sat/releases/download/$tag/Look4Sat-${tag.removePrefix("v")}-release.apk" + "${mirrorPrefix}https://github.com/atsunatsu/Look4Sat/releases/download/$tag/$apkName" } return LatestRelease( versionTag = tag,