mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-20 22:09:11 +00:00
Removed store checker and added install referrer
This commit is contained in:
parent
8761652eaa
commit
ffcc0c2da0
9 changed files with 23 additions and 36 deletions
|
@ -114,7 +114,6 @@ On [this repository](https://github.com/juanico10/Pihole_list) you can find a re
|
|||
- [fl chart](https://pub.dev/packages/fl_chart)
|
||||
- [flutter svg](https://pub.dev/packages/flutter_svg)
|
||||
- [percent indicator](https://pub.dev/packages/percent_indicator)
|
||||
- [store checker](https://pub.dev/packages/store_checker)
|
||||
- [flutter markdown](https://pub.dev/packages/flutter_markdown)
|
||||
- [markdown](https://pub.dev/packages/markdown)
|
||||
- [html](https://pub.dev/packages/html)
|
||||
|
@ -132,6 +131,9 @@ On [this repository](https://github.com/juanico10/Pihole_list) you can find a re
|
|||
- [timezone](https://pub.dev/packages/timezone)
|
||||
- [url launcher](https://pub.dev/packages/url_launcher)
|
||||
- [flutter custom tabs](https://pub.dev/packages/flutter_custom_tabs)
|
||||
- [shared preferences](https://pub.dev/packages/shared_preferences)
|
||||
- [window manager](https://pub.dev/packages/window_manager)
|
||||
- [install referrer](https://pub.dev/packages/install_referrer)
|
||||
|
||||
<br>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:install_referrer/install_referrer.dart';
|
||||
|
||||
import 'package:adguard_home_manager/functions/compare_versions.dart';
|
||||
import 'package:adguard_home_manager/services/external_requests.dart';
|
||||
|
@ -9,7 +9,7 @@ import 'package:adguard_home_manager/models/github_release.dart';
|
|||
Future<GitHubRelease?> checkAppUpdates({
|
||||
required String currentBuildNumber,
|
||||
required void Function(GitHubRelease?) setUpdateAvailable,
|
||||
required Source installationSource,
|
||||
required InstallationAppReferrer? installationSource,
|
||||
required bool isBeta
|
||||
}) async {
|
||||
var result = isBeta
|
||||
|
@ -35,11 +35,7 @@ Future<GitHubRelease?> checkAppUpdates({
|
|||
setUpdateAvailable(gitHubRelease);
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
if (
|
||||
installationSource == Source.IS_INSTALLED_FROM_LOCAL_SOURCE ||
|
||||
installationSource == Source.IS_INSTALLED_FROM_PLAY_PACKAGE_INSTALLER ||
|
||||
installationSource == Source.UNKNOWN
|
||||
) {
|
||||
if (installationSource == InstallationAppReferrer.androidManually) {
|
||||
return gitHubRelease;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:install_referrer/install_referrer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
|
@ -12,7 +13,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
|||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
@ -80,7 +80,7 @@ void main() async {
|
|||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
Source installationSource = await StoreChecker.getSource;
|
||||
InstallationAppReferrer installationSource = await InstallReferrer.referrer;
|
||||
appConfigProvider.setInstallationSource(installationSource);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:install_referrer/install_referrer.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
@ -58,7 +58,7 @@ class AppConfigProvider with ChangeNotifier {
|
|||
|
||||
GitHubRelease? _appUpdatesAvailable;
|
||||
|
||||
Source _installationSource = Source.UNKNOWN;
|
||||
InstallationAppReferrer? _installationSource;
|
||||
|
||||
PackageInfo? get getAppInfo {
|
||||
return _appInfo;
|
||||
|
@ -162,7 +162,7 @@ class AppConfigProvider with ChangeNotifier {
|
|||
return _appUpdatesAvailable;
|
||||
}
|
||||
|
||||
Source get installationSource {
|
||||
InstallationAppReferrer? get installationSource {
|
||||
return _installationSource;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ class AppConfigProvider with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
|
||||
void setInstallationSource(Source value) {
|
||||
void setInstallationSource(InstallationAppReferrer value) {
|
||||
_installationSource = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/logs/details/log_details_screen.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/live/live_logs_list.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/log_tile.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/logs.dart';
|
||||
import 'package:adguard_home_manager/providers/live_logs_provider.dart';
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:install_referrer/install_referrer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/settings/settings.dart';
|
||||
|
@ -253,14 +253,7 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
|||
right: 10
|
||||
)
|
||||
),
|
||||
if (
|
||||
!(Platform.isAndroid || Platform.isIOS) ||
|
||||
(Platform.isAndroid && (
|
||||
appConfigProvider.installationSource == Source.IS_INSTALLED_FROM_LOCAL_SOURCE ||
|
||||
appConfigProvider.installationSource == Source.IS_INSTALLED_FROM_PLAY_PACKAGE_INSTALLER ||
|
||||
appConfigProvider.installationSource == Source.UNKNOWN
|
||||
))
|
||||
) ...[
|
||||
if (!(Platform.isAndroid || Platform.isIOS) || (Platform.isAndroid && (appConfigProvider.installationSource == InstallationAppReferrer.androidManually ))) ...[
|
||||
SectionLabel(label: AppLocalizations.of(context)!.application),
|
||||
CustomListTile(
|
||||
icon: Icons.system_update_rounded,
|
||||
|
|
|
@ -13,7 +13,6 @@ import sentry_flutter
|
|||
import shared_preferences_foundation
|
||||
import sqflite
|
||||
import sqlite3_flutter_libs
|
||||
import store_checker
|
||||
import url_launcher_macos
|
||||
import window_manager
|
||||
|
||||
|
@ -26,7 +25,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
||||
StoreCheckerPlugin.register(with: registry.registrar(forPlugin: "StoreCheckerPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
|
||||
}
|
||||
|
|
16
pubspec.lock
16
pubspec.lock
|
@ -373,6 +373,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
install_referrer:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: install_referrer
|
||||
sha256: "901c56d24ee3c3010dfd0bbebf305ed6b4b0f3fe969192081c167590a64cd78b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -730,14 +738,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
store_checker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: store_checker
|
||||
sha256: "9e5841e4f922cc7f0283323ff3c78fd31ace14c22e988525d33355c35d7c815a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.6.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -51,7 +51,6 @@ dependencies:
|
|||
fl_chart: ^0.69.0
|
||||
flutter_svg: ^2.0.9
|
||||
percent_indicator: ^4.2.3
|
||||
store_checker: ^1.4.0
|
||||
flutter_markdown: ^0.7.1
|
||||
markdown: ^7.1.1
|
||||
html: ^0.15.4
|
||||
|
@ -71,6 +70,7 @@ dependencies:
|
|||
url_launcher: ^6.2.4
|
||||
shared_preferences: ^2.2.2
|
||||
window_manager: ^0.4.2
|
||||
install_referrer: ^1.2.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
Loading…
Add table
Reference in a new issue