-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfunctions.php
More file actions
71 lines (64 loc) · 1.57 KB
/
functions.php
File metadata and controls
71 lines (64 loc) · 1.57 KB
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
62
63
64
65
66
67
68
69
70
71
<?php
function GetDomain() {
return "https://crdroid.net";
}
function convertToMB($val) {
$units = "MB";
$val = $val / 1024 / 1024;
$val = round($val, 1);
if (strlen($val) > 5) {
$val = $val / 1024;
$val = round($val,1);
$units = "GB";
}
return $val . " " . $units;
}
function beautifyDate($val) {
$split = str_split($val, 2);
return $split[0] . $split[1] . "-" . $split[2] . "-" . $split[3];
}
function GetDeviceInfo($codename, $version){
$details = array();
$json_array = json_decode(file_get_contents('devices_handler/compiled.json'), true);
foreach($json_array as $key => $arrays){
// OEM here
foreach($arrays as $devicecodename => $data){
//codename here
if ($devicecodename == $codename){
foreach ($data as $crversion => $info){
//all versions listed here in array
if ($crversion == $version){
//exact version looking for
$details[] = $key;
$details[] = $info;
goto outofhere;
}
}
}
}
}
outofhere:
return $details;
}
function crVersionToAndroid($checkVersion){
$versions = array(
6 => 10,
7 => 11,
8 => 12,
9 => 13,
10 => 14,
11 => 15,
12 => 16
);
return $versions[$checkVersion];
}
function changelogFile($checkVersion, $device){
$changelog = '';
if (strlen($checkVersion) > 1) {
$changelog = "../changelog/v" . $checkVersion . ".x/" . $device . "_changelog.txt";
} else {
$changelog = "../changelog/v" . $checkVersion . ".x/changelog_" . $device . ".txt";
}
return $changelog;
}
?>