mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-23 17:39:42 +02:00
Compare commits
9 Commits
v0.14.13-b
...
v0.14.14-b
Author | SHA1 | Date | |
---|---|---|---|
|
4951f62d4a | ||
|
4c0c4b7010 | ||
|
96051e614c | ||
|
a2e494b2ba | ||
|
2d5a9bec84 | ||
|
7d9571cfdd | ||
|
acc6a780fa | ||
|
0e36d42a06 | ||
|
5cfddd807a |
@@ -256,6 +256,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Remover App?",
|
"one": "Remover App?",
|
||||||
"other": "Remover Apps?"
|
"other": "Remover Apps?"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Želite li ukloniti aplikaciju?",
|
"one": "Želite li ukloniti aplikaciju?",
|
||||||
"other": "Želite li ukloniti aplikacije?"
|
"other": "Želite li ukloniti aplikacije?"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "App entfernen?",
|
"one": "App entfernen?",
|
||||||
"other": "Apps entfernen?"
|
"other": "Apps entfernen?"
|
||||||
|
@@ -256,6 +256,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Remove App?",
|
"one": "Remove App?",
|
||||||
"other": "Remove Apps?"
|
"other": "Remove Apps?"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "¿Eliminar Aplicación?",
|
"one": "¿Eliminar Aplicación?",
|
||||||
"other": "¿Eliminar Aplicaciones?"
|
"other": "¿Eliminar Aplicaciones?"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "برنامه حذف شود؟",
|
"one": "برنامه حذف شود؟",
|
||||||
"other": "برنامه ها حذف شوند؟"
|
"other": "برنامه ها حذف شوند؟"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Supprimer l'application ?",
|
"one": "Supprimer l'application ?",
|
||||||
"other": "Supprimer les applications ?"
|
"other": "Supprimer les applications ?"
|
||||||
|
@@ -252,6 +252,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Eltávolítja az alkalmazást?",
|
"one": "Eltávolítja az alkalmazást?",
|
||||||
"other": "Eltávolítja az alkalmazást?"
|
"other": "Eltávolítja az alkalmazást?"
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Rimuovere l'app?",
|
"one": "Rimuovere l'app?",
|
||||||
"other": "Rimuovere le app?"
|
"other": "Rimuovere le app?"
|
||||||
|
@@ -254,6 +254,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "アプリを削除しますか?",
|
"one": "アプリを削除しますか?",
|
||||||
"other": "アプリを削除しますか?"
|
"other": "アプリを削除しますか?"
|
||||||
|
@@ -253,12 +253,14 @@
|
|||||||
"verifyLatestTag": "Zweryfikuj najnowszy tag",
|
"verifyLatestTag": "Zweryfikuj najnowszy tag",
|
||||||
"exemptFromBackgroundUpdates": "Wyklucz z uaktualnień w tle (jeśli są włączone)",
|
"exemptFromBackgroundUpdates": "Wyklucz z uaktualnień w tle (jeśli są włączone)",
|
||||||
"bgUpdatesOnWiFiOnly": "Wyłącz aktualizacje w tle, gdy nie ma połączenia z Wi-Fi",
|
"bgUpdatesOnWiFiOnly": "Wyłącz aktualizacje w tle, gdy nie ma połączenia z Wi-Fi",
|
||||||
"autoSelectHighestVersionCode": "Auto-select highest versionCode APK",
|
"autoSelectHighestVersionCode": "Automatycznie wybierz najwyższy kod wersji APK",
|
||||||
"versionExtractionRegEx": "Version Extraction RegEx",
|
"versionExtractionRegEx": "Wyrażenie regularne wyodrębniające wersję",
|
||||||
"matchGroupToUse": "Match Group to Use",
|
"matchGroupToUse": "Dopasuj grupę do użycia",
|
||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Wyróżnij mniej oczywiste elementy dotykowe",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Wybierz katalog eksportu",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Automatyczny eksport po wprowadzeniu zmian",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Usunąć aplikację?",
|
"one": "Usunąć aplikację?",
|
||||||
"few": "Usunąć aplikacje?",
|
"few": "Usunąć aplikacje?",
|
||||||
|
@@ -253,6 +253,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "Удалить приложение?",
|
"one": "Удалить приложение?",
|
||||||
"other": "Удалить приложения?"
|
"other": "Удалить приложения?"
|
||||||
|
@@ -254,6 +254,8 @@
|
|||||||
"highlightTouchTargets": "Highlight less obvious touch targets",
|
"highlightTouchTargets": "Highlight less obvious touch targets",
|
||||||
"pickExportDir": "Pick Export Directory",
|
"pickExportDir": "Pick Export Directory",
|
||||||
"autoExportOnChanges": "Auto-export on changes",
|
"autoExportOnChanges": "Auto-export on changes",
|
||||||
|
"filterVersionsByRegEx": "Filter Versions by Regular Expression",
|
||||||
|
"trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK",
|
||||||
"removeAppQuestion": {
|
"removeAppQuestion": {
|
||||||
"one": "是否删除应用?",
|
"one": "是否删除应用?",
|
||||||
"other": "是否删除应用?"
|
"other": "是否删除应用?"
|
||||||
|
@@ -13,10 +13,24 @@ class FDroid extends AppSource {
|
|||||||
name = tr('fdroid');
|
name = tr('fdroid');
|
||||||
canSearch = true;
|
canSearch = true;
|
||||||
additionalSourceAppSpecificSettingFormItems = [
|
additionalSourceAppSpecificSettingFormItems = [
|
||||||
|
[
|
||||||
|
GeneratedFormTextField('filterVersionsByRegEx',
|
||||||
|
label: tr('filterVersionsByRegEx'),
|
||||||
|
required: false,
|
||||||
|
additionalValidators: [
|
||||||
|
(value) {
|
||||||
|
return regExValidator(value);
|
||||||
|
}
|
||||||
|
])
|
||||||
|
],
|
||||||
|
[
|
||||||
|
GeneratedFormSwitch('trySelectingSuggestedVersionCode',
|
||||||
|
label: tr('trySelectingSuggestedVersionCode'), defaultValue: true)
|
||||||
|
],
|
||||||
[
|
[
|
||||||
GeneratedFormSwitch('autoSelectHighestVersionCode',
|
GeneratedFormSwitch('autoSelectHighestVersionCode',
|
||||||
label: tr('autoSelectHighestVersionCode'))
|
label: tr('autoSelectHighestVersionCode'))
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,25 +59,73 @@ class FDroid extends AppSource {
|
|||||||
|
|
||||||
APKDetails getAPKUrlsFromFDroidPackagesAPIResponse(
|
APKDetails getAPKUrlsFromFDroidPackagesAPIResponse(
|
||||||
Response res, String apkUrlPrefix, String standardUrl,
|
Response res, String apkUrlPrefix, String standardUrl,
|
||||||
{bool autoSelectHighestVersionCode = false}) {
|
{bool autoSelectHighestVersionCode = false,
|
||||||
|
bool trySelectingSuggestedVersionCode = false,
|
||||||
|
String? filterVersionsByRegEx}) {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
List<dynamic> releases = jsonDecode(res.body)['packages'] ?? [];
|
var response = jsonDecode(res.body);
|
||||||
|
List<dynamic> releases = response['packages'] ?? [];
|
||||||
if (releases.isEmpty) {
|
if (releases.isEmpty) {
|
||||||
throw NoReleasesError();
|
throw NoReleasesError();
|
||||||
}
|
}
|
||||||
String? latestVersion = releases[0]['versionName'];
|
String? version;
|
||||||
if (latestVersion == null) {
|
Iterable<dynamic> releaseChoices = [];
|
||||||
|
// Grab the versionCode suggested if the user chose to do that
|
||||||
|
// Only do so at this stage if the user has no release filter
|
||||||
|
if (trySelectingSuggestedVersionCode &&
|
||||||
|
response['suggestedVersionCode'] != null &&
|
||||||
|
filterVersionsByRegEx == null) {
|
||||||
|
var suggestedReleases = releases.where((element) =>
|
||||||
|
element['versionCode'] == response['suggestedVersionCode']);
|
||||||
|
if (suggestedReleases.isNotEmpty) {
|
||||||
|
releaseChoices = suggestedReleases;
|
||||||
|
version = suggestedReleases.first['versionName'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Apply the release filter if any
|
||||||
|
if (filterVersionsByRegEx != null) {
|
||||||
|
version = null;
|
||||||
|
releaseChoices = [];
|
||||||
|
for (var i = 0; i < releases.length; i++) {
|
||||||
|
if (RegExp(filterVersionsByRegEx)
|
||||||
|
.hasMatch(releases[i]['versionName'])) {
|
||||||
|
version = releases[i]['versionName'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (version == null) {
|
||||||
|
throw NoVersionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Default to the highest version
|
||||||
|
version ??= releases[0]['versionName'];
|
||||||
|
if (version == null) {
|
||||||
throw NoVersionError();
|
throw NoVersionError();
|
||||||
}
|
}
|
||||||
Iterable<dynamic> latestReleases =
|
// If a suggested release was not already picked, pick all those with the selected version
|
||||||
releases.where((element) => element['versionName'] == latestVersion);
|
if (releaseChoices.isEmpty) {
|
||||||
if (latestReleases.length > 1 && autoSelectHighestVersionCode) {
|
releaseChoices =
|
||||||
latestReleases = [latestReleases.first];
|
releases.where((element) => element['versionName'] == version);
|
||||||
}
|
}
|
||||||
List<String> apkUrls = latestReleases
|
// For the remaining releases, use the toggles to auto-select one if possible
|
||||||
|
if (releaseChoices.length > 1) {
|
||||||
|
if (autoSelectHighestVersionCode) {
|
||||||
|
releaseChoices = [releaseChoices.first];
|
||||||
|
} else if (trySelectingSuggestedVersionCode &&
|
||||||
|
response['suggestedVersionCode'] != null) {
|
||||||
|
var suggestedReleases = releaseChoices.where((element) =>
|
||||||
|
element['versionCode'] == response['suggestedVersionCode']);
|
||||||
|
if (suggestedReleases.isNotEmpty) {
|
||||||
|
releaseChoices = suggestedReleases;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (releaseChoices.isEmpty) {
|
||||||
|
throw NoReleasesError();
|
||||||
|
}
|
||||||
|
List<String> apkUrls = releaseChoices
|
||||||
.map((e) => '${apkUrlPrefix}_${e['versionCode']}.apk')
|
.map((e) => '${apkUrlPrefix}_${e['versionCode']}.apk')
|
||||||
.toList();
|
.toList();
|
||||||
return APKDetails(latestVersion, getApkUrlsFromUrls(apkUrls),
|
return APKDetails(version, getApkUrlsFromUrls(apkUrls),
|
||||||
AppNames(name, Uri.parse(standardUrl).pathSegments.last));
|
AppNames(name, Uri.parse(standardUrl).pathSegments.last));
|
||||||
} else {
|
} else {
|
||||||
throw getObtainiumHttpError(res);
|
throw getObtainiumHttpError(res);
|
||||||
@@ -82,7 +144,15 @@ class FDroid extends AppSource {
|
|||||||
'https://$host/repo/$appId',
|
'https://$host/repo/$appId',
|
||||||
standardUrl,
|
standardUrl,
|
||||||
autoSelectHighestVersionCode:
|
autoSelectHighestVersionCode:
|
||||||
additionalSettings['autoSelectHighestVersionCode'] == true);
|
additionalSettings['autoSelectHighestVersionCode'] == true,
|
||||||
|
trySelectingSuggestedVersionCode:
|
||||||
|
additionalSettings['trySelectingSuggestedVersionCode'] == true,
|
||||||
|
filterVersionsByRegEx:
|
||||||
|
(additionalSettings['filterVersionsByRegEx'] as String?)
|
||||||
|
?.isNotEmpty ==
|
||||||
|
true
|
||||||
|
? additionalSettings['filterVersionsByRegEx']
|
||||||
|
: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@@ -40,6 +40,9 @@ class IzzyOnDroid extends AppSource {
|
|||||||
'https://android.izzysoft.de/frepo/$appId',
|
'https://android.izzysoft.de/frepo/$appId',
|
||||||
standardUrl,
|
standardUrl,
|
||||||
autoSelectHighestVersionCode:
|
autoSelectHighestVersionCode:
|
||||||
additionalSettings['autoSelectHighestVersionCode'] == true);
|
additionalSettings['autoSelectHighestVersionCode'] == true,
|
||||||
|
trySelectingSuggestedVersionCode:
|
||||||
|
additionalSettings['trySelectingSuggestedVersionCode'] == true,
|
||||||
|
filterVersionsByRegEx: additionalSettings['filterVersionsByRegEx']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
|
|||||||
// ignore: implementation_imports
|
// ignore: implementation_imports
|
||||||
import 'package:easy_localization/src/localization.dart';
|
import 'package:easy_localization/src/localization.dart';
|
||||||
|
|
||||||
const String currentVersion = '0.14.13';
|
const String currentVersion = '0.14.14';
|
||||||
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
|
||||||
|
|
||||||
|
@@ -148,7 +148,7 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
userPickedTrackOnly))) {
|
userPickedTrackOnly))) {
|
||||||
var trackOnly = pickedSource!.enforceTrackOnly || userPickedTrackOnly;
|
var trackOnly = pickedSource!.enforceTrackOnly || userPickedTrackOnly;
|
||||||
app = await sourceProvider.getApp(
|
app = await sourceProvider.getApp(
|
||||||
pickedSource!, userInput, additionalSettings,
|
pickedSource!, userInput.trim(), additionalSettings,
|
||||||
trackOnlyOverride: trackOnly,
|
trackOnlyOverride: trackOnly,
|
||||||
overrideSource: pickedSourceOverride,
|
overrideSource: pickedSourceOverride,
|
||||||
inferAppIdIfOptional: inferAppIdIfOptional);
|
inferAppIdIfOptional: inferAppIdIfOptional);
|
||||||
|
@@ -430,7 +430,8 @@ class AppsProvider with ChangeNotifier {
|
|||||||
zipFile: File(filePath), destinationDir: Directory(destinationPath));
|
zipFile: File(filePath), destinationDir: Directory(destinationPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> installXApkDir(DownloadedXApkDir dir) async {
|
Future<void> installXApkDir(
|
||||||
|
DownloadedXApkDir dir, BuildContext? context) async {
|
||||||
// We don't know which APKs in an XAPK are supported by the user's device
|
// We don't know which APKs in an XAPK are supported by the user's device
|
||||||
// So we try installing all of them and assume success if at least one installed
|
// So we try installing all of them and assume success if at least one installed
|
||||||
// If 0 APKs installed, throw the first install error encountered
|
// If 0 APKs installed, throw the first install error encountered
|
||||||
@@ -443,7 +444,7 @@ class AppsProvider with ChangeNotifier {
|
|||||||
if (file.path.toLowerCase().endsWith('.apk')) {
|
if (file.path.toLowerCase().endsWith('.apk')) {
|
||||||
try {
|
try {
|
||||||
somethingInstalled = somethingInstalled ||
|
somethingInstalled = somethingInstalled ||
|
||||||
await installApk(DownloadedApk(dir.appId, file));
|
await installApk(DownloadedApk(dir.appId, file), context);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logs.add(
|
logs.add(
|
||||||
'Could not install APK from XAPK \'${file.path}\': ${e.toString()}');
|
'Could not install APK from XAPK \'${file.path}\': ${e.toString()}');
|
||||||
@@ -463,7 +464,7 @@ class AppsProvider with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> installApk(DownloadedApk file) async {
|
Future<bool> installApk(DownloadedApk file, BuildContext? context) async {
|
||||||
var newInfo =
|
var newInfo =
|
||||||
await pm.getPackageArchiveInfo(archiveFilePath: file.file.path);
|
await pm.getPackageArchiveInfo(archiveFilePath: file.file.path);
|
||||||
PackageInfo? appInfo = await getInstalledInfo(apps[file.appId]!.app.id);
|
PackageInfo? appInfo = await getInstalledInfo(apps[file.appId]!.app.id);
|
||||||
@@ -472,8 +473,16 @@ class AppsProvider with ChangeNotifier {
|
|||||||
!(await canDowngradeApps())) {
|
!(await canDowngradeApps())) {
|
||||||
throw DowngradeError();
|
throw DowngradeError();
|
||||||
}
|
}
|
||||||
int? code =
|
int? code;
|
||||||
await AndroidPackageInstaller.installApk(apkFilePath: file.file.path);
|
if (context == null) {
|
||||||
|
// In background installs, 'installApk' never returns so don't wait for it
|
||||||
|
// TODO: Find a fix to make this work synchronously without context
|
||||||
|
AndroidPackageInstaller.installApk(apkFilePath: file.file.path);
|
||||||
|
code = 0; // Be optimistic (ver. det. will get most wrong ones anyways)
|
||||||
|
} else {
|
||||||
|
code =
|
||||||
|
await AndroidPackageInstaller.installApk(apkFilePath: file.file.path);
|
||||||
|
}
|
||||||
bool installed = false;
|
bool installed = false;
|
||||||
if (code != null && code != 0 && code != 3) {
|
if (code != null && code != 0 && code != 3) {
|
||||||
throw InstallError(code);
|
throw InstallError(code);
|
||||||
@@ -640,19 +649,11 @@ class AppsProvider with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
try {
|
try {
|
||||||
if (downloadedFile != null) {
|
if (downloadedFile != null) {
|
||||||
if (willBeSilent && context == null) {
|
// ignore: use_build_context_synchronously
|
||||||
// Would await forever - workaround - TODO
|
await installApk(downloadedFile, context);
|
||||||
installApk(downloadedFile);
|
|
||||||
} else {
|
|
||||||
await installApk(downloadedFile);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (willBeSilent && context == null) {
|
// ignore: use_build_context_synchronously
|
||||||
// Would await forever - workaround - TODO
|
await installXApkDir(downloadedDir!, context);
|
||||||
installXApkDir(downloadedDir!);
|
|
||||||
} else {
|
|
||||||
await installXApkDir(downloadedDir!);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (willBeSilent && context == null) {
|
if (willBeSilent && context == null) {
|
||||||
notificationsProvider?.notify(SilentUpdateAttemptNotification(
|
notificationsProvider?.notify(SilentUpdateAttemptNotification(
|
||||||
@@ -1132,7 +1133,8 @@ class AppsProvider with ChangeNotifier {
|
|||||||
displayName:
|
displayName:
|
||||||
'${tr('obtainiumExportHyphenatedLowercase')}-${DateTime.now().toIso8601String().replaceAll(':', '-')}${isAuto ? '-auto' : ''}.json',
|
'${tr('obtainiumExportHyphenatedLowercase')}-${DateTime.now().toIso8601String().replaceAll(':', '-')}${isAuto ? '-auto' : ''}.json',
|
||||||
mimeType: 'application/json',
|
mimeType: 'application/json',
|
||||||
content: jsonEncode(apps.values.map((e) => e.app.toJson()).toList()));
|
bytes: Uint8List.fromList(utf8.encode(
|
||||||
|
jsonEncode(apps.values.map((e) => e.app.toJson()).toList()))));
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw ObtainiumError(tr('unexpectedError'));
|
throw ObtainiumError(tr('unexpectedError'));
|
||||||
}
|
}
|
||||||
|
16
pubspec.lock
16
pubspec.lock
@@ -46,10 +46,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: "49b1fad315e57ab0bbc15bcbb874e83116a1d78f77ebd500a4af6c9407d6b28e"
|
sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.8"
|
version: "3.3.9"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -320,10 +320,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_markdown
|
name: flutter_markdown
|
||||||
sha256: d4a1cb250c4e059586af0235f32e02882860a508e189b61f2b31b8810c1e1330
|
sha256: a10979814c5f4ddbe2b6143fba25d927599e21e3ba65b3862995960606fae78f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.17+2"
|
version: "0.6.17+3"
|
||||||
flutter_plugin_android_lifecycle:
|
flutter_plugin_android_lifecycle:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -538,18 +538,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
sha256: bc56bfe9d3f44c3c612d8d393bd9b174eb796d706759f9b495ac254e4294baa5
|
sha256: ad65ba9af42a3d067203641de3fd9f547ded1410bad3b84400c2b4899faede70
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.4.5"
|
version: "11.0.0"
|
||||||
permission_handler_android:
|
permission_handler_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_android
|
name: permission_handler_android
|
||||||
sha256: "59c6322171c29df93a22d150ad95f3aa19ed86542eaec409ab2691b8f35f9a47"
|
sha256: f23cfe9af0d49c6b9fd8a8b09f7b3301ca7e346204939b5afef4404d36d2608f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.3.6"
|
version: "11.0.1"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@@ -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.14.13+205 # When changing this, update the tag in main() accordingly
|
version: 0.14.14+206 # When changing this, update the tag in main() accordingly
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
@@ -46,7 +46,7 @@ dependencies:
|
|||||||
html: ^0.15.0
|
html: ^0.15.0
|
||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
url_launcher: ^6.1.5
|
url_launcher: ^6.1.5
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^11.0.0
|
||||||
fluttertoast: ^8.0.9
|
fluttertoast: ^8.0.9
|
||||||
device_info_plus: ^9.0.0
|
device_info_plus: ^9.0.0
|
||||||
file_picker: ^5.2.10
|
file_picker: ^5.2.10
|
||||||
|
Reference in New Issue
Block a user