Skip to content

Commit 3ab14e2

Browse files
committed
Fix RuStore characterset issue + support RuStore app changelogs
1 parent fff3b22 commit 3ab14e2

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ app.*.map.json
4545
/android/app/debug
4646
/android/app/profile
4747
/android/app/release
48+
/android/app/.cxx
4849

4950
# Custom
5051
TODO.txt

lib/app_sources/rustore.dart

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'dart:convert';
2+
import 'dart:typed_data';
23

34
import 'package:easy_localization/easy_localization.dart';
5+
import 'package:flutter_charset_detector/flutter_charset_detector.dart';
46
import 'package:http/http.dart';
57
import 'package:obtainium/custom_errors.dart';
68
import 'package:obtainium/providers/source_provider.dart';
@@ -52,6 +54,7 @@ class RuStore extends AppSource {
5254
String author = appDetails['companyName'] ?? name;
5355
String? dateStr = appDetails['updatedAt'];
5456
String? version = appDetails['versionName'];
57+
String? changeLog = appDetails['whatsNew'];
5558
if (version == null) {
5659
throw NoVersionError();
5760
}
@@ -70,13 +73,26 @@ class RuStore extends AppSource {
7073
throw NoAPKError();
7174
}
7275

76+
appName = (await CharsetDetector.autoDecode(
77+
Uint8List.fromList(appName.codeUnits)))
78+
.string;
79+
author =
80+
(await CharsetDetector.autoDecode(Uint8List.fromList(author.codeUnits)))
81+
.string;
82+
changeLog = changeLog != null
83+
? (await CharsetDetector.autoDecode(
84+
Uint8List.fromList(changeLog.codeUnits)))
85+
.string
86+
: null;
87+
7388
return APKDetails(
7489
version,
7590
getApkUrlsFromUrls([
7691
(downloadDetails['apkUrl'] as String)
7792
.replaceAll(RegExp('\\.zip\$'), '.apk')
7893
]),
7994
AppNames(author, appName),
80-
releaseDate: relDate);
95+
releaseDate: relDate,
96+
changeLog: changeLog);
8197
}
8298
}

pubspec.lock

+48
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,46 @@ packages:
345345
url: "https://pub.dev"
346346
source: hosted
347347
version: "6.0.3"
348+
flutter_charset_detector:
349+
dependency: "direct main"
350+
description:
351+
name: flutter_charset_detector
352+
sha256: d7c11a82c2c51cb35a010b42c64001afb8a9e4d7be1f57620604d386d3467ad1
353+
url: "https://pub.dev"
354+
source: hosted
355+
version: "4.0.0"
356+
flutter_charset_detector_android:
357+
dependency: transitive
358+
description:
359+
name: flutter_charset_detector_android
360+
sha256: "443145e8fc8515b3b32aee375691e40dd59197a86a2ae153166bc88c8200d83b"
361+
url: "https://pub.dev"
362+
source: hosted
363+
version: "3.0.0"
364+
flutter_charset_detector_darwin:
365+
dependency: transitive
366+
description:
367+
name: flutter_charset_detector_darwin
368+
sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763
369+
url: "https://pub.dev"
370+
source: hosted
371+
version: "1.1.0"
372+
flutter_charset_detector_platform_interface:
373+
dependency: transitive
374+
description:
375+
name: flutter_charset_detector_platform_interface
376+
sha256: "1c09ed7b314a5a9dde76057b98b7d35458ba881eed03d5e5b6f7f74b4869d18c"
377+
url: "https://pub.dev"
378+
source: hosted
379+
version: "1.1.0"
380+
flutter_charset_detector_web:
381+
dependency: transitive
382+
description:
383+
name: flutter_charset_detector_web
384+
sha256: b547194e97e15d2cca17e957ad7f373b48abf35080e645ac5b6976d129b0265d
385+
url: "https://pub.dev"
386+
source: hosted
387+
version: "1.2.0"
348388
flutter_fgbg:
349389
dependency: "direct main"
350390
description:
@@ -552,6 +592,14 @@ packages:
552592
url: "https://pub.dev"
553593
source: hosted
554594
version: "0.19.0"
595+
js:
596+
dependency: transitive
597+
description:
598+
name: js
599+
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
600+
url: "https://pub.dev"
601+
source: hosted
602+
version: "0.7.2"
555603
json_annotation:
556604
dependency: transitive
557605
description:

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ dependencies:
8686
markdown: any
8787
flutter_typeahead: ^5.2.0
8888
battery_plus: ^6.1.0
89+
flutter_charset_detector: ^4.0.0
8990
dev_dependencies:
9091
flutter_test:
9192
sdk: flutter

0 commit comments

Comments
 (0)