diff --git a/index.js b/index.js index 422fa1d5..c0022411 100644 --- a/index.js +++ b/index.js @@ -38,14 +38,14 @@ process.on('unhandledRejection', async (reason) => { await exitProcess(); }); -async function exitProcess() { +async function exitProcess () { console.log('Press any key to exit...'); process.stdin.setRawMode(true); process.stdin.resume(); await new Promise(() => process.stdin.on('data', () => process.exit())); } -async function overWriteJarNames(link) { +async function overWriteJarNames (link) { const fileName = link.split('/').pop(); // i have to use ifs for this sorry if (fileName.includes('revanced-cli')) jarNames.cli += fileName; @@ -56,7 +56,7 @@ async function overWriteJarNames(link) { if (fileName.startsWith('microg')) jarNames.microG += fileName; } -async function getDownloadLink(json) { +async function getDownloadLink (json) { const apiRequest = await fetchURL( `https://api.github.com/repos/${json.owner}/${json.repo}/releases/latest` ); @@ -88,7 +88,7 @@ async function getDownloadLink(json) { return assets; } -async function getPage(pageUrl) { +async function getPage (pageUrl) { const pageRequest = await fetchURL(pageUrl, { headers: { 'user-agent': @@ -98,7 +98,7 @@ async function getPage(pageUrl) { return await pageRequest.text(); } -async function dloadFromURL(url, outputPath) { +async function dloadFromURL (url, outputPath) { const request = await fetchURL(url, { headers: { 'user-agent': @@ -144,7 +144,7 @@ async function dloadFromURL(url, outputPath) { }); } -async function downloadYTApk(ytVersion) { +async function downloadYTApk (ytVersion) { const versionsList = await getPage( 'https://www.apkmirror.com/apk/google-inc/youtube' ); @@ -207,7 +207,7 @@ async function downloadYTApk(ytVersion) { return console.log('Download complete!'); } -async function downloadFile(assets) { +async function downloadFile (assets) { for (const asset of assets) { const dir = fs.readdirSync('./revanced/'); overWriteJarNames(asset.browser_download_url); @@ -228,14 +228,14 @@ async function downloadFile(assets) { } } -async function downloadFiles(repos) { +async function downloadFiles (repos) { for (const repo of repos) { const downloadLink = await getDownloadLink(repo); await downloadFile(downloadLink); } } -async function getADBDeviceID() { +async function getADBDeviceID () { let deviceId; const { stdout } = await actualExec('adb devices'); const match = stdout.match(/\r\n(.*?)\t/); @@ -250,7 +250,7 @@ async function getADBDeviceID() { return deviceId; } -async function checkForJavaADB() { +async function checkForJavaADB () { try { const javaCheck = await actualExec('java -version'); const javaVer = Array.from(javaCheck.stderr.matchAll(/version\s([^:]+)/g)) @@ -288,7 +288,7 @@ async function checkForJavaADB() { } } -async function getYTVersion() { +async function getYTVersion () { const { stdout, stderr } = await actualExec( 'adb shell dumpsys package com.google.android.youtube' ); @@ -529,6 +529,9 @@ async function getYTVersion() { return await exitProcess(); } if (foundDevice) { + console.log( + 'WARNING: Rooted builds might or might not work.\nKeep in mind that I (reisxd) cannot test it.' + ); ytVersion = await getYTVersion(); patches += ' --mount'; isRooted = true;