Merge pull request #1439 from ImranR98/dev

- Allow any source to be overridden (#1420)
- Bugfix for installing apps with ID change step (#1424)
- Bugfix: 'null' changelog for some track-only apps (#1425)
- Show latest APK name/count on app page (#1426)
- More BG update interval options (#1431)
This commit is contained in:
Imran
2024-03-01 20:37:02 -05:00
committed by GitHub
27 changed files with 131 additions and 73 deletions

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Uklonite zastarjeli filter aplikacija",
"showOutdatedOnly": "Prikaži samo zastarjele aplikacije",
"filter": "Filtriranje",
"filterActive": "Filtriranje",
"filterApps": "Filtriraj aplikacije",
"appName": "Naziv aplikacije",
"author": "Autor",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} i još jedna aplikacija je vjerovatno ažurirana.",
"other": "{} i još {} aplikacija su vjerovatno ažurirane."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Odstranit filtr Neaktuální",
"showOutdatedOnly": "Zobrazovat pouze zastaralé aplikace",
"filter": "Filtr",
"filterActive": "Filtr *",
"filterApps": "Filtrovat aplikace",
"appName": "Název aplikace",
"author": "Autor",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} a 1 další aplikace možno aktualizovat",
"other": "{} a {} další aplikace mohou být aktualizovány."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "App-Filter Nicht aktuell entfernen",
"showOutdatedOnly": "Nur nicht aktuelle Apps anzeigen",
"filter": "Filter",
"filterActive": "Filter *",
"filterApps": "Apps filtern",
"appName": "App Name",
"author": "Autor",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} und 1 weitere Anwendung wurden möglicherweise aktualisiert.",
"other": "{} und {} weitere Anwendungen wurden möglicherweise aktualisiert."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -351,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} and 1 more app may have been updated.",
"other": "{} and {} more apps may have been updated."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Elimiar filtro de aplicaciones desactualizado",
"showOutdatedOnly": "Mostrar solo aplicaciones desactualizadas",
"filter": "Filtrar",
"filterActive": "Filtrar *",
"filterApps": "Filtrar Actualizaciones",
"appName": "Nombre de la aplicación",
"author": "Autor",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} y 1 aplicación más podría haber sido actualizada.",
"other": "{} y {} aplicaciones más podrían haber sido actualizadas."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "فیلتر برنامه قدیمی را حذف کنید",
"showOutdatedOnly": "فقط برنامه های قدیمی را نشان دهید",
"filter": "فیلتر",
"filterActive": "فیلتر *",
"filterApps": "فیلتر کردن برنامه ها",
"appName": "نام برنامه",
"author": "سازنده",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} و 1 برنامه دیگر ممکن است به روز شده باشند.",
"other": "ممکن است {} و {} برنامه های دیگر به روز شده باشند."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Supprimer le filtre d'application obsolète",
"showOutdatedOnly": "Afficher uniquement les applications obsolètes",
"filter": "Filtre",
"filterActive": "Filtre *",
"filterApps": "Filtrer les applications",
"appName": "Nom de l'application",
"author": "Auteur",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"une": "{} et 1 application supplémentaire ont peut-être été mises à jour.",
"other": "{} et {} autres applications peuvent avoir été mises à jour."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Távolítsa el az elavult app szűrőt",
"showOutdatedOnly": "Csak az elavult appok megjelenítése",
"filter": "Szűrő",
"filterActive": "Szűrő *",
"filterApps": "Appok szűrése",
"appName": "App név",
"author": "Szerző",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} és 1 további alkalmazás is frissült.",
"other": "{} és {} további alkalmazás is frissült."
},
"apk": {
"one": "{} APK",
"other": "{} APK-k"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Rimuovi il filtro per le app non aggiornate",
"showOutdatedOnly": "Mostra solo le app non aggiornate",
"filter": "Filtri",
"filterActive": "Filtri *",
"filterApps": "Filtra app",
"appName": "Nome dell'app",
"author": "Autore",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} e un'altra app potrebbero essere state aggiornate.",
"other": "{} e altre {} app potrebbero essere state aggiornate."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "アップデートが存在するアプリのフィルターを解除",
"showOutdatedOnly": "アップデートが存在するアプリのみ表示する",
"filter": "フィルター",
"filterActive": "フィルター *",
"filterApps": "アプリをフィルタリングする",
"appName": "アプリ名",
"author": "作者",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} とさらに 1 個のアプリがアップデートされた可能性があります。",
"other": "{} とさらに {} 個のアプリがアップデートされた可能性があります。"
},
"apk": {
"one": "{}APK",
"other": "{}APK"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Verwijder out-of-date app filter",
"showOutdatedOnly": "Toon alleen out-of-date apps",
"filter": "Filter",
"filterActive": "Filteren *",
"filterApps": "Filter apps",
"appName": "App naam",
"author": "Auteur",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} en nog 1 app zijn mogelijk bijgewerkt.",
"other": "{} en {} meer apps zijn mogelijk bijgwerkt."
},
"apk": {
"one": "{} APK",
"other": "{} APK's"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Usuń filtr nieaktualnych aplikacji",
"showOutdatedOnly": "Pokaż tylko nieaktualne aplikacje",
"filter": "FIltr",
"filterActive": "Filtruj *",
"filterApps": "Filtruj aplikacje",
"appName": "Nazwa aplikacji",
"author": "Autor",
@@ -378,5 +377,9 @@
"few": "{} i {} inne apki mogły zostać zaktualizowane.",
"many": "{} i {} innych apek mogło zostać zaktualizowanych.",
"other": "{} i {} inne apki mogły zostać zaktualizowane."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Remover filtro de aplicativos desatualizados",
"showOutdatedOnly": "Mostrar apenas aplicativos desatualizados",
"filter": "Filtro",
"filterActive": "Filtro *",
"filterApps": "Filtrar aplicativos",
"appName": "Nome do aplicativo",
"author": "Autor",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} e um outro aplicativo podem ter sido atualizados.",
"other": "{} e {} outros aplicativos podem ter sido atualizados."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Удалить фильтр для устаревших приложений",
"showOutdatedOnly": "Показывать только устаревшие приложения",
"filter": "Фильтр",
"filterActive": "Фильтр *",
"filterApps": "Фильтровать приложения",
"appName": "Название приложения",
"author": "Автор",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} и ещё 1 приложение могли быть обновлены",
"other": "{} и ещё {} приложений могли быть обновлены"
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -58,11 +58,10 @@ const main = async () => {
return `${translationsDir}/${f}`
}).filter(f => f.endsWith('.json') && f != templateFile)
const templateTranslation = require(templateFile)
const templateTranslation = JSON.parse(fs.readFileSync(templateFile).toString())
otherFiles.forEach(file => {
const thisTranslationOriginal = require(file)
const thisTranslationOriginal = JSON.parse(fs.readFileSync((file).toString()))
const thisTranslationNew = {}
Object.keys(templateTranslation).forEach(k => {
thisTranslationNew[k] = thisTranslationOriginal[k] || templateTranslation[k]
@@ -72,7 +71,7 @@ const main = async () => {
for (let i in otherFiles) {
const file = otherFiles[i]
const thisTranslation = require(file)
const thisTranslation = JSON.parse(fs.readFileSync((file).toString()))
const translationKeys = Object.keys(templateTranslation)
for (let j in translationKeys) {
const k = translationKeys[j]

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Ta bort Utgånga App-filtret",
"showOutdatedOnly": "Visa Endast Utgånga Appar",
"filter": "Filtrera",
"filterActive": "Filter *",
"filterApps": "Filtrera Appar",
"appName": "Appnamn",
"author": "Utvecklare",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} och 1 till app kan ha uppdaterats.",
"other": "{} och {} appar till kan ha uppdaterats."
},
"apk": {
"one": "{} APK",
"other": "{} APK:er"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "Güncel Olmayan Uygulama Filtresini Kaldır",
"showOutdatedOnly": "Yalnızca Güncel Olmayan Uygulamaları Göster",
"filter": "Filtre",
"filterActive": "Filtre *",
"filterApps": "Uygulamaları Filtrele",
"appName": "Uygulama Adı",
"author": "Yazar",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} ve 1 diğer uygulama muhtemelen güncellendi.",
"other": "{} ve {} daha fazla uygulama muhtemelen güncellendi."
},
"apk": {
"one": "{} APK",
"other": "{} APK'lar"
}
}

View File

@@ -351,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} và 1 ứng dụng khác có thể đã được cập nhật.",
"other": "{} và {} ứng dụng khác có thể đã được cập nhật."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}

View File

@@ -80,7 +80,6 @@
"removeOutdatedFilter": "删除失效的应用筛选",
"showOutdatedOnly": "只显示待更新应用",
"filter": "筛选",
"filterActive": "筛选 *",
"filterApps": "筛选应用",
"appName": "应用名称",
"author": "作者",
@@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} 和另外 1 个应用已尝试更新。",
"other": "“{}”和另外 {} 个应用已尝试更新。"
},
"apk": {
"one": "{}APK",
"other": "{}APK"
}
}

View File

@@ -400,7 +400,7 @@ class GitHub extends AppSource {
if (version == null) {
throw NoVersionError();
}
var changeLog = targetRelease['body'].toString();
var changeLog = (targetRelease['body'] ?? '').toString();
return APKDetails(
version,
targetRelease['apkUrls'] as List<MapEntry<String, String>>,

View File

@@ -1,7 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:obtainium/app_sources/html.dart';
import 'package:obtainium/components/custom_app_bar.dart';
import 'package:obtainium/components/generated_form.dart';
import 'package:obtainium/components/generated_form_modal.dart';
@@ -62,18 +61,6 @@ class AddAppPageState extends State<AddAppPage> {
var prevHost = pickedSource?.hosts.isNotEmpty == true
? pickedSource?.hosts[0]
: null;
try {
var naturalSource =
valid ? sourceProvider.getSource(userInput) : null;
if (naturalSource != null &&
naturalSource.runtimeType.toString() !=
HTML().runtimeType.toString()) {
// If input has changed to match a regular source, reset the override
pickedSourceOverride = null;
}
} catch (e) {
// ignore
}
var source = valid
? sourceProvider.getSource(userInput,
overrideSource: pickedSourceOverride)
@@ -361,8 +348,9 @@ class AddAppPageState extends State<AddAppPage> {
[
GeneratedFormDropdown(
'overrideSource',
defaultValue: HTML().runtimeType.toString(),
defaultValue: '',
[
MapEntry('', tr('none')),
...sourceProvider.sources.map(
(s) => MapEntry(s.runtimeType.toString(), s.name))
],
@@ -577,11 +565,7 @@ class AddAppPageState extends State<AddAppPage> {
const SizedBox(
height: 16,
),
if (pickedSourceOverride != null ||
(pickedSource != null &&
pickedSource.runtimeType.toString() ==
HTML().runtimeType.toString()))
getHTMLSourceOverrideDropdown(),
if (pickedSource != null) getHTMLSourceOverrideDropdown(),
if (shouldShowSearchBar()) getSearchBarRow(),
if (pickedSource != null)
FutureBuilder(

View File

@@ -104,6 +104,10 @@ class _AppPageState extends State<AppPage> {
if (installedVersionIsEstimate) {
infoLines = '${tr('pseudoVersionInUse')}\n$infoLines';
}
if ((app?.app.apkUrls.length ?? 0) > 0) {
infoLines =
'$infoLines\n${app?.app.apkUrls.length == 1 ? app?.app.apkUrls[0].key : plural('apk', app?.app.apkUrls.length ?? 0)}';
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,

View File

@@ -717,7 +717,7 @@ class AppsProvider with ChangeNotifier {
appsToInstall =
moveStrToEnd(appsToInstall, obtainiumId, strB: obtainiumTempId);
Future<void> updateFn(String id, {bool skipInstalls = false}) async {
Future<String> updateFn(String id, {bool skipInstalls = false}) async {
try {
var downloadedArtifact =
// ignore: use_build_context_synchronously
@@ -730,8 +730,8 @@ class AppsProvider with ChangeNotifier {
} else {
downloadedDir = downloadedArtifact as DownloadedXApkDir;
}
var appId = downloadedFile?.appId ?? downloadedDir!.appId;
bool willBeSilent = await canInstallSilently(apps[appId]!.app);
id = downloadedFile?.appId ?? downloadedDir!.appId;
bool willBeSilent = await canInstallSilently(apps[id]!.app);
switch (settingsProvider.installMethod) {
case InstallMethodSettings.normal:
if (!(await settingsProvider.getInstallPermission(
@@ -773,18 +773,19 @@ class AppsProvider with ChangeNotifier {
}
if (willBeSilent && context == null) {
notificationsProvider?.notify(SilentUpdateAttemptNotification(
[apps[appId]!.app],
id: appId.hashCode));
[apps[id]!.app],
id: id.hashCode));
}
installedIds.add(id);
}
} finally {
apps[id]?.downloadProgress = null;
notifyListeners();
}
installedIds.add(id);
} catch (e) {
errors.add(id, e, appName: apps[id]?.name);
}
return id;
}
if (forceParallelDownloads || !settingsProvider.parallelDownloads) {
@@ -792,9 +793,9 @@ class AppsProvider with ChangeNotifier {
await updateFn(id);
}
} else {
await Future.wait(
List<String> ids = await Future.wait(
appsToInstall.map((id) => updateFn(id, skipInstalls: true)));
for (var id in appsToInstall) {
for (var id in ids) {
if (!errors.appIdNames.containsKey(id)) {
await updateFn(id);
}

View File

@@ -30,8 +30,22 @@ enum SortOrderSettings { ascending, descending }
const maxAPIRateLimitMinutes = 30;
const minUpdateIntervalMinutes = maxAPIRateLimitMinutes + 30;
const maxUpdateIntervalMinutes = 4320;
List<int> updateIntervals = [15, 30, 60, 120, 180, 360, 720, 1440, 4320, 0]
const maxUpdateIntervalMinutes = 43200;
List<int> updateIntervals = [
15,
30,
60,
120,
180,
360,
720,
1440,
4320,
10080,
20160,
43200,
0
]
.where((element) =>
(element >= minUpdateIntervalMinutes &&
element <= maxUpdateIntervalMinutes) ||

View File

@@ -70,10 +70,10 @@ packages:
dependency: "direct main"
description:
name: background_fetch
sha256: "34550cf9b383e5a1844e7d22119aa500508c7df9421fa967c9fb4430d6cb2878"
sha256: "1a7868d9bd165eb177f039ff8244cfa7952340b18f7caabf322b26e712b438a3"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "1.2.3"
boolean_selector:
dependency: transitive
description:
@@ -150,10 +150,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5"
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
url: "https://pub.dev"
source: hosted
version: "0.3.3+7"
version: "0.3.4+1"
crypto:
dependency: "direct main"
description:
@@ -206,18 +206,18 @@ packages:
dependency: "direct main"
description:
name: dynamic_color
sha256: a866f1f8947bfdaf674d7928e769eac7230388a2e7a2542824fad4bb5b87be3b
sha256: eae98052fa6e2826bdac3dd2e921c6ce2903be15c6b7f8b6d8a5d49b5086298d
url: "https://pub.dev"
source: hosted
version: "1.6.9"
version: "1.7.0"
easy_localization:
dependency: "direct main"
description:
name: easy_localization
sha256: "9c86754b22aaa3e74e471635b25b33729f958dd6fb83df0ad6612948a7b231af"
sha256: c145aeb6584aedc7c862ab8c737c3277788f47488bfdf9bae0fe112bd0a4789c
url: "https://pub.dev"
source: hosted
version: "3.0.4"
version: "3.0.5"
easy_logger:
dependency: transitive
description:
@@ -336,10 +336,10 @@ packages:
dependency: "direct main"
description:
name: flutter_markdown
sha256: "21b085a1c185e46701373866144ced56cfb7a0c33f63c916bb8fe2d0c1491278"
sha256: a64c5323ac83ed2b7940d2b6288d160aa1753ff271ba9d9b2a86770414aa3eab
url: "https://pub.dev"
source: hosted
version: "0.6.19"
version: "0.6.20+1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@@ -666,10 +666,10 @@ packages:
dependency: "direct main"
description:
name: provider
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
url: "https://pub.dev"
source: hosted
version: "6.1.1"
version: "6.1.2"
share_plus:
dependency: "direct main"
description:
@@ -730,10 +730,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.3.0"
shared_preferences_windows:
dependency: transitive
description:
@@ -855,10 +855,10 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c
sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
version: "6.2.5"
url_launcher_android:
dependency: transitive
description:
@@ -871,10 +871,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
version: "6.2.5"
url_launcher_linux:
dependency: transitive
description:
@@ -903,10 +903,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.0"
url_launcher_windows:
dependency: transitive
description:
@@ -1021,4 +1021,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.6"
flutter: ">=3.19.0"

View File

@@ -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
# 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.
version: 1.0.3+2253 # When changing this, update the tag in main() accordingly
version: 1.0.4+2254 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=3.0.0 <4.0.0'