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

Commit

Permalink
Fix #320
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Aug 26, 2022
1 parent 00e33b8 commit 5f3b57b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wsEvents/GetPatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ module.exports = async function (message, ws) {
const versionsArr = versions.split(', ');
global.versions = versionsArr.map((i) => i.trim());
const maxVersion = versionsArr.sort()[versionsArr.length - 1];
let patchDesc;
if (name === 'enable-debugging') {
patchDesc = 'WARNING: THIS PATCH WILL SLOW DOWN THE APP, PLEASE DON\'T ENABLE THIS PATCH UNLESS YOU WANT TO DEBUG THE APP.\n' + description.trim();
}

if (isCompatible && (!isRooted || hasRoot)) {
patchList.push({
name,
description: description.trim(),
description: patchDesc || description.trim(),
maxVersion,
isRooted
});
Expand Down
19 changes: 19 additions & 0 deletions wsEvents/PatchApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,19 @@ function outputName () {
global.outputName = global.outputName.substring(1);
}

function reportSys(args, ws) {
ws.send(JSON.stringify({
event: 'error',
error: 'An error occured while starting the patching process. Please see the server console.'
}));

console.log('[builder] Please report these informations to https://github.com/reisxd/revanced-builder/issues');
console.log(`OS: ${os.platform()}\nArguements: ${args}\n OS Version${os.version()}`);
}

module.exports = async function (message, ws) {
const args = [
'-Xmx4G',
'-jar',
global.jarNames.cli,
'-b',
Expand Down Expand Up @@ -265,6 +276,10 @@ module.exports = async function (message, ws) {
await reinstallReVanced(ws);
await afterBuild(ws);
}

if (data.toString().includes('Unmatched')) {
reportSys(args, ws);
}
});

buildProcess.stderr.on('data', async (data) => {
Expand All @@ -283,5 +298,9 @@ module.exports = async function (message, ws) {
await reinstallReVanced(ws);
await afterBuild(ws);
}

if (data.toString().includes('Unmatched')) {
reportSys(args, ws);
}
});
};

0 comments on commit 5f3b57b

Please sign in to comment.