-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdl.php
More file actions
390 lines (325 loc) · 14.5 KB
/
dl.php
File metadata and controls
390 lines (325 loc) · 14.5 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<?php
include 'functions.php';
$domain = GetDomain();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>crDroid.net - Download crDroid for supported devices</title>
<meta name="description" content="official crDroid ROM website">
<meta name="keywords" content="crDroid, crDroid ROM, ROM">
<!-- Favicons -->
<link href="img/favicon.ico" rel="icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="vendor/aos/aos.css" rel="stylesheet">
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Bootstrap dark mode -->
<link id="dark-theme-style" rel="stylesheet" />
<!-- Main CSS File -->
<link href="css/style.css" rel="stylesheet">
<!-- Google verification -->
<meta name="google-site-verification" content="v_DBWc21zWokjHdPNpABWYSkB3lSz6u7mPGXsmOPGt8" />
<!-- Matomo Tag Manager -->
<script>
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
(function() {
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://analytics.crdroid.net/js/container_RN6gKcgX.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Tag Manager -->
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="fixed-top header-transparent ">
<div class="container d-flex align-items-center justify-content-between">
<div class="logo">
<!--<h1><a href="<?php echo $domain; ?>">crDroid</a></h1>-->
<a href="<?php echo $domain; ?>"><img src="img/logo.png" alt="" class="img-fluid"></a>
</div>
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link" href="<?php echo $domain; ?>">Home</a></li>
<li><a class="nav-link" href="<?php echo $domain; ?>/blog">Blog</a></li>
<li><a class="nav-link" href="<?php echo $domain; ?>/translations">Translations</a></li>
<li><a class="nav-link" href="https://stats.crdroid.net">Stats</a></li>
<li><a class="nav-link" href="<?php echo $domain; ?>/donate">Support us</a></li>
<li><a class="nav-link" href="<?php echo $domain; ?>/legal">Legal</a></li>
<li><a class="nav-link scrollto" href="#footer">Contact</a></li>
<!--<li><a class="getstarted" href="dl.php">Download</a></li>-->
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
<a class="switcher" role="button" id="theme-toggler" onclick="toggleTheme()"></a>
</div>
</header><!-- End Header -->
<main id="main">
<section class="inner-page">
<div class="container">
<div class="section-title">
<p><br><br></p>
<h2>Ready to download?</h2>
<p>Below you can find a list with official supported devices.</p>
<p>Choose your device and get started using crDroid</p>
</div>
<!-- List devices -->
<div class="row">
<div class="input-group mb-3">
<div class="input-group-prepend shadow">
<span class="input-group-text" id="inputGroup-sizing-default">Search device</span>
</div>
<input type="text" class="form-control shadow" aria-label="Search device" id="search" aria-describedby="inputGroup-sizing-default">
</div>
<?php
$json_array = json_decode(file_get_contents('devices_handler/compiled.json'), true);
//fast go to OEM
echo "<div class='OEMS'>";
foreach($json_array as $key => $arrays){
echo "<a href='#" . $key . "' class='btn btn-secondary scrollto m-1'>" . $key . "</a>";
}
echo "</div>";
echo '<div class="container">
<div class="row justify-content-center">
<div class="col-md-4">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="listOutdated" onchange="filterVersions()">
<label class="form-check-label" for="listOutdated">Show all versions not just latest supported</label>
</div>
</div>
</div>
</div>';
foreach($json_array as $key => $arrays){
echo "<div id='" . $key . "' class='oem google-anno-skip'><h1><i class='bx bx-chevrons-left' ></i>" . $key . "<i class='bx bx-chevrons-right' ></i></h1></div>";
foreach($arrays as $devicecodename => $devicename){
echo "
<div class='col-lg-3 mb-4 device google-anno-skip'>
<div class='card border-secondary shadow' id='" . $devicecodename . "'>
<h5 class='card-header text-center'>" . $devicecodename . "</h5>
";
//echo $devicecodename . "<br>";
$img = null;
$smallImgPath = "img/devices/" . $devicecodename . "-small.webp";
$largeImgPath = "img/devices/" . $devicecodename . ".webp";
if (file_exists($smallImgPath)) {
$img = "<div class='deviceimage'><img src='" . $smallImgPath . "' data-src='" . $largeImgPath . "' class='lazy-image' /></div>";
} else {
$img = "<span style='display:block; font-size: 150px; text-align: center;'><i class='bx bxs-image'></i></span>";
}
$onlyfirst = 0;
$lastupdate = 0;
$versions = array();
foreach($devicename as $crVersion => $data){
++$onlyfirst;
if($onlyfirst == 1){
echo $img;
echo "
<div class='card-body'>
<h5 class='card-text devicename'>" . $data['device'] . "</h5>
</div>
<div class='center'>
<div class='dropdown'>
<a class='btn btn-danger dropdown-toggle m-2 shadow-sm' role='button' id='dropdownMenuLink' data-bs-toggle='dropdown' aria-expanded='false'>Download</a>
<ul class='dropdown-menu shadow' aria-labelledby='dropdownMenuLink'>
";
}
if ($lastupdate < $data['builddate']){
$lastupdate = $data['builddate'];
}
array_push($versions, $crVersion);
}
//list all crDroid versions
foreach ($versions as &$version) {
echo "<li><a class='dropdown-item' href='" . $devicecodename . "/" . $version . "'>crDroid ". $version ." | Android " . crVersionToAndroid($version) . "</a></li>";
}
unset($version);
echo "
</ul>
</div>
</div>
<div class='card-footer text-muted'>Last build: " . beautifyDate($lastupdate) . "</div>
</div>
</div>
";
}
}
?>
</div>
</div>
</section>
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<footer class='footerbg' id="footer">
<div class="footer-top">
<div class="container">
<div class="row">
<div class="col-lg col-md-6 footer-contact">
<h3>crDroid Android Project</h3>
<p>
<strong>Email:</strong> [email protected]<br>
</p>
<div class="social-links mt-3">
<a href="https://t.me/crDroidAndroid"><i class='bx bxl-telegram'></i></a>
<a href="https://github.com/crdroidandroid"><i class='bx bxl-github' ></i></a>
<a href="https://patreon.com/crdroidandroid"><i class='bx bxl-patreon'></i></a>
<a href="https://paypal.me/crdroidandroid"><i class='bx bxl-paypal' ></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="container py-4">
<div class="copyright">
© Copyright 2016-<?php echo date("Y");?> <strong><span>crDroid Android</span></strong>.
</div>
<div class="credits">
Designed by <a href="https://gwolf2u.com">Lup Gabriel</a>, buildservers powered by <a href="https://www.interserver.net/r/836686">InterServer</a> and website hosted @ <a href="https://scopehosts.com">ScopeHosts</a>
</div>
</div>
</footer><!-- End Footer -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="vendor/aos/aos.js"></script>
<script src="vendor/jquery/jquery-3.6.0.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="vendor/glightbox/js/glightbox.min.js"></script>
<script src="vendor/swiper/swiper-bundle.min.js"></script>
<script src="vendor/bootstrap-dark/js/darkmode.js"></script>
<!-- Search and filter js -->
<script>
document.addEventListener("DOMContentLoaded", function() {
function filterVersions() {
const listOutdated = document.getElementById("listOutdated");
const devices = document.querySelectorAll(".device");
const oems = document.querySelectorAll(".oem");
const includeVersions = ["crDroid 11", "crDroid 12"];
const hash = window.location.hash;
devices.forEach(device => {
const versions = device.querySelectorAll(".dropdown-item");
let isVisible = false;
if (hash) {
isVisible = true;
} else {
versions.forEach(version => {
const versionText = version.textContent || version.innerText;
const shouldShow = listOutdated.checked || includeVersions.some(v => versionText.includes(v));
version.parentNode.style.display = shouldShow ? "block" : "none";
if (shouldShow) isVisible = true;
});
}
device.style.display = isVisible ? "block" : "none";
});
oems.forEach(oem => {
let nextElement = oem.nextElementSibling;
let hasVisibleDevice = false;
while (nextElement && !nextElement.classList.contains("oem")) {
if (nextElement.classList.contains("device") && nextElement.style.display !== "none") {
hasVisibleDevice = true;
break;
}
nextElement = nextElement.nextElementSibling;
}
oem.style.display = hasVisibleDevice ? "block" : "none";
});
updateOEMLinks();
}
function updateOEMLinks() {
$(".OEMS a").each(function() {
const targetID = $(this).attr("href").substring(1);
const targetOEM = $("#" + targetID);
const isVisible = targetOEM.length > 0 && targetOEM.is(":visible");
$(this).toggle(isVisible);
});
}
$("#search").on("keyup submit", function() {
var key = this.value.toLowerCase();
if (key === '') {
filterVersions();
} else {
$(".oem").show();
$(".device").show();
$(".dropdown-item").closest('li').show();
$(".device").each(function() {
var $this = $(this);
var matches = $this.text().toLowerCase().indexOf(key) >= 0;
$this.toggle(matches);
});
$(".oem").each(function() {
var $this = $(this);
var hasVisibleDevice = $this.nextUntil(".oem").filter(".device:visible").length > 0;
$this.toggle(hasVisibleDevice);
});
updateOEMLinks();
}
});
const listOutdated = document.getElementById("listOutdated");
listOutdated.checked = !!window.location.href.match(/#(.+)/);
filterVersions();
listOutdated.addEventListener("change", filterVersions);
window.filterVersions = filterVersions;
});
</script>
<!-- to device -->
<script>
$(document).ready(function() {
var x = window.location.hash;
if (x.includes('#')) {
var codename = x.replace('#', '');
glowup(codename);
};
// Check if there's a hash in the URL when the page loads
var hash = window.location.hash;
if (hash) {
var dynamicId = hash.substring(1);
var element = document.getElementById(dynamicId);
if (element) {
$('html, body').animate({
scrollTop: $(element).offset().top - ($(window).height() - $(element).outerHeight(true)) / 2
}, 1000);
}
}
});
function glowup(device) {
var d = document.getElementById(device);
if (d) {
d.className += " mydevice";
}
};
</script>
<!-- lazy load images -->
<script>
document.addEventListener("DOMContentLoaded", function() {
const lazyImages = document.querySelectorAll('.lazy-image');
const lazyLoad = target => {
const io = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const img = entry.target;
const src = img.getAttribute('data-src');
img.setAttribute('src', src);
img.classList.add('loading');
img.onload = function() {
img.classList.remove('loading');
img.classList.add('loaded');
};
observer.disconnect();
}
});
});
io.observe(target);
};
lazyImages.forEach(lazyLoad);
});
</script>
<!-- Main JS File -->
<script src="js/main.js" async></script>
</body>
</html>