Skip to content

Commit

Permalink
Dynamically check if the app requires resource patching/merging integ…
Browse files Browse the repository at this point in the history
…rations
  • Loading branch information
reis committed Sep 22, 2022
1 parent c18c2be commit f60e5e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 10 additions & 0 deletions utils/PatchesParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ module.exports = async function parsePatch(packageName, hasRoot) {

if (!isCompatible || (isRooted && !hasRoot)) continue;

for (const dependencyName of patch.dependencies) {
if (dependencyName.includes('resource')) {
global.jarNames.patch.resources = true;
} else global.jarNames.patch.resources = false;

if (dependencyName.includes('integrations')) {
global.jarNames.patch.integrations = true;
} else global.jarNames.patch.integrations = false;
}

patches.push({
name: patch.name,
description: patch.description,
Expand Down
5 changes: 2 additions & 3 deletions wsEvents/patchApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,15 @@ module.exports = async function patchApp(ws) {
args.push('revanced/aapt2');
}

if (global.jarNames.selectedApp === 'youtube') {
if (global.jarNames.patch.integrations) {
args.push('-m');
args.push(global.jarNames.integrations);
}

args.push(...global.jarNames.patches.split(' '));

if (
global.jarNames.selectedApp.endsWith('frontpage') ||
global.jarNames.selectedApp.endsWith('trill')
!global.jarNames.patch.resources
)
args.push('-r');

Expand Down
6 changes: 5 additions & 1 deletion wsEvents/updateFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ global.jarNames = {
selectedApp: '',
patches: '',
isRooted: false,
deviceID: ''
deviceID: '',
patch: {
resources: false,
integrations: false
}
};

/**
Expand Down

0 comments on commit f60e5e1

Please sign in to comment.