2024-07-24 19:17:11 +02:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires, no-console */
|
|
|
|
require("dotenv").config();
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const fse = require("fs-extra");
|
|
|
|
|
|
|
|
exports.default = run;
|
|
|
|
|
|
|
|
async function run(context) {
|
|
|
|
console.log("## After pack");
|
2024-09-09 15:09:17 +02:00
|
|
|
console.log(context);
|
2024-07-24 19:17:11 +02:00
|
|
|
if (context.electronPlatformName === "linux") {
|
|
|
|
console.log("Creating memory-protection wrapper script");
|
|
|
|
const appOutDir = context.appOutDir;
|
|
|
|
const oldBin = path.join(appOutDir, context.packager.executableName);
|
|
|
|
const newBin = path.join(appOutDir, "bitwarden-app");
|
|
|
|
fse.moveSync(oldBin, newBin);
|
|
|
|
console.log("Moved binary to bitwarden-app");
|
|
|
|
|
|
|
|
const wrapperScript = path.join(__dirname, "../resources/memory-dump-wrapper.sh");
|
|
|
|
const wrapperBin = path.join(appOutDir, context.packager.executableName);
|
|
|
|
fse.copyFileSync(wrapperScript, wrapperBin);
|
|
|
|
fse.chmodSync(wrapperBin, "755");
|
|
|
|
console.log("Copied memory-protection wrapper script");
|
|
|
|
}
|
2024-09-05 13:20:44 +02:00
|
|
|
}
|