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:
@@ -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"
|
||||
// 更新源用自建 Gitea(UPDATE_SOURCE_HIDDEN,国内可达),避免 api.github.com 不稳
|
||||
const val RELEASES_API = "https://UPDATE_SOURCE_HIDDEN/api/v1/repos/song/a2i/releases/latest"
|
||||
const val CHECK_INTERVAL_MS = 24L * 60 * 60 * 1000
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user