Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add integration for @electron/fuses #8588

Merged
merged 8 commits into from
Oct 13, 2024
Merged

Conversation

mmaietta
Copy link
Collaborator

@mmaietta mmaietta commented Oct 11, 2024

feat: adding hardcoded interface for FuseV1Config so that electron-builder can integrate @electron/fuses while also allowing scheme.json to still generated correctly

Resolves: #6365

There will be a new configuration object electronFuses: FuseOptionsV1 and it executes @electron/fuses directly before signing as is recommended on the repo instructions: https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon

I've also opened it up as a convenience method should you want to keep custom logic in your afterPack method called via

await context.packager.addElectronFuses(context, { ... })

public async addElectronFuses(context: AfterPackContext, fuses: FuseConfig) {

It allows you to pass a full FuseConfig into the method as opposed to having electron-builder parsing electronFuses config property.
Taking this ☝️ approach would also allow you to set strictlyRequireAllFuses: true should you so desire. (I couldn't pass any var of this in-code due to https://github.com/electron/fuses/blob/0cf2a177e70dd81cc74c4449847287cd65ea140b/src/config.ts#L31-L34)

The fuse FuseV1Options.EnableEmbeddedAsarIntegrityValidation = true is supported now as well.
Tested locally and app runs

npx @electron/fuses read --app dist/mac-universal/electron-quick-start-typescript.app
Analyzing app: electron-quick-start-typescript.app
Fuse Version: v1
  RunAsNode is Enabled
  EnableCookieEncryption is Disabled
  EnableNodeOptionsEnvironmentVariable is Enabled
  EnableNodeCliInspectArguments is Enabled
  EnableEmbeddedAsarIntegrityValidation is Enabled
  OnlyLoadAppFromAsar is Disabled
  LoadBrowserProcessSpecificV8Snapshot is Disabled

Copy link

changeset-bot bot commented Oct 11, 2024

🦋 Changeset detected

Latest commit: 523fe4c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Major
dmg-builder Major
electron-builder-squirrel-windows Major
electron-builder Major
electron-forge-maker-appimage Major
electron-forge-maker-nsis-web Major
electron-forge-maker-nsis Major
electron-forge-maker-snap Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit 523fe4c
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/670aa21ceb500e0008b7eb4d
😎 Deploy Preview https://deploy-preview-8588--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mmaietta mmaietta merged commit 8434e10 into master Oct 13, 2024
14 checks passed
@mmaietta mmaietta deleted the feat/electron-fuses branch October 13, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Electron Fuses support
2 participants