From c9882cf39c599ac3da39c20da851765d7b8803ef Mon Sep 17 00:00:00 2001 From: reis Date: Thu, 15 Dec 2022 15:29:46 +0000 Subject: [PATCH] fix: no recommended attribute --- public/index.js | 9 ++++++--- utils/PatchesParser.js | 6 +++--- utils/mountReVancedInstaller.js | 10 +--------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/public/index.js b/public/index.js index 41d3bdfd..aa7d1148 100644 --- a/public/index.js +++ b/public/index.js @@ -344,13 +344,13 @@ ws.onmessage = (msg) => { for (let i = 0; i < len; i++) { const version = message.versionList[i]; const noRec = version.recommended == 'NOREC'; - + const recommended = version.recommended ? 1 : 0; versionsElement.innerHTML += `
  • `; } - if (message.selectedApp === 'youtube.music' && !message.foundDevice) + if ( + message.selectedApp === 'com.google.android.apps.youtube.music' && + !message.foundDevice + ) document.getElementById('continue').onclick = () => { const version = document.querySelector( 'input[name="version"]:checked' diff --git a/utils/PatchesParser.js b/utils/PatchesParser.js index e0599105..55e7fa4a 100644 --- a/utils/PatchesParser.js +++ b/utils/PatchesParser.js @@ -40,11 +40,11 @@ module.exports = async function parsePatch(packageName, hasRoot) { global.versions.push(compatibleVersion); } } - + if (!isCompatible) { - if (patch.compatiblePackages.length !== 0) continue; + if (patch.compatiblePackages.length !== 0) continue; } - + if (isRooted && !hasRoot) continue; for (const dependencyName of patch.dependencies) { diff --git a/utils/mountReVancedInstaller.js b/utils/mountReVancedInstaller.js index fee10025..d9e1c323 100644 --- a/utils/mountReVancedInstaller.js +++ b/utils/mountReVancedInstaller.js @@ -26,15 +26,7 @@ async function runCommand(command, deviceId) { * @param {string} deviceId */ module.exports = async function mountReVancedInstaller(deviceId) { - let pkg; - - switch (global.jarNames.selectedApp) { - case 'youtube': - pkg = 'com.google.android.youtube'; - break; - case 'youtube.music': - pkg = 'com.google.android.apps.youtube.music'; - } + let pkg = global.jarNames.selectedApp.packageName; // Copy ReVanced APK to temp. await exec(