mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-25 20:03:44 +02:00
Avoid OS version reconciliation for pseudo-versioned apps (#2023)
This commit is contained in:
@@ -19,6 +19,8 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:http/io_client.dart';
|
import 'package:http/io_client.dart';
|
||||||
|
import 'package:obtainium/app_sources/directAPKLink.dart';
|
||||||
|
import 'package:obtainium/app_sources/html.dart';
|
||||||
import 'package:obtainium/components/generated_form.dart';
|
import 'package:obtainium/components/generated_form.dart';
|
||||||
import 'package:obtainium/components/generated_form_modal.dart';
|
import 'package:obtainium/components/generated_form_modal.dart';
|
||||||
import 'package:obtainium/custom_errors.dart';
|
import 'package:obtainium/custom_errors.dart';
|
||||||
@@ -1159,17 +1161,25 @@ class AppsProvider with ChangeNotifier {
|
|||||||
if (app?.app == null) {
|
if (app?.app == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
var source = SourceProvider()
|
||||||
|
.getSource(app!.app.url, overrideSource: app.app.overrideSource);
|
||||||
var naiveStandardVersionDetection =
|
var naiveStandardVersionDetection =
|
||||||
app!.app.additionalSettings['naiveStandardVersionDetection'] == true ||
|
app.app.additionalSettings['naiveStandardVersionDetection'] == true ||
|
||||||
SourceProvider()
|
source.naiveStandardVersionDetection;
|
||||||
.getSource(app.app.url, overrideSource: app.app.overrideSource)
|
|
||||||
.naiveStandardVersionDetection;
|
|
||||||
String? realInstalledVersion =
|
String? realInstalledVersion =
|
||||||
app.app.additionalSettings['useVersionCodeAsOSVersion'] == true
|
app.app.additionalSettings['useVersionCodeAsOSVersion'] == true
|
||||||
? app.installedInfo?.versionCode.toString()
|
? app.installedInfo?.versionCode.toString()
|
||||||
: app.installedInfo?.versionName;
|
: app.installedInfo?.versionName;
|
||||||
|
bool isHTMLWithNoVersionDetection =
|
||||||
|
(source.runtimeType == HTML().runtimeType &&
|
||||||
|
(app.app.additionalSettings['versionExtractionRegEx'] as String?)
|
||||||
|
?.isNotEmpty !=
|
||||||
|
true);
|
||||||
|
bool isDirectAPKLink = source.runtimeType == DirectAPKLink().runtimeType;
|
||||||
return app.app.additionalSettings['trackOnly'] != true &&
|
return app.app.additionalSettings['trackOnly'] != true &&
|
||||||
app.app.additionalSettings['releaseDateAsVersion'] != true &&
|
app.app.additionalSettings['releaseDateAsVersion'] != true &&
|
||||||
|
!isHTMLWithNoVersionDetection &&
|
||||||
|
!isDirectAPKLink &&
|
||||||
realInstalledVersion != null &&
|
realInstalledVersion != null &&
|
||||||
app.app.installedVersion != null &&
|
app.app.installedVersion != null &&
|
||||||
(reconcileVersionDifferences(
|
(reconcileVersionDifferences(
|
||||||
@@ -1240,6 +1250,7 @@ class AppsProvider with ChangeNotifier {
|
|||||||
!isVersionDetectionPossible(
|
!isVersionDetectionPossible(
|
||||||
AppInMemory(app, null, installedInfo, null))) {
|
AppInMemory(app, null, installedInfo, null))) {
|
||||||
app.additionalSettings['versionDetection'] = false;
|
app.additionalSettings['versionDetection'] = false;
|
||||||
|
app.installedVersion = app.latestVersion;
|
||||||
logs.add('Could not reconcile version formats for: ${app.id}');
|
logs.add('Could not reconcile version formats for: ${app.id}');
|
||||||
modded = true;
|
modded = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user