mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-24 09:59:41 +02:00
Compare commits
4 Commits
v0.8.2-bet
...
v0.8.3-bet
Author | SHA1 | Date | |
---|---|---|---|
|
b496a416ff | ||
|
6ac7ba204f | ||
|
0951c007d1 | ||
|
d835beec76 |
@@ -17,7 +17,7 @@ import 'package:device_info_plus/device_info_plus.dart';
|
|||||||
import 'package:android_alarm_manager_plus/android_alarm_manager_plus.dart';
|
import 'package:android_alarm_manager_plus/android_alarm_manager_plus.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
|
||||||
const String currentVersion = '0.8.2';
|
const String currentVersion = '0.8.3';
|
||||||
const String currentReleaseTag =
|
const String currentReleaseTag =
|
||||||
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
logs.add(tr('startedBgUpdateTask'));
|
logs.add(tr('startedBgUpdateTask'));
|
||||||
int? ignoreAfterMicroseconds = params?['ignoreAfterMicroseconds'];
|
int? ignoreAfterMicroseconds = params?['ignoreAfterMicroseconds'];
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await EasyLocalization.ensureInitialized();
|
||||||
await AndroidAlarmManager.initialize();
|
await AndroidAlarmManager.initialize();
|
||||||
DateTime? ignoreAfter = ignoreAfterMicroseconds != null
|
DateTime? ignoreAfter = ignoreAfterMicroseconds != null
|
||||||
? DateTime.fromMicrosecondsSinceEpoch(ignoreAfterMicroseconds)
|
? DateTime.fromMicrosecondsSinceEpoch(ignoreAfterMicroseconds)
|
||||||
|
@@ -416,7 +416,15 @@ class AppsProvider with ChangeNotifier {
|
|||||||
app.installedVersion = null;
|
app.installedVersion = null;
|
||||||
modded = true;
|
modded = true;
|
||||||
} else if (installedInfo != null && app.installedVersion == null) {
|
} else if (installedInfo != null && app.installedVersion == null) {
|
||||||
|
if (app.enhancedVersionDetection) {
|
||||||
app.installedVersion = installedInfo.versionName;
|
app.installedVersion = installedInfo.versionName;
|
||||||
|
} else {
|
||||||
|
if (app.latestVersion.contains(installedInfo.versionName!)) {
|
||||||
|
app.installedVersion = app.latestVersion;
|
||||||
|
} else {
|
||||||
|
app.installedVersion = installedInfo.versionName;
|
||||||
|
}
|
||||||
|
}
|
||||||
modded = true;
|
modded = true;
|
||||||
} else if (installedInfo?.versionName != app.installedVersion &&
|
} else if (installedInfo?.versionName != app.installedVersion &&
|
||||||
app.enhancedVersionDetection &&
|
app.enhancedVersionDetection &&
|
||||||
|
@@ -27,13 +27,14 @@ class AppNames {
|
|||||||
|
|
||||||
class APKDetails {
|
class APKDetails {
|
||||||
late String version;
|
late String version;
|
||||||
|
late String versionFromSource;
|
||||||
|
late bool isStandardVersion;
|
||||||
late List<String> apkUrls;
|
late List<String> apkUrls;
|
||||||
late bool isStandardVersionName;
|
|
||||||
|
|
||||||
APKDetails(version, this.apkUrls) {
|
APKDetails(this.versionFromSource, this.apkUrls) {
|
||||||
var standardVersion = extractStandardVersionName(version);
|
var temp = extractStandardVersionName(versionFromSource);
|
||||||
isStandardVersionName = standardVersion != null;
|
this.isStandardVersion = temp != null;
|
||||||
this.version = standardVersion ?? version;
|
this.version = temp ?? versionFromSource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ ObtainiumError getObtainiumHttpError(Response res) {
|
|||||||
|
|
||||||
String? extractStandardVersionName(String version, {bool strict = false}) {
|
String? extractStandardVersionName(String version, {bool strict = false}) {
|
||||||
var match = RegExp(
|
var match = RegExp(
|
||||||
'${strict ? '^' : ''}[0-9]+(\\.[0-9]+)+(-(alpha|beta)\\+?[0-9]+)?${strict ? '\$' : ''}')
|
'${strict ? '^' : ''}[0-9]+(\\.[0-9]+)+(-(alpha|beta|ocs)([0-9]+|\\+[0-9]+)?)?${strict ? '\$' : ''}')
|
||||||
.firstMatch(version);
|
.firstMatch(version);
|
||||||
return match != null ? version.substring(match.start, match.end) : null;
|
return match != null ? version.substring(match.start, match.end) : null;
|
||||||
}
|
}
|
||||||
@@ -284,6 +285,12 @@ class SourceProvider {
|
|||||||
if (apk.apkUrls.isEmpty && !trackOnly) {
|
if (apk.apkUrls.isEmpty && !trackOnly) {
|
||||||
throw NoAPKError();
|
throw NoAPKError();
|
||||||
}
|
}
|
||||||
|
bool enhancedVersionDetection = apk.isStandardVersion &&
|
||||||
|
installedVersion != null &&
|
||||||
|
extractStandardVersionName(installedVersion, strict: true) != null;
|
||||||
|
if (!enhancedVersionDetection) {
|
||||||
|
apk.version = apk.versionFromSource;
|
||||||
|
}
|
||||||
String apkVersion = apk.version.replaceAll('/', '-');
|
String apkVersion = apk.version.replaceAll('/', '-');
|
||||||
return App(
|
return App(
|
||||||
id ??
|
id ??
|
||||||
@@ -302,10 +309,7 @@ class SourceProvider {
|
|||||||
DateTime.now(),
|
DateTime.now(),
|
||||||
pinned,
|
pinned,
|
||||||
trackOnly,
|
trackOnly,
|
||||||
apk.isStandardVersionName &&
|
enhancedVersionDetection);
|
||||||
(installedVersion == null ||
|
|
||||||
extractStandardVersionName(installedVersion, strict: true) !=
|
|
||||||
null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns errors in [results, errors] instead of throwing them
|
// Returns errors in [results, errors] instead of throwing them
|
||||||
|
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 0.8.2+65 # When changing this, update the tag in main() accordingly
|
version: 0.8.3+66 # When changing this, update the tag in main() accordingly
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.2 <3.0.0'
|
sdk: '>=2.18.2 <3.0.0'
|
||||||
|
Reference in New Issue
Block a user