diff --git a/assets/translations/bs.json b/assets/translations/bs.json index 3c86b69..12f5336 100644 --- a/assets/translations/bs.json +++ b/assets/translations/bs.json @@ -300,6 +300,7 @@ "invertRegEx": "Obrni regularni izraz", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Želite li ukloniti aplikaciju?", "other": "Želite li ukloniti aplikacije?" diff --git a/assets/translations/cs.json b/assets/translations/cs.json index 5c65281..16bc773 100644 --- a/assets/translations/cs.json +++ b/assets/translations/cs.json @@ -300,6 +300,7 @@ "invertRegEx": "Invertovat regulární výraz", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Odstranit Apku?", "other": "Odstranit Apky?" diff --git a/assets/translations/de.json b/assets/translations/de.json index 2c976dc..f515d2a 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -300,6 +300,7 @@ "invertRegEx": "Regulären Ausdruck invertieren", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" diff --git a/assets/translations/en.json b/assets/translations/en.json index d37888f..cecb9c4 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -300,6 +300,7 @@ "invertRegEx": "Invert regular expression", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Remove App?", "other": "Remove Apps?" diff --git a/assets/translations/es.json b/assets/translations/es.json index c9da393..3af0908 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -300,6 +300,7 @@ "invertRegEx": "Invertir expresión regular", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "¿Eliminar Aplicación?", "other": "¿Eliminar Aplicaciones?" diff --git a/assets/translations/fa.json b/assets/translations/fa.json index 756e320..4635928 100644 --- a/assets/translations/fa.json +++ b/assets/translations/fa.json @@ -300,6 +300,7 @@ "invertRegEx": "معکوس کردن عبارت منظم", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "برنامه حذف شود؟", "other": "برنامه ها حذف شوند؟" diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 41649ea..0b6e94d 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -300,6 +300,7 @@ "invertRegEx": "Inverser l'expression régulière", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Supprimer l'application ?", "other": "Supprimer les applications ?" diff --git a/assets/translations/hu.json b/assets/translations/hu.json index 173dab8..0bc6eb6 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -300,6 +300,7 @@ "invertRegEx": "Invertált reguláris kifejezés", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "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 ddbe043..050707a 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -300,6 +300,7 @@ "invertRegEx": "Inverti espressione regolare", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Rimuovere l'app?", "other": "Rimuovere le app?" diff --git a/assets/translations/ja.json b/assets/translations/ja.json index ae470568..dae398f 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -300,6 +300,7 @@ "invertRegEx": "正規表現を反転", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" diff --git a/assets/translations/nl.json b/assets/translations/nl.json index 372760e..9d53109 100644 --- a/assets/translations/nl.json +++ b/assets/translations/nl.json @@ -300,6 +300,7 @@ "invertRegEx": "Reguliere expressie omkeren", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "App verwijderen?", "other": "Apps verwijderen?" diff --git a/assets/translations/pl.json b/assets/translations/pl.json index f92a37b..5620552 100644 --- a/assets/translations/pl.json +++ b/assets/translations/pl.json @@ -300,6 +300,7 @@ "invertRegEx": "Odwróć wyrażenie regularne", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Usunąć aplikację?", "few": "Usunąć aplikacje?", diff --git a/assets/translations/pt.json b/assets/translations/pt.json index 675d352..e9ff3c6 100644 --- a/assets/translations/pt.json +++ b/assets/translations/pt.json @@ -300,6 +300,7 @@ "invertRegEx": "Inverter expressão regular", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Remover aplicativo?", "other": "Remover aplicativos?" diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 062e5b4..019707b 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -300,6 +300,7 @@ "invertRegEx": "Инвертировать регулярное выражение", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Удалить приложение?", "other": "Удалить приложения?" diff --git a/assets/translations/sv.json b/assets/translations/sv.json index b61e3b2..18c806f 100644 --- a/assets/translations/sv.json +++ b/assets/translations/sv.json @@ -300,6 +300,7 @@ "invertRegEx": "Invertera reguljärt uttryck", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Ta Bort App?", "other": "Ta Bort Appar?" diff --git a/assets/translations/tr.json b/assets/translations/tr.json index e3bc3a3..e374d00 100644 --- a/assets/translations/tr.json +++ b/assets/translations/tr.json @@ -300,6 +300,7 @@ "invertRegEx": "Normal ifadeyi ters çevir", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Uygulamayı Kaldır?", "other": "Uygulamaları Kaldır?" diff --git a/assets/translations/vi.json b/assets/translations/vi.json index abe297f..2dcde6d 100644 --- a/assets/translations/vi.json +++ b/assets/translations/vi.json @@ -300,6 +300,7 @@ "invertRegEx": "Đảo ngược biểu thức chính quy", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "Gỡ ứng dụng?", "other": "Gỡ ứng dụng?" diff --git a/assets/translations/zh.json b/assets/translations/zh.json index d5be7db..b00e819 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -300,6 +300,7 @@ "invertRegEx": "反转正则表达式", "note": "Note", "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", + "badDownload": "The APK could not be parsed (incompatible or partial download)", "removeAppQuestion": { "one": "是否删除应用?", "other": "是否删除应用?" diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 95f6f09..f6c2881 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -532,9 +532,18 @@ class AppsProvider with ChangeNotifier { {bool needsBGWorkaround = false}) async { var newInfo = await pm.getPackageArchiveInfo(archiveFilePath: file.file.path); + if (newInfo == null) { + try { + file.file.deleteSync(recursive: true); + } catch (e) { + // + } finally { + throw ObtainiumError(tr('badDownload')); + } + } PackageInfo? appInfo = await getInstalledInfo(apps[file.appId]!.app.id); if (appInfo != null && - newInfo!.versionCode! < appInfo.versionCode! && + newInfo.versionCode! < appInfo.versionCode! && !(await canDowngradeApps())) { throw DowngradeError(); }