diff --git a/wsEvents/patchApp.js b/wsEvents/patchApp.js index 0cc5d6ef..52c426f4 100644 --- a/wsEvents/patchApp.js +++ b/wsEvents/patchApp.js @@ -88,10 +88,11 @@ async function reinstallReVanced() { function outputName() { const part1 = 'ReVanced'; - const appName = global.jarNames.selectedApp.appName; - let part2 = appName + let part2 = global.jarNames?.selectedApp?.appName ? global.jarNames.selectedApp.appName.replace(/[^a-zA-Z0-9\\.\\-]/g, '') - : global.jarNames.packageName.replace(/\./g, ''); + : global?.jarNames?.packageName + ? global.jarNames.packageName.replace(/\./g, '') + : ''; // make the app name empty if we cannot detect it // TODO: If the existing input APK is used from revanced/ without downloading, version and arch aren't set const part3 = global?.apkInfo?.version ? `v${global.apkInfo.version}` : '';