Skip to content

Commit 82bf08a

Browse files
authored
Switch update checks to GitHub releases (#1219)
1 parent 1f6ee0b commit 82bf08a

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

lib/data/res/url.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
abstract final class Urls {
22
static const cdnBase = 'https://cdn.lpkt.cn/serverbox';
3-
static const updateCfg = '$cdnBase/update2.json';
43
static const myGithub = 'https://github.com/lollipopkit';
4+
static const githubApi = 'https://api.github.com/repos/lollipopkit';
55
static const thisRepo = '$myGithub/flutter_server_box';
6+
static const githubReleasesApi = '$githubApi/flutter_server_box/releases';
7+
static const appStore = 'https://apps.apple.com/app/id1586449703';
68
static const appHelp = '$thisRepo#-help';
79
static const appWiki = '$thisRepo/wiki';
810
}

lib/view/page/home.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ class _HomePageState extends ConsumerState<HomePage>
269269
if (Stores.setting.autoCheckAppUpdate.fetch()) {
270270
AppUpdateIface.doUpdate(
271271
build: BuildData.build,
272-
url: Urls.updateCfg,
272+
githubReleasesUrl: Urls.githubReleasesApi,
273+
storeUrl: Urls.appStore,
273274
context: context,
274275
);
275276
}

lib/view/page/setting/entries/app.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ extension _App on _AppSettingsPageState {
118118
() => AppUpdateIface.doUpdate(
119119
context: context,
120120
build: BuildData.build,
121-
url: Urls.updateCfg,
121+
githubReleasesUrl: Urls.githubReleasesApi,
122+
storeUrl: Urls.appStore,
122123
force: BuildMode.isDebug,
123124
),
124125
),

0 commit comments

Comments
 (0)