From bd8f608ee66e30cc4f8392b2f64719ee018d7c30 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Mon, 28 Aug 2023 20:02:09 -0400 Subject: [PATCH] Allow apps to be exempted from BG updates (#822) --- assets/translations/bs.json | 1 + assets/translations/de.json | 1 + assets/translations/en.json | 1 + assets/translations/es.json | 1 + assets/translations/fa.json | 1 + assets/translations/fr.json | 1 + assets/translations/hu.json | 1 + assets/translations/it.json | 1 + assets/translations/ja.json | 1 + assets/translations/pl.json | 1 + assets/translations/ru.json | 1 + assets/translations/zh.json | 1 + lib/providers/apps_provider.dart | 3 +++ lib/providers/source_provider.dart | 6 +++++- 14 files changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/translations/bs.json b/assets/translations/bs.json index 9590708..7a928a6 100644 --- a/assets/translations/bs.json +++ b/assets/translations/bs.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Želite li ukloniti aplikaciju?", "other": "Želite li ukloniti aplikacije?" diff --git a/assets/translations/de.json b/assets/translations/de.json index cd31e8a..1c588a6 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" diff --git a/assets/translations/en.json b/assets/translations/en.json index d86d9a1..bbebf39 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -250,6 +250,7 @@ "verifyLatestTag": "Verify the 'latest' tag", "intermediateLinkRegex": "Filter for an 'Intermediate' Link to Visit First", "intermediateLinkNotFound": "Intermediate link not found", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Remove App?", "other": "Remove Apps?" diff --git a/assets/translations/es.json b/assets/translations/es.json index a7968a7..95626c1 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "¿Eliminar Aplicación?", "other": "¿Eliminar Aplicaciones?" diff --git a/assets/translations/fa.json b/assets/translations/fa.json index 5d7e754..b2bb37a 100644 --- a/assets/translations/fa.json +++ b/assets/translations/fa.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "برنامه حذف شود؟", "other": "برنامه ها حذف شوند؟" diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 4f7e585..0b0a4d3 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Supprimer l'application ?", "other": "Supprimer les applications ?" diff --git a/assets/translations/hu.json b/assets/translations/hu.json index 8c3a71e..80db119 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -246,6 +246,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Eltávolítja az alkalmazást?", "other": "Eltávolítja az alkalmazást?" diff --git a/assets/translations/it.json b/assets/translations/it.json index 75d5778..addad9e 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Rimuovere l'app?", "other": "Rimuovere le app?" diff --git a/assets/translations/ja.json b/assets/translations/ja.json index e2d360c..1366fd0 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -248,6 +248,7 @@ "backgroundUpdateReqsExplanation": "バックグラウンドアップデートは、すべてのアプリで可能とは限りません。", "backgroundUpdateLimitsExplanation": "バックグラウンドアップデートが成功したかどうかは、Obtainiumを起動したときにしか判断できません。", "verifyLatestTag": "'latest'タグを確認する", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" diff --git a/assets/translations/pl.json b/assets/translations/pl.json index e6ca53d..eacaa63 100644 --- a/assets/translations/pl.json +++ b/assets/translations/pl.json @@ -253,6 +253,7 @@ "backgroundUpdateReqsExplanation": "Aktualizacje w tle mogą nie być możliwe dla wszystkich aplikacji.", "backgroundUpdateLimitsExplanation": "Powodzenie instalacji w tle można określić dopiero po otwarciu Obtainium.", "verifyLatestTag": "Zweryfikuj najnowszy tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Usunąć aplikację?", "few": "Usunąć aplikacje?", diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 6c91980..48f47f3 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -247,6 +247,7 @@ "backgroundUpdateReqsExplanation": "Background updates may not be possible for all apps.", "backgroundUpdateLimitsExplanation": "The success of a background install can only be determined when Obtainium is opened.", "verifyLatestTag": "Verify the 'latest' tag", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "removeAppQuestion": { "one": "Удалить приложение?", "other": "Удалить приложения?" diff --git a/assets/translations/zh.json b/assets/translations/zh.json index 5ab313d..9457fe1 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -247,6 +247,7 @@ "enableBackgroundUpdates": "启用后台更新", "backgroundUpdateReqsExplanation": "后台更新未必适用于所有的应用。", "backgroundUpdateLimitsExplanation": "只有在启动 Obtainium 时才能确认安装是否成功。", + "examptFromBackgroundUpdates": "Exempt from background updates (if enabled)", "verifyLatestTag": "验证“Latest”标签", "removeAppQuestion": { "one": "是否删除应用?", diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 5b673b6..08523c4 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -366,6 +366,9 @@ class AppsProvider with ChangeNotifier { if (!settingsProvider.enableBackgroundUpdates) { return false; } + if (app.additionalSettings['examptFromBackgroundUpdates'] == true) { + return false; + } if (app.apkUrls.length > 1) { // Manual API selection means silent install is not possible return false; diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 9eef449..e0e11e7 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -425,7 +425,11 @@ abstract class AppSource { GeneratedFormSwitch('autoApkFilterByArch', label: tr('autoApkFilterByArch'), defaultValue: true) ], - [GeneratedFormTextField('appName', label: tr('appName'), required: false)] + [GeneratedFormTextField('appName', label: tr('appName'), required: false)], + [ + GeneratedFormSwitch('examptFromBackgroundUpdates', + label: tr('examptFromBackgroundUpdates')) + ] ]; // Previous 2 variables combined into one at runtime for convenient usage