diff --git a/lib/app_sources/rustore.dart b/lib/app_sources/rustore.dart index 365cfe7..6214dbe 100644 --- a/lib/app_sources/rustore.dart +++ b/lib/app_sources/rustore.dart @@ -33,6 +33,16 @@ class RuStore extends AppSource { return Uri.parse(standardUrl).pathSegments.last; } + Future decodeString(String str) async { + try { + return (await CharsetDetector.autoDecode( + Uint8List.fromList(str.codeUnits))) + .string; + } catch (e) { + return str; + } + } + @override Future getLatestAPKDetails( String standardUrl, @@ -73,17 +83,9 @@ class RuStore extends AppSource { throw NoAPKError(); } - appName = (await CharsetDetector.autoDecode( - Uint8List.fromList(appName.codeUnits))) - .string; - author = - (await CharsetDetector.autoDecode(Uint8List.fromList(author.codeUnits))) - .string; - changeLog = changeLog != null - ? (await CharsetDetector.autoDecode( - Uint8List.fromList(changeLog.codeUnits))) - .string - : null; + appName = await decodeString(appName); + author = await decodeString(author); + changeLog = changeLog != null ? await decodeString(changeLog) : null; return APKDetails( version, diff --git a/pubspec.yaml b/pubspec.yaml index 741f40f..4f262a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,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.53+2310 +version: 1.1.54+2311 environment: sdk: ^3.6.0