From 26b5a2d9768ba2073f4454523366828bd1211a36 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Mon, 9 Dec 2024 17:04:49 -0500 Subject: [PATCH 1/3] Catch errors when running JSON compat mods (#2015, #2019) --- lib/providers/source_provider.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 6025dde4..721e8a04 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -30,6 +30,7 @@ import 'package:obtainium/app_sources/uptodown.dart'; import 'package:obtainium/components/generated_form.dart'; import 'package:obtainium/custom_errors.dart'; import 'package:obtainium/mass_app_sources/githubstars.dart'; +import 'package:obtainium/providers/logs_provider.dart'; import 'package:obtainium/providers/settings_provider.dart'; class AppNames { @@ -367,7 +368,12 @@ class App { otherAssetUrls: otherAssetUrls); factory App.fromJson(Map json) { - json = appJSONCompatibilityModifiers(json); + try { + json = appJSONCompatibilityModifiers(json); + } catch (e) { + LogsProvider() + .add('Error running JSON compat modifiers: ${e.toString()}'); + } return App( json['id'] as String, json['url'] as String, From bd2ac73b9f49f2194ee8f156c60bcc3344e1deff Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Mon, 9 Dec 2024 17:18:25 -0500 Subject: [PATCH 2/3] Catch errors when running JSON compat mods (#2015, #2019) --- lib/providers/source_provider.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 721e8a04..2b2ce683 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -368,11 +368,13 @@ class App { otherAssetUrls: otherAssetUrls); factory App.fromJson(Map json) { + Map originalJSON = new Map.from(json); try { json = appJSONCompatibilityModifiers(json); } catch (e) { - LogsProvider() - .add('Error running JSON compat modifiers: ${e.toString()}'); + json = originalJSON; + LogsProvider().add( + 'Error running JSON compat modifiers: ${e.toString()}: ${originalJSON.toString()}'); } return App( json['id'] as String, From 0df1c1c5126c06288fda2021b515e143dfda84d9 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Mon, 9 Dec 2024 17:21:00 -0500 Subject: [PATCH 3/3] Increment version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index bccc26db..ba18f7b5 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: 1.1.33+2290 +version: 1.1.34+2291 environment: sdk: '>=3.0.0 <4.0.0'