From d405414689fe532f99407a19738ceafb0e7cf781 Mon Sep 17 00:00:00 2001 From: guang518 <35475020+guang518@users.noreply.github.com> Date: Sun, 28 Sep 2025 02:57:14 +0800 Subject: [PATCH] Update Updater.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 点击更新,在浏览器里打开网盘链接 Signed-off-by: guang518 <35475020+guang518@users.noreply.github.com> --- .../java/com/fongmi/android/tv/Updater.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/mobile/java/com/fongmi/android/tv/Updater.java b/app/src/mobile/java/com/fongmi/android/tv/Updater.java index e7748a28d..e5c82ef82 100644 --- a/app/src/mobile/java/com/fongmi/android/tv/Updater.java +++ b/app/src/mobile/java/com/fongmi/android/tv/Updater.java @@ -70,7 +70,6 @@ public class Updater implements Download.Callback { return this; } - //enable update public void start(Activity activity) { App.execute(() -> doInBackground(activity)); } @@ -111,7 +110,26 @@ public class Updater implements Download.Callback { private void confirm(View view) { view.setEnabled(false); - download.start(); + try { + // 直接使用Github中的链接 + String url = Github.getUpdateRedirectUrl(); + android.content.Intent intent = new android.content.Intent(android.content.Intent.ACTION_VIEW); + intent.setData(android.net.Uri.parse(url)); + intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); + + // 获取Context + android.content.Context context = view.getContext(); + if (intent.resolveActivity(context.getPackageManager()) != null) { + context.startActivity(intent); + dialog.dismiss(); + } else { + Notify.show("未找到浏览器"); + view.setEnabled(true); + } + } catch (Exception e) { + Notify.show("打开失败"); + view.setEnabled(true); + } } private void dismiss() {