Skip to content

Commit

Permalink
feat: add fuses for ASAR integrity validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Sep 9, 2021
1 parent 6a835de commit bd6ba56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ await flipFuses(
[FuseV1Options.EnableCookieEncryption]: true, // Enables cookie encryption
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, // Disables the NODE_OPTIONS environment variable
[FuseV1Options.EnableNodeCliInspectArguments]: false, // Disables the --inspect and --inspect-brk family of ClI options
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, // Enables validation of the app.asar archive on macOS
[FuseV1Options.OnlyLoadAppFromAsar]: true, // Enforces that Electron will only load your app from "app.asar" instead of it's normall search paths
},
);
```
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export enum FuseV1Options {
EnableCookieEncryption = 1,
EnableNodeOptionsEnvironmentVariable = 2,
EnableNodeCliInspectArguments = 3,
EnableEmbeddedAsarIntegrityValidation = 4,
OnlyLoadAppFromAsar = 5,
}

export type FuseV1Config<T = boolean> = {
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const buildFuseV1Wire = (config: FuseV1Config, wireLength: number) => {
state(config[FuseV1Options.EnableCookieEncryption]),
state(config[FuseV1Options.EnableNodeOptionsEnvironmentVariable]),
state(config[FuseV1Options.EnableNodeCliInspectArguments]),
state(config[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]),
state(config[FuseV1Options.OnlyLoadAppFromAsar]),
];
};

Expand Down

0 comments on commit bd6ba56

Please sign in to comment.