bitwarden-desktop/patches/app-builder-lib+22.10.5.patch

55 lines
2.2 KiB
Diff

diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
index 41e067c..cd97293 100644
--- a/node_modules/app-builder-lib/out/macPackager.js
+++ b/node_modules/app-builder-lib/out/macPackager.js
@@ -292,6 +292,23 @@ class MacPackager extends _platformPackager().PlatformPackager {
const appFile = `${this.appInfo.productFilename}.app`;
+ // Bitwarden Patch: Electron-Builder currently does not support including our Safari extension which
+ // is already cross-compiled. Hence we remove it prior to making the universal package, and re-add
+ // it afterwards
+ // https://github.com/electron-userland/electron-builder/issues/5552
+ const rmdir = (0, _fsExtra().remove);
+ try {
+ await rmdir(`${x64AppOutDir}/Bitwarden.app/Contents/PlugIns`, {
+ recursive: true
+ });
+ await rmdir(`${arm64AppOutPath}/Bitwarden.app/Contents/PlugIns`, {
+ recursive: true
+ });
+ } catch (e) {
+ // Catches errors where PlugIns does not exist
+ console.log(e);
+ }
+
const {
makeUniversalApp
} = require('@electron/universal');
@@ -302,7 +319,15 @@ class MacPackager extends _platformPackager().PlatformPackager {
outAppPath: path.join(appOutDir, appFile),
force: true
});
- const rmdir = (0, _util().promisify)(require('fs').rmdir);
+
+ // Bitwarden Patch: Re-add PlugIns dir to Universal binary
+ try {
+ await ((0, _fsExtra().copy)(path.join(this.projectDir, 'PlugIns'), `${path.join(appOutDir, appFile)}/Contents/PlugIns`));
+ } catch (e) {
+ // Catches errors where PlugIns does not exist
+ console.log(e);
+ }
+
await rmdir(x64AppOutDir, {
recursive: true
});
@@ -611,7 +636,7 @@ exports.default = MacPackager;
function getCertificateType(isMas, isDevelopment) {
if (isDevelopment) {
- return "Mac Developer";
+ return "Apple Development";
}
return isMas ? "3rd Party Mac Developer Application" : "Developer ID Application";