diff --git a/public/about/index.html b/public/about/index.html index 39940b14..640117d1 100644 --- a/public/about/index.html +++ b/public/about/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/colors.js b/public/colors.js new file mode 100644 index 00000000..03e75e79 --- /dev/null +++ b/public/colors.js @@ -0,0 +1,11 @@ +const accentColors = document.querySelectorAll('.theming span'); +accentColors.forEach((color) => { + color.addEventListener('click', () => { + accentColors.forEach((el) => el.classList.remove('active')); + color.classList.add('active'); + const colorNow1 = color.style.getPropertyValue('background-color'); + // todo: in future maybe allow user to set any color, `colorNow1 = prompt("Set Custom Color:", colorNow1)`; + document.documentElement.style.setProperty('--accentColor', colorNow1); + localStorage.setItem('theme', colorNow1); + }); +}); diff --git a/public/dependencies/index.html b/public/dependencies/index.html index bb6dd21e..7e6f9298 100644 --- a/public/dependencies/index.html +++ b/public/dependencies/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/failure/index.html b/public/failure/index.html index 3d21f110..fe734d6b 100644 --- a/public/failure/index.html +++ b/public/failure/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/index.html b/public/index.html index c6625c19..b37788b9 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/index.js b/public/index.js index f535896a..ba9d1a95 100644 --- a/public/index.js +++ b/public/index.js @@ -12,7 +12,7 @@ let hasFinished = false; let arch; let versionChoosen; -function sendCommand(args) { +function sendCommand (args) { ws.send(JSON.stringify(args)); } let colorNow; @@ -23,7 +23,7 @@ if (localStorage.getItem('theme')) { } document.documentElement.style.setProperty('--accentColor', colorNow); -function setApp() { +function setApp () { if (!document.querySelector('input[name="app"]:checked')) { return alert("You didn't select an app to patch!"); } @@ -34,31 +34,31 @@ function setApp() { location.href = '/dependencies'; } -function loadPatches() { +function loadPatches () { sendCommand({ event: 'getPatches' }); } -function updateFiles() { +function updateFiles () { sendCommand({ event: 'updateFiles' }); } -function toggle(bool) { +function toggle (bool) { for (const checkbox of document.getElementsByClassName('select')) { checkbox.checked = bool; } } -function goToPatches() { +function goToPatches () { if (hasFinished) { location.href = '/patches'; } } -function checkForUpdates() { +function checkForUpdates () { sendCommand({ event: 'checkForUpdates' }); } -function setPatches() { +function setPatches () { const patchElementList = [...document.querySelectorAll('.select')]; const selectedPatchElementList = patchElementList.filter( (x) => x.checked === true @@ -84,7 +84,7 @@ function setPatches() { location.href = '/versions'; } -function setAppVersion(arch, version) { +function setAppVersion (arch, version) { if (!isDownloading) { if (!arch) { if (!document.querySelector('input[name="version"]:checked')) { @@ -112,7 +112,7 @@ function setAppVersion(arch, version) { } } -function getAppVersions(isRooted) { +function getAppVersions (isRooted) { document.getElementsByTagName('header')[0].innerHTML = `

Select the version you want to download

Versions marked as beta might have bugs or be unstable, unless marked as recommended @@ -131,44 +131,33 @@ function getAppVersions(isRooted) { sendCommand({ event: 'getAppVersion' }); } -function buildReVanced() { +function buildReVanced () { sendCommand({ event: 'patchApp' }); } -function getAlreadyExists() { +function getAlreadyExists () { sendCommand({ event: 'checkFileAlreadyExists' }); } -function openAbout() { +function openAbout () { window.open('/about', '_blank'); } -function openGitHub() { +function openGitHub () { window.open('https://github.com/reisxd/revanced-builder', '_blank'); } -let accentColors = document.querySelectorAll('.theming span'); -accentColors.forEach((color) => { - color.addEventListener('click', () => { - accentColors.forEach((el) => el.classList.remove('active')); - color.classList.add('active'); - colorNow = color.style.getPropertyValue('background-color'); - // todo: in future maybe allow user to set any color, `colorNow = prompt("Set Custom Color:", colorNow)`; - document.documentElement.style.setProperty('--accentColor', colorNow); - localStorage.setItem('theme', colorNow); - }); -}); -function openColorPicker() { +function openColorPicker () { document.querySelector('.theming').classList.toggle('show'); } -function toTitleCase(phrase) { +function toTitleCase (phrase) { return phrase .split('-') .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) .join(' '); } -function exitApp() { +function exitApp () { sendCommand({ event: 'exit' }); const tempW = window.open(location, '_self'); tempW.close(); diff --git a/public/patch/index.html b/public/patch/index.html index cd200b2f..abc98cb1 100644 --- a/public/patch/index.html +++ b/public/patch/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/patches/index.html b/public/patches/index.html index 7f167844..2fde05a9 100644 --- a/public/patches/index.html +++ b/public/patches/index.html @@ -7,7 +7,8 @@ - + + diff --git a/public/styles/apps.css b/public/styles/apps.css index ce2bfbd8..e0a68e2f 100644 --- a/public/styles/apps.css +++ b/public/styles/apps.css @@ -44,7 +44,7 @@ input[type='radio'] + label { transition: 200ms; } -input[type="radio"] + label:hover { +input[type='radio'] + label:hover { box-shadow: inset 0px 0px 0px 1px #ddd; border-color: #ddd; } diff --git a/public/styles/core.css b/public/styles/core.css index da7ad3d9..27392380 100644 --- a/public/styles/core.css +++ b/public/styles/core.css @@ -72,7 +72,7 @@ div#container { height: 100%; } -div#container>main { +div#container > main { display: flex; flex-direction: column; min-width: 0; @@ -235,13 +235,13 @@ dialog { 0% { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0) + transform: translate3d(0, 100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); - transform: translateZ(0) + transform: translateZ(0); } } @@ -254,7 +254,7 @@ dialog { padding-bottom: 25px; position: fixed; background: black; - animation: fadeInUp .25s; + animation: fadeInUp 0.25s; bottom: 81px; left: 22px; border-bottom: 0px; @@ -270,6 +270,7 @@ dialog { #themecolor-picker { display: flex; + list-style: none; } #themecolor-picker span { diff --git a/public/styles/fontawesome.css b/public/styles/fontawesome.css index 4cc1d65b..4ee41542 100644 --- a/public/styles/fontawesome.css +++ b/public/styles/fontawesome.css @@ -24,7 +24,7 @@ } .fa-palette:before { - content: "\f53f" + content: '\f53f'; } .fa-brands { diff --git a/public/styles/patches.css b/public/styles/patches.css index e1725ded..7d1e5f57 100644 --- a/public/styles/patches.css +++ b/public/styles/patches.css @@ -27,7 +27,7 @@ input[type='checkbox'].select + label { transition: 200ms; } -input[type="checkbox"].select + label:hover { +input[type='checkbox'].select + label:hover { box-shadow: inset 0px 0px 0px 1px #ddd; border-color: #ddd; } diff --git a/public/versions/index.html b/public/versions/index.html index 00fd330b..35ac1944 100644 --- a/public/versions/index.html +++ b/public/versions/index.html @@ -8,7 +8,8 @@ - + + diff --git a/utils/mountReVanced.js b/utils/mountReVanced.js index 0a0584b0..b133213a 100644 --- a/utils/mountReVanced.js +++ b/utils/mountReVanced.js @@ -17,7 +17,9 @@ module.exports = async function (pkg, ws) { // Force stop the app await actualExec(`su -c 'am force-stop ${pkg}'`); // Unmount - await actualExec(`su -mm -c 'stock_path="$( pm path ${pkg} | grep base | sed 's/package://g' )" && umount -l "$stock_path"'`); + await actualExec( + `su -mm -c 'stock_path="$( pm path ${pkg} | grep base | sed 's/package://g' )" && umount -l "$stock_path"'` + ); } catch (error) {} // An error occured, probably because there is no existing ReVanced APK to be unmounted, ignore it and continue // Move APK to folder @@ -50,7 +52,9 @@ module.exports = async function (pkg, ws) { // ); // Run Mount script - await actualExec(`su -mm -c '"/data/adb/service.d/mount_revanced_${pkg}.sh"'`); + await actualExec( + `su -mm -c '"/data/adb/service.d/mount_revanced_${pkg}.sh"'` + ); // Kill mounted process // await actualExec(`su -c 'monkey -p ${pkg} 1 && kill $(pidof -s ${pkg})'`); diff --git a/wsEvents/GetAppVersion.js b/wsEvents/GetAppVersion.js index d805abd4..9946b8b2 100644 --- a/wsEvents/GetAppVersion.js +++ b/wsEvents/GetAppVersion.js @@ -143,14 +143,11 @@ module.exports = async function (message, ws) { const sanitizeVersion = (ver) => { return ver .replace(/\.0(?\d)/gi, '.$1') // because apparently x.0y.z (ex. 5.09.51) isn't a valid version - .replace(/^(?\d+)\.(?\d+)$/gi, "$1.$2.0") // nor are versions without a patch (ex. 2.3) - } + .replace(/^(?\d+)\.(?\d+)$/gi, '$1.$2.0'); // nor are versions without a patch (ex. 2.3) + }; versionList.sort( (a, b) => - lt( - sanitizeVersion(a.version), - sanitizeVersion(b.version) - ) + lt(sanitizeVersion(a.version), sanitizeVersion(b.version)) ? 1 : -1 /* yes i need to add this to the end, the sort function is stupid */ );