feat: check updates from self-hosted Gitea (CN-reachable)

Switch UpdateChecker source from api.github.com (flaky in CN) to the
self-hosted Gitea at git.sunlunfan.com. Releases must now be published
to Gitea too (github stays as mirror). parseRelease unchanged — Gitea
API fields are GitHub-compatible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 14:05:06 +08:00
parent 5b54309124
commit 4fcafeaf0d
2 changed files with 7 additions and 6 deletions
@@ -59,7 +59,7 @@ class UpdateChecker(private val context: Context) {
}
val req = Request.Builder()
.url(RELEASES_API)
.header("Accept", "application/vnd.github+json")
.header("Accept", "application/json")
.header("User-Agent", "a2i-android")
.get()
.build()
@@ -186,7 +186,8 @@ class UpdateChecker(private val context: Context) {
}
companion object {
const val RELEASES_API = "https://api.github.com/repos/lsxf/a2i/releases/latest"
// 更新源用自建 Giteagit.sunlunfan.com,国内可达),避免 api.github.com 不稳
const val RELEASES_API = "https://git.sunlunfan.com/api/v1/repos/song/a2i/releases/latest"
const val CHECK_INTERVAL_MS = 24L * 60 * 60 * 1000
}
}