Skip to content

Commit

Permalink
Adds afterpack script to flip EnableCookieEncryption electon fuse on (#…
Browse files Browse the repository at this point in the history
…1022)

* Adds afterpack script to flip EnableCookieEncryption electon fuse on

* Bump version
  • Loading branch information
anguswilliams authored Nov 20, 2023
1 parent b5dd58d commit f02846e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.3.22",
"version": "1.3.23",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down Expand Up @@ -50,6 +50,7 @@
"devDependencies": {
"electron": "27.0.4",
"electron-builder": "24.6.4",
"@electron/fuses": "^1.6.2",
"eslint": "8.53.0",
"yarn": "1.22.19"
},
Expand Down Expand Up @@ -122,6 +123,7 @@
},
"mac": {
"category": "public.app-category.productivity"
}
},
"afterPack": "scripts/afterpack.js"
}
}
34 changes: 34 additions & 0 deletions scripts/afterpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const {flipFuses, FuseVersion, FuseV1Options} = require('@electron/fuses');

function getAppFileName(context) {
const productFileName = context.packager.appInfo.productFilename

switch (context.electronPlatformName) {
case 'win32':
return `${productFileName}.exe`;
case 'darwin':
return `${productFileName}.app`;
case 'mas':
return `${productFileName}.app`;
case 'linux':
return context.packager.executableName;
default:
return '';
}
}

exports.default = async function afterPack(context) {
try {
await flipFuses(
`${context.appOutDir}/${getAppFileName(context)}`,
{
version: FuseVersion.V1,
[FuseV1Options.EnableCookieEncryption]: true,
},
);

} catch (error) {
console.error('afterPack error: ', error);
process.exit(1);
}
};
13 changes: 11 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
glob "^7.1.6"
minimatch "^3.0.4"

"@electron/fuses@^1.6.2":
version "1.6.2"
resolved "https://registry.yarnpkg.com/@electron/fuses/-/fuses-1.6.2.tgz#24e9525817e19d9547807e634e19cfc623bf5fe8"
integrity sha512-qInBOs+m21oCLwN2ASHsHqNgI45trsgSiDEYQTw3qsTfwveEUb+WRgh0sYfVXsekqr8X2qvHX9OyVc1w+Lo8NQ==
dependencies:
chalk "^4.1.1"
fs-extra "^9.0.1"
minimist "^1.2.5"

"@electron/get@^2.0.0":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.3.tgz#fba552683d387aebd9f3fcadbcafc8e12ee4f960"
Expand Down Expand Up @@ -539,7 +548,7 @@ callsites@^3.0.0:
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==

chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.2:
chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.1, chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
Expand Down Expand Up @@ -1577,7 +1586,7 @@ minimatch@^5.0.1, minimatch@^5.1.1:
dependencies:
brace-expansion "^2.0.1"

minimist@^1.2.6:
minimist@^1.2.5, minimist@^1.2.6:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
Expand Down

0 comments on commit f02846e

Please sign in to comment.