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

Commit

Permalink
Fix #102
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Jul 29, 2022
1 parent d738c64 commit c46320f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ If you plan to use it from source, you'll also require [NodeJS >=16](https://nod

## How to use

Download the latest [executable](https://github.com/reisxd/revanced-builder/releases/latest) and if you are on Windows, unzip it and run it!
Download the latest [executable](https://github.com/reisxd/revanced-builder/releases/latest), unzip it and run it!
17 changes: 14 additions & 3 deletions src/ui/patchesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
const fs = require('fs');
const { deleteWidgets } = require('../utils/index.js');

function patchesScreen (selectedPatches, ui, variables, widgetsArray, pkg) {
function patchesScreen (selectedPatches, ui, variables, widgetsArray, pkg, patchesArray, pkgNameArray, firstWord) {
ui.labels.main.setText('Select the patches you want to exclude:');
ui.labels.main.setObjectName('text');
const listWidget = new QListWidget();
Expand Down Expand Up @@ -79,10 +79,21 @@ function patchesScreen (selectedPatches, ui, variables, widgetsArray, pkg) {
);
}
}
const patchName = patch.replace(/\|.+(.*)$/, '');
const patchName = patch.replace(/\|.+(.*)$/, '').replace(/\s/g, '');
variables.patches += ` -e ${patchName}`;
packageObject.excludedPatches.push(patchName);
}
let i = -1;
for (const patchnt of patchesArray) {
const patchName = patchnt.replace(firstWord, '').replace(/\s/g, '')
i++;
if (packageObject.excludedPatches.includes(patchName)) {
packageObject.excludedPatches.push(patchName);
continue;
}
if (pkgNameArray[i].replace(firstWord, '').replace(/\s/g, '') !== pkg) continue;
else variables.patches += ` -i ${patchName}`;
}
let foundObj = false;
for (const packageObj of excludedPatchList) {
if (typeof packageObj === 'string') continue;
Expand Down Expand Up @@ -113,7 +124,7 @@ function patchesScreen (selectedPatches, ui, variables, widgetsArray, pkg) {
});
for (const patch of selectedPatches) {
let excludedPatches = [];
const patchName = patch.replace(/\|.+(.*)$/, '');
const patchName = patch.replace(/\|.+(.*)$/, '').replace(/\s/g, '');
if (fs.existsSync('./excludedPatchesList.json')) {
excludedPatches = fs.readFileSync('./excludedPatchesList.json');
excludedPatches = JSON.parse(excludedPatches);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ async function excludePatches (ui, pkg) {
}
patchesChoice.push(patch);
}
patchesScreen(patchesChoice, ui, vars, widgetsArray, pkg);
patchesScreen(patchesChoice, ui, vars, widgetsArray, pkg, patchesArray, pkgNameArray, firstWord);
}

async function getAppVersions (version, app) {
Expand Down

0 comments on commit c46320f

Please sign in to comment.