Skip to content

Commit

Permalink
Merge pull request #2113 from ImranR98/dev
Browse files Browse the repository at this point in the history
Fix RuStore characterset issue + support RuStore app  changelogs
  • Loading branch information
ImranR98 authored Feb 13, 2025
2 parents fff3b22 + 3ab14e2 commit eb21ba3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
/android/app/.cxx

# Custom
TODO.txt
18 changes: 17 additions & 1 deletion lib/app_sources/rustore.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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();
}
Expand All @@ -70,13 +73,26 @@ 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([
(downloadDetails['apkUrl'] as String)
.replaceAll(RegExp('\\.zip\$'), '.apk')
]),
AppNames(author, appName),
releaseDate: relDate);
releaseDate: relDate,
changeLog: changeLog);
}
}
48 changes: 48 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb21ba3

Please sign in to comment.