Skip to content

Commit

Permalink
Fix rooted builds again
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Jul 3, 2022
1 parent 6bdcb49 commit f0183fc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install pkg
run: sudo npm install -g pkg
- name: Build
run: pkg -t linux-x64,macos-x64,win-x64 --out-path dist --public index.js
run: pkg -t linux-x64,macos-x64,win-x64 --out-path dist --public .
- name: Upload to Releases
uses: softprops/action-gh-release@v1
with:
Expand Down
38 changes: 23 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,31 @@ async function downloadYTApk (ytVersion) {
const $ = load(versionsList);

if (!ytVersion) {
for (const version of $('h5[class="appRowTitle wrapText marginZero block-on-mobile"]').get()) {
for (const version of $(
'h5[class="appRowTitle wrapText marginZero block-on-mobile"]'
).get()) {
if (indx === 10) continue;
let versionName = version.attribs.title.replace('YouTube ', '');
indx++
const versionName = version.attribs.title.replace('YouTube ', '');
indx++;
if (versionName.includes('beta')) continue;
versionList.push({
name: versionName
});
}

versionChoosen = await inquirer.prompt([
{
type: 'list',
name: 'version',
message: 'Select a YT version to download.',
choices: versionList,
}
]);

versionChoosen = await inquirer.prompt([
{
type: 'list',
name: 'version',
message: 'Select a YT version to download.',
choices: versionList
}
]);
}
const apkVersion = versionChoosen.version.replace(/\./g, '-') || ytVersion.replace(/\./g, '-');
let apkVersion;

if (ytVersion) apkVersion = ytVersion.replace(/\./g, '-');
if (versionChoosen) apkVersion = versionChoosen.version.replace(/\./g, '-');

const downloadLinkPage = await getPage(
`https://www.apkmirror.com/apk/google-inc/youtube/youtube-${apkVersion}-release/youtube-${apkVersion}-android-apk-download/`
Expand Down Expand Up @@ -299,7 +303,9 @@ async function getYTVersion () {
if (argParser.options.exclude) {
if (argParser.options.exclude.includes('microg-support')) {
if (!adbExists) {
console.log("You don't have ADB installed.\nPlease get it from here: https://developer.android.com/studio/releases/platform-tools\n");
console.log(
"You don't have ADB installed.\nPlease get it from here: https://developer.android.com/studio/releases/platform-tools\n"
);
process.exit();
}
ytVersion = await getYTVersion();
Expand Down Expand Up @@ -417,7 +423,9 @@ async function getYTVersion () {
for (const patch of patchesChoosed.patches) {
if (patch === 'microg-support') {
if (!adbExists) {
console.log("You don't have ADB installed.\nPlease get it from here: https://developer.android.com/studio/releases/platform-tools\n");
console.log(
"You don't have ADB installed.\nPlease get it from here: https://developer.android.com/studio/releases/platform-tools\n"
);
process.exit();
}
ytVersion = await getYTVersion();
Expand Down

0 comments on commit f0183fc

Please sign in to comment.