mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-01 05:53:27 +01:00 
			
		
		
		
	Merge pull request #2021 from ImranR98/dev
Catch errors when running JSON compat mods - app breaking bug (#2015, #2019)
This commit is contained in:
		| @@ -30,6 +30,7 @@ import 'package:obtainium/app_sources/uptodown.dart'; | |||||||
| import 'package:obtainium/components/generated_form.dart'; | import 'package:obtainium/components/generated_form.dart'; | ||||||
| import 'package:obtainium/custom_errors.dart'; | import 'package:obtainium/custom_errors.dart'; | ||||||
| import 'package:obtainium/mass_app_sources/githubstars.dart'; | import 'package:obtainium/mass_app_sources/githubstars.dart'; | ||||||
|  | import 'package:obtainium/providers/logs_provider.dart'; | ||||||
| import 'package:obtainium/providers/settings_provider.dart'; | import 'package:obtainium/providers/settings_provider.dart'; | ||||||
|  |  | ||||||
| class AppNames { | class AppNames { | ||||||
| @@ -367,7 +368,14 @@ class App { | |||||||
|       otherAssetUrls: otherAssetUrls); |       otherAssetUrls: otherAssetUrls); | ||||||
|  |  | ||||||
|   factory App.fromJson(Map<String, dynamic> json) { |   factory App.fromJson(Map<String, dynamic> json) { | ||||||
|     json = appJSONCompatibilityModifiers(json); |     Map<String, dynamic> originalJSON = new Map.from(json); | ||||||
|  |     try { | ||||||
|  |       json = appJSONCompatibilityModifiers(json); | ||||||
|  |     } catch (e) { | ||||||
|  |       json = originalJSON; | ||||||
|  |       LogsProvider().add( | ||||||
|  |           'Error running JSON compat modifiers: ${e.toString()}: ${originalJSON.toString()}'); | ||||||
|  |     } | ||||||
|     return App( |     return App( | ||||||
|       json['id'] as String, |       json['id'] as String, | ||||||
|       json['url'] as String, |       json['url'] as String, | ||||||
|   | |||||||
| @@ -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 | # 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 | # 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. | # 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: | environment: | ||||||
|   sdk: '>=3.0.0 <4.0.0' |   sdk: '>=3.0.0 <4.0.0' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user