Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from SebiAi/main
Browse files Browse the repository at this point in the history
Explicitly include patches
  • Loading branch information
reis authored Jul 10, 2022
2 parents 2c62d81 + 5f3b8fa commit b74129a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ If you want to exclude more, seperate the patches with a comma:
$ node . --patch --exclude disable-shorts-button,microg-support
```

If you want to explicitly include a patch, use the `--include` option, example:

```bash
$ node . --patch --include autorepeat-by-default
```

If you want to include more, seperate the patches with a comma (same as the exclude option).

If you want to patch a specific YT version, download the APK, move it to this folder and rename it to `youtube.apk`:

```bash
Expand Down
18 changes: 15 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ async function getYTVersion () {

case 'patch': {
let excludedPatches = '';
let includedPatches = '';
let ytVersion;
let isRooted = false;

Expand Down Expand Up @@ -399,9 +400,20 @@ async function getYTVersion () {
}
if (!argParser.options.exclude.includes(',')) {
excludedPatches = ` -e ${argParser.options.exclude}`;
} else {
for (const patch of argParser.options.exclude.split(',')) {
excludedPatches += ` -e ${patch}`;
}
}
for (const patch of argParser.options.exclude.split(',')) {
excludedPatches += ` -e ${patch}`;
}

if (argParser.options.include) {
if (!argParser.options.include.includes(',')) {
includedPatches = ` -i ${argParser.options.include}`;
} else {
for (const patch of argParser.options.include.split(',')) {
includedPatches += ` -i ${patch}`;
}
}
}

Expand All @@ -412,7 +424,7 @@ async function getYTVersion () {
console.log('Building ReVanced, please be patient!');

const { stdout, stderr } = await actualExec(
`java -jar ${jarNames.cli} -b ${jarNames.patchesJar} --experimental -a ./revanced/youtube.apk ${jarNames.deviceId} -o ./revanced/revanced.apk -m ${jarNames.integrations} ${excludedPatches}`,
`java -jar ${jarNames.cli} -b ${jarNames.patchesJar} --experimental -a ./revanced/youtube.apk ${jarNames.deviceId} -o ./revanced/revanced.apk -m ${jarNames.integrations} ${excludedPatches} ${includedPatches}`,
{ maxBuffer: 5120 * 1024 }
);
console.log(stdout || stderr);
Expand Down

0 comments on commit b74129a

Please sign in to comment.