mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 12:24:47 +00:00
Adapted app updater
This commit is contained in:
parent
578e606b83
commit
5660aefdc5
3 changed files with 39 additions and 11 deletions
|
@ -55,15 +55,25 @@ class _BaseState extends State<Base> with WidgetsBindingObserver {
|
|||
}
|
||||
|
||||
Future<GitHubRelease?> checkInstallationSource() async {
|
||||
if (Platform.isAndroid) {
|
||||
Source installationSource = await StoreChecker.getSource;
|
||||
if (installationSource != Source.IS_INSTALLED_FROM_PLAY_STORE) {
|
||||
final result = await checkAppUpdatesGitHub();
|
||||
if (result['result'] == 'success') {
|
||||
if (updateExists(widget.appConfigProvider.getAppInfo!.version, result['body'].tagName)) {
|
||||
final result = await checkAppUpdatesGitHub();
|
||||
if (result['result'] == 'success') {
|
||||
final update = updateExists(widget.appConfigProvider.getAppInfo!.version, result['body'].tagName);
|
||||
if (update == true) {
|
||||
if (Platform.isAndroid) {
|
||||
Source installationSource = await StoreChecker.getSource;
|
||||
if (installationSource == Source.IS_INSTALLED_FROM_PLAY_STORE) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return result['body'];
|
||||
}
|
||||
}
|
||||
else if (Platform.isIOS) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return result['body'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue