From 32c40ae7b391a70cf080975dad645160eff1d3bc Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 12 Feb 2023 14:16:19 -0500 Subject: [PATCH] No longer blocking App ID changes in updates --- assets/translations/de.json | 1 - assets/translations/en.json | 1 - assets/translations/hu.json | 1 - assets/translations/it.json | 1 - assets/translations/ja.json | 1 - assets/translations/zh.json | 1 - lib/custom_errors.dart | 4 ---- lib/main.dart | 2 +- lib/pages/app.dart | 2 ++ lib/providers/apps_provider.dart | 5 +---- pubspec.yaml | 2 +- 11 files changed, 5 insertions(+), 16 deletions(-) diff --git a/assets/translations/de.json b/assets/translations/de.json index 69ce123..3dafa2b 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -4,7 +4,6 @@ "noVersionFound": "Release-Version nicht ermittelbar", "urlMatchesNoSource": "URL stimmt mit keiner bekannten Quelle überein", "cantInstallOlderVersion": "Installation einer älteren App-Version nicht möglich", - "appIdMismatch": "Die heruntergeladene Paket-ID stimmt nicht mit der vorhandenen App-ID überein", "functionNotImplemented": "Diese Klasse hat diese Funktion nicht implementiert", "placeholder": "Platzhalter", "someErrors": "Es traten einige Fehler auf", diff --git a/assets/translations/en.json b/assets/translations/en.json index 95a41ef..15c8498 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -4,7 +4,6 @@ "noVersionFound": "Could not determine release version", "urlMatchesNoSource": "URL does not match a known source", "cantInstallOlderVersion": "Cannot install an older version of an App", - "appIdMismatch": "Downloaded package ID does not match existing App ID", "functionNotImplemented": "This class has not implemented this function", "placeholder": "Placeholder", "someErrors": "Some Errors Occurred", diff --git a/assets/translations/hu.json b/assets/translations/hu.json index a92460d..96dbaaa 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -4,7 +4,6 @@ "noVersionFound": "Nem sikerült meghatározni a kiadás verzióját", "urlMatchesNoSource": "Az URL nem egyezik ismert forrással", "cantInstallOlderVersion": "Nem telepíthető egy app régebbi verziója", - "appIdMismatch": "A letöltött csomagazonosító nem egyezik a meglévő app azonosítóval", "functionNotImplemented": "Ez az osztály nem valósította meg ezt a függvényt", "placeholder": "Helykitöltő", "someErrors": "Néhány hiba történt", diff --git a/assets/translations/it.json b/assets/translations/it.json index c172613..72fc524 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -4,7 +4,6 @@ "noVersionFound": "Impossibile determinare la versione della release", "urlMatchesNoSource": "L'URL non corrisponde ad alcuna fonte conosciuta", "cantInstallOlderVersion": "Impossibile installare una versione precedente di un'App", - "appIdMismatch": "L'ID del pacchetto scaricato non corrisponde all'ID dell'App esistente", "functionNotImplemented": "Questa classe non ha implementato questa funzione", "placeholder": "Segnaposto", "someErrors": "Si sono verificati degli errori", diff --git a/assets/translations/ja.json b/assets/translations/ja.json index 05abcf6..c63fe1c 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -4,7 +4,6 @@ "noVersionFound": "リリースバージョンを特定できませんでした", "urlMatchesNoSource": "URLが既知のソースと一致しません", "cantInstallOlderVersion": "旧バージョンのアプリをインストールできません", - "appIdMismatch": "ダウンロードしたパッケージのIDが既存のApp IDと一致しません", "functionNotImplemented": "このクラスはこの機能を実装していません", "placeholder": "プレースホルダー", "someErrors": "何らかのエラーが発生しました", diff --git a/assets/translations/zh.json b/assets/translations/zh.json index 89b6ea6..82ae514 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -4,7 +4,6 @@ "noVersionFound": "无法确定更新版本", "urlMatchesNoSource": "URL 与已知来源不符", "cantInstallOlderVersion": "无法安装旧版应用程序", - "appIdMismatch": "下载的软件包名与现有的应用程序包名不一致", "functionNotImplemented": "该类没有实现此功能", "placeholder": "占位符", "someErrors": "出现了一些错误", diff --git a/lib/custom_errors.dart b/lib/custom_errors.dart index a049170..beef068 100644 --- a/lib/custom_errors.dart +++ b/lib/custom_errors.dart @@ -44,10 +44,6 @@ class DowngradeError extends ObtainiumError { DowngradeError() : super(tr('cantInstallOlderVersion')); } -class IDChangedError extends ObtainiumError { - IDChangedError() : super(tr('appIdMismatch')); -} - class NotImplementedError extends ObtainiumError { NotImplementedError() : super(tr('functionNotImplemented')); } diff --git a/lib/main.dart b/lib/main.dart index bc8840b..0938de6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; // ignore: implementation_imports import 'package:easy_localization/src/localization.dart'; -const String currentVersion = '0.10.7'; +const String currentVersion = '0.10.8'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 91f510b..312dfdb 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -347,6 +347,8 @@ class _AppPageState extends State { if (res.isNotEmpty && mounted) { Navigator.of(context).pop(); } + }).catchError((e) { + showError(e, context); }); }).catchError((e) { showError(e, context); diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 2fc89a3..0673458 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -179,12 +179,9 @@ class AppsProvider with ChangeNotifier { } } // If the APK package ID is different from the App ID, it is either new (using a placeholder ID) or the ID has changed - // The former case should be handled (give the App its real ID), the latter is a security issue + // In either case, the app should be given the new ID var newInfo = await PackageArchiveInfo.fromPath(downloadedFile.path); if (app.id != newInfo.packageName) { - if (apps[app.id] != null && !SourceProvider().isTempId(app.id)) { - throw IDChangedError(); - } var originalAppId = app.id; app.id = newInfo.packageName; downloadedFile = downloadedFile.renameSync( diff --git a/pubspec.yaml b/pubspec.yaml index b439bb8..ae50a6a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: 0.10.7+113 # When changing this, update the tag in main() accordingly +version: 0.10.8+114 # When changing this, update the tag in main() accordingly environment: sdk: '>=2.18.2 <3.0.0'