fix: 修复应用更新检查机制
🔧 更新检查优化: - 复刻 FongMi/TV 的更新检查机制 - 使用独立 Release 仓库托管更新信息 - 避免 GitHub API 频率限制问题 - 默认启用自动更新检查功能 📂 文件变更: - 重写手机版 Updater.java,统一更新检查逻辑 - 修改 Github.java,指向新的 Release 仓库 - 启用 getAutoUpdateCheck() 默认值为 true ✅ 功能改进: - 手机版和TV版使用相同的更新检查机制 - 支持国内外网络环境自动切换 - 错误处理和用户提示优化
This commit is contained in:
@@ -14,12 +14,10 @@ import okhttp3.Response;
|
||||
|
||||
public class Github {
|
||||
|
||||
public static final String URL = "https://raw.githubusercontent.com/Tosencen/XMBOX/main";
|
||||
public static final String API_URL = "https://api.github.com/repos/Tosencen/XMBOX/releases/latest";
|
||||
public static final String URL = "https://raw.githubusercontent.com/Tosencen/XMBOX-Release/main";
|
||||
|
||||
// 国内镜像地址 - 使用Gitee作为镜像
|
||||
public static final String CN_URL = "https://gitee.com/ochenoktochen/XMBOX/raw/main";
|
||||
public static final String CN_API_URL = "https://gitee.com/api/v5/repos/ochenoktochen/XMBOX/releases/latest";
|
||||
public static final String CN_URL = "https://gitee.com/ochenoktochen/XMBOX-Release/raw/main";
|
||||
|
||||
// 存储测速结果
|
||||
private static Boolean useCnMirror = null;
|
||||
@@ -34,9 +32,6 @@ public class Github {
|
||||
return CN_URL + "/" + path + "/" + name;
|
||||
}
|
||||
|
||||
public static String getReleaseApi() {
|
||||
return useCnMirror() ? CN_API_URL : API_URL;
|
||||
}
|
||||
|
||||
public static String getJson(boolean dev, String name) {
|
||||
if (useCnMirror()) {
|
||||
|
||||
Reference in New Issue
Block a user