-
Notifications
You must be signed in to change notification settings - Fork 26
/
sync_with_xiaomi_eu.dart
61 lines (60 loc) · 2.5 KB
/
sync_with_xiaomi_eu.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'dart:io';
import 'tools/is_supported.dart';
import 'tools/add_to_support.dart';
void main() {
int numberOfCovered = 0;
int numberOfNotCovered = 0;
List<String> listOfNotCovered = [];
List<String> listOfCovered = [];
List<Map> listOfVersions = [
{"15" : "https://sourceforge.net/projects/xiaomi-eu-multilang-miui-roms/files/xiaomi.eu/HyperOS-STABLE-RELEASES/HyperOS1.0/"},
{"14" : "https://sourceforge.net/projects/xiaomi-eu-multilang-miui-roms/files/xiaomi.eu/MIUI-STABLE-RELEASES/MIUIv14/"},
{"13" : "https://sourceforge.net/projects/xiaomi-eu-multilang-miui-roms/files/xiaomi.eu/MIUI-STABLE-RELEASES/MIUIv13/"},
{"12" : "https://sourceforge.net/projects/xiaomi-eu-multilang-miui-roms/files/xiaomi.eu/MIUI-STABLE-RELEASES/MIUIv12/"},
{"11" : "https://sourceforge.net/projects/xiaomi-eu-multilang-miui-roms/files/xiaomi.eu/MIUI-STABLE-RELEASES/MIUIv11/"},
{"10" : "https://xiaomi.eu/community/"}
];
for (Map version in listOfVersions) {
File resourceFile;
if (version.keys.toList()[0] == "15") {
resourceFile = File("filesFromXiaomiEU/xiaomi.eu.h1.txt");
}
else {
resourceFile = File("filesFromXiaomiEU/xiaomi.eu${version.keys.toList()[0]}.txt");
}
String resourceFileContent = resourceFile.readAsStringSync();
for (String row in resourceFileContent.split("\n")) {
if (row != "") {
String codename = row.split(" ")[0].replaceAll("(in)", "").split("_").first;
print(codename);
if (!listOfCovered.contains(codename)) {
if (isSupported(extendedCodename: "xiaomi-$codename")) {
numberOfCovered += 1;
listOfCovered += [codename];
addToSupport(
androidVersion: "",
extendedCodename: "xiaomi-$codename",
romName: "xiaomi.eu",
romState: "Official",
romSupport: true,
romNotes: version.keys.toList()[0] == "15" ? "HyperOS 1.0" : "MIUI ${version.keys.toList()[0]}",
romWebpage: "https://xiaomi.eu/community/",
deviceWebpage: version.values.toList()[0]
);
print("Supported");
}
else {
numberOfNotCovered += 1;
listOfNotCovered += ["xiaomi-$codename"];
print("Not supported");
}
}
}
}
}
stdout.write("Covered: $numberOfCovered\n");
stdout.write("Not covered: $numberOfNotCovered\n");
for (var deviceNotCovered in listOfNotCovered) {
stdout.write("$deviceNotCovered\n");
}
}