diff --git a/lib/modules/more/about/providers/check_for_update.dart b/lib/modules/more/about/providers/check_for_update.dart index 847976fe..e2592cf7 100644 --- a/lib/modules/more/about/providers/check_for_update.dart +++ b/lib/modules/more/about/providers/check_for_update.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:developer'; +import 'dart:io'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -11,6 +12,7 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:device_info_plus/device_info_plus.dart'; part 'check_for_update.g.dart'; @riverpod @@ -28,7 +30,12 @@ Future checkForUpdate( if (kDebugMode) { log(info.data.toString()); } - + if (Platform.isAndroid) { + final deviceInfo = DeviceInfoPlugin(); + final androidInfo = await deviceInfo.androidInfo; + print("DEBUG"); + print(androidInfo.supportedAbis.join(", ")); // x86_64, arm64-v8a + } final updateAvailable = await _checkUpdate(); if (compareVersions(info.version, updateAvailable.$1) < 0) { if (manualUpdate) { @@ -56,7 +63,7 @@ Future checkForUpdate( ), const SizedBox(width: 15), ElevatedButton( - onPressed: () { + onPressed: () async { _launchInBrowser(Uri.parse(updateAvailable.$3)); }, child: Text(l10n.download), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 6365741e..038396d6 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,9 +5,11 @@ import FlutterMacOS import Foundation +import app_installer import app_links import audio_session import connectivity_plus +import device_info_plus import flutter_inappwebview_macos import flutter_qjs import flutter_web_auth_2 @@ -30,9 +32,11 @@ import window_manager import window_to_front func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AppInstallerPlugin.register(with: registry.registrar(forPlugin: "AppInstallerPlugin")) AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) FlutterQjsPlugin.register(with: registry.registrar(forPlugin: "FlutterQjsPlugin")) FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin")) diff --git a/pubspec.lock b/pubspec.lock index 2edbcdc1..483f763c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -38,6 +38,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.13.2" + app_installer: + dependency: "direct main" + description: + name: app_installer + sha256: "4c3a9268b53ead9a915ef79cd3988e28c72719fb78143867f9fed4bd4d8c1cfd" + url: "https://pub.dev" + source: hosted + version: "1.3.1" app_links: dependency: "direct main" description: @@ -399,6 +407,22 @@ packages: url: "https://github.com/kodjodevf/desktop_webview_window.git" source: git version: "0.2.4" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + sha256: "306b78788d1bb569edb7c55d622953c2414ca12445b41c9117963e03afc5c513" + url: "https://pub.dev" + source: hosted + version: "11.3.3" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + url: "https://pub.dev" + source: hosted + version: "7.0.2" directed_graph: dependency: transitive description: @@ -2128,10 +2152,18 @@ packages: dependency: "direct main" description: name: win32 - sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f url: "https://pub.dev" source: hosted - version: "5.10.1" + version: "5.12.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" window_manager: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 99d670d8..cf5cdf8b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -83,6 +83,8 @@ dependencies: app_links: ^6.4.0 win32: ^5.10.1 protobuf: ^3.1.0 + app_installer: ^1.3.1 + device_info_plus: ^11.3.3 dependency_overrides: http: ^1.2.2