diff --git a/.gitignore b/.gitignore index 4c8ac57..12e500c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release +/android/app/.cxx # Custom TODO.txt \ No newline at end of file diff --git a/lib/app_sources/rustore.dart b/lib/app_sources/rustore.dart index 853cfed..365cfe7 100644 --- a/lib/app_sources/rustore.dart +++ b/lib/app_sources/rustore.dart @@ -1,6 +1,8 @@ import 'dart:convert'; +import 'dart:typed_data'; import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter_charset_detector/flutter_charset_detector.dart'; import 'package:http/http.dart'; import 'package:obtainium/custom_errors.dart'; import 'package:obtainium/providers/source_provider.dart'; @@ -52,6 +54,7 @@ class RuStore extends AppSource { String author = appDetails['companyName'] ?? name; String? dateStr = appDetails['updatedAt']; String? version = appDetails['versionName']; + String? changeLog = appDetails['whatsNew']; if (version == null) { throw NoVersionError(); } @@ -70,6 +73,18 @@ 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; + return APKDetails( version, getApkUrlsFromUrls([ @@ -77,6 +92,7 @@ class RuStore extends AppSource { .replaceAll(RegExp('\\.zip\$'), '.apk') ]), AppNames(author, appName), - releaseDate: relDate); + releaseDate: relDate, + changeLog: changeLog); } } diff --git a/pubspec.lock b/pubspec.lock index ab13e03..77586f3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,6 +345,46 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.3" + flutter_charset_detector: + dependency: "direct main" + description: + name: flutter_charset_detector + sha256: d7c11a82c2c51cb35a010b42c64001afb8a9e4d7be1f57620604d386d3467ad1 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + flutter_charset_detector_android: + dependency: transitive + description: + name: flutter_charset_detector_android + sha256: "443145e8fc8515b3b32aee375691e40dd59197a86a2ae153166bc88c8200d83b" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + flutter_charset_detector_darwin: + dependency: transitive + description: + name: flutter_charset_detector_darwin + sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter_charset_detector_platform_interface: + dependency: transitive + description: + name: flutter_charset_detector_platform_interface + sha256: "1c09ed7b314a5a9dde76057b98b7d35458ba881eed03d5e5b6f7f74b4869d18c" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter_charset_detector_web: + dependency: transitive + description: + name: flutter_charset_detector_web + sha256: b547194e97e15d2cca17e957ad7f373b48abf35080e645ac5b6976d129b0265d + url: "https://pub.dev" + source: hosted + version: "1.2.0" flutter_fgbg: dependency: "direct main" description: @@ -552,6 +592,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.19.0" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" json_annotation: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c7085dc..9a881c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,6 +86,7 @@ dependencies: markdown: any flutter_typeahead: ^5.2.0 battery_plus: ^6.1.0 + flutter_charset_detector: ^4.0.0 dev_dependencies: flutter_test: sdk: flutter