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

Commit

Permalink
v3.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
reis committed Sep 29, 2022
1 parent bf26ae6 commit 3c806a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions utils/getAppVersion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
const { EOL } = require('node:os');

const exec = require('./promisifiedExec.js');

function sendError(ws) {
ws.send(
JSON.stringify({
event: 'error',
error:
"The app you selected is not installed on your device. It's needed for rooted ReVanced."
})
);
}
async function getAppVersion_(pkgName, ws, shouldReturnMsg, deviceId) {
try {
const { stdout, stderr } = await exec(
Expand All @@ -15,28 +23,19 @@ async function getAppVersion_(pkgName, ws, shouldReturnMsg, deviceId) {
const versionMatch = dumpSysOut.match(/versionName=([^=]+)/);

if (versionMatch === null) {
if (shouldReturnMsg)
ws.send(
JSON.stringify({
event: 'error',
error:
"The app you selected is not installed on your device. It's needed for rooted ReVanced."
})
);
if (shouldReturnMsg) {
sendError(ws);
}

return null;
}

return versionMatch[1].replace(`${EOL} `, '').match(/\d+(\.\d+)+/g)[0];
} catch (e) {
if (shouldReturnMsg)
ws.send(
JSON.stringify({
event: 'error',
error:
"The app you selected is not installed on your device. It's needed for rooted ReVanced."
})
);
if (shouldReturnMsg) {
sendError(ws);
}

return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion wsEvents/checkForUpdates.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { getDownloadLink } = require('../utils/FileDownloader.js');

const currentVersion = 'v3.4.11';
const currentVersion = 'v3.4.12';

/**
* @param {import('ws').WebSocket} ws
Expand Down

0 comments on commit 3c806a6

Please sign in to comment.