app-builder-lib 27.0.0-alpha.10 → 27.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/asar/asarAlign.d.ts +35 -0
  2. package/dist/asar/asarAlign.d.ts.map +1 -0
  3. package/dist/asar/asarAlign.js +149 -0
  4. package/dist/asar/asarAlign.js.map +1 -0
  5. package/dist/asar/asarUtil.d.ts +15 -1
  6. package/dist/asar/asarUtil.d.ts.map +1 -1
  7. package/dist/asar/asarUtil.js +111 -61
  8. package/dist/asar/asarUtil.js.map +1 -1
  9. package/dist/codeSign/win/authenticodeSignature.d.ts +71 -0
  10. package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
  11. package/dist/codeSign/win/authenticodeSignature.js +241 -0
  12. package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
  13. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +11 -0
  14. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  15. package/dist/codeSign/win/signtoolBaseSignManager.js +36 -16
  16. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  17. package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
  18. package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
  19. package/dist/codeSign/win/verifyUpdatePublisher.js +98 -0
  20. package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
  21. package/dist/configuration.d.ts +16 -13
  22. package/dist/configuration.d.ts.map +1 -1
  23. package/dist/configuration.js.map +1 -1
  24. package/dist/electron/ElectronFramework.d.ts +15 -0
  25. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  26. package/dist/electron/ElectronFramework.js +33 -2
  27. package/dist/electron/ElectronFramework.js.map +1 -1
  28. package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
  29. package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
  30. package/dist/electron/mac/asarIntegrityDigest.js +122 -0
  31. package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
  32. package/dist/electron/mac/electronMac.js +1 -28
  33. package/dist/electron/mac/electronMac.js.map +1 -1
  34. package/dist/electron/mac/electronMacUtils.d.ts +8 -0
  35. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
  36. package/dist/electron/mac/electronMacUtils.js +36 -0
  37. package/dist/electron/mac/electronMacUtils.js.map +1 -1
  38. package/dist/fileMatcher.d.ts +47 -12
  39. package/dist/fileMatcher.d.ts.map +1 -1
  40. package/dist/fileMatcher.js +150 -45
  41. package/dist/fileMatcher.js.map +1 -1
  42. package/dist/forge-maker.d.ts +64 -0
  43. package/dist/forge-maker.d.ts.map +1 -1
  44. package/dist/forge-maker.js +104 -2
  45. package/dist/forge-maker.js.map +1 -1
  46. package/dist/index.d.ts +4 -4
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/indexInternal.d.ts +5 -3
  51. package/dist/indexInternal.d.ts.map +1 -1
  52. package/dist/indexInternal.js +5 -3
  53. package/dist/indexInternal.js.map +1 -1
  54. package/dist/macPackager.d.ts +6 -0
  55. package/dist/macPackager.d.ts.map +1 -1
  56. package/dist/macPackager.js +48 -2
  57. package/dist/macPackager.js.map +1 -1
  58. package/dist/options/FuseOptionsV1.d.ts +4 -0
  59. package/dist/options/FuseOptionsV1.d.ts.map +1 -1
  60. package/dist/options/FuseOptionsV1.js.map +1 -1
  61. package/dist/options/PlatformSpecificBuildOptions.d.ts +166 -8
  62. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  63. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  64. package/dist/options/SnapOptions.d.ts +36 -15
  65. package/dist/options/SnapOptions.d.ts.map +1 -1
  66. package/dist/options/SnapOptions.js.map +1 -1
  67. package/dist/options/linuxOptions.d.ts +53 -18
  68. package/dist/options/linuxOptions.d.ts.map +1 -1
  69. package/dist/options/linuxOptions.js.map +1 -1
  70. package/dist/options/macOptions.d.ts +15 -1
  71. package/dist/options/macOptions.d.ts.map +1 -1
  72. package/dist/options/macOptions.js.map +1 -1
  73. package/dist/options/winOptions.d.ts +7 -4
  74. package/dist/options/winOptions.d.ts.map +1 -1
  75. package/dist/options/winOptions.js.map +1 -1
  76. package/dist/packager.d.ts +2 -0
  77. package/dist/packager.d.ts.map +1 -1
  78. package/dist/packager.js +6 -0
  79. package/dist/packager.js.map +1 -1
  80. package/dist/platformPackager.d.ts +11 -4
  81. package/dist/platformPackager.d.ts.map +1 -1
  82. package/dist/platformPackager.js +53 -18
  83. package/dist/platformPackager.js.map +1 -1
  84. package/dist/presets/rectCra.js +3 -1
  85. package/dist/presets/rectCra.js.map +1 -1
  86. package/dist/publish/PublishManager.d.ts +6 -1
  87. package/dist/publish/PublishManager.d.ts.map +1 -1
  88. package/dist/publish/PublishManager.js +80 -58
  89. package/dist/publish/PublishManager.js.map +1 -1
  90. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  91. package/dist/publish/updateInfoBuilder.js +8 -10
  92. package/dist/publish/updateInfoBuilder.js.map +1 -1
  93. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  94. package/dist/targets/ArchiveTarget.js +7 -1
  95. package/dist/targets/ArchiveTarget.js.map +1 -1
  96. package/dist/targets/archive.d.ts +12 -0
  97. package/dist/targets/archive.d.ts.map +1 -1
  98. package/dist/targets/archive.js +17 -3
  99. package/dist/targets/archive.js.map +1 -1
  100. package/dist/targets/blockmap/blockmap.d.ts +3 -2
  101. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  102. package/dist/targets/blockmap/blockmap.js +3 -2
  103. package/dist/targets/blockmap/blockmap.js.map +1 -1
  104. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  105. package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
  106. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  107. package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
  108. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  109. package/dist/targets/linux/FlatpakTarget.js +238 -48
  110. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  111. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  112. package/dist/targets/linux/FpmTarget.js +10 -14
  113. package/dist/targets/linux/FpmTarget.js.map +1 -1
  114. package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -3
  115. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  116. package/dist/targets/linux/LinuxTargetHelper.js +45 -20
  117. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  118. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  119. package/dist/targets/linux/appimage/AppImageTarget.js +5 -1
  120. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  121. package/dist/targets/linux/appimage/appImageUtil.d.ts +3 -1
  122. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  123. package/dist/targets/linux/appimage/appImageUtil.js +2 -2
  124. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  125. package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
  126. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  127. package/dist/targets/linux/appimage/appLauncher.js +13 -9
  128. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  129. package/dist/targets/linux/flatpakBundle.d.ts +43 -0
  130. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
  131. package/dist/targets/linux/flatpakBundle.js +210 -0
  132. package/dist/targets/linux/flatpakBundle.js.map +1 -0
  133. package/dist/targets/linux/snap/core24.d.ts +0 -18
  134. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  135. package/dist/targets/linux/snap/core24.js +29 -100
  136. package/dist/targets/linux/snap/core24.js.map +1 -1
  137. package/dist/targets/linux/snap/coreLegacy.d.ts +7 -0
  138. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  139. package/dist/targets/linux/snap/coreLegacy.js +25 -6
  140. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  141. package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
  142. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
  143. package/dist/targets/linux/snap/snapPlugs.js +242 -0
  144. package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
  145. package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
  146. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  147. package/dist/targets/mac/MacTargetHelper.js +47 -3
  148. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  149. package/dist/targets/mac/pkg.d.ts.map +1 -1
  150. package/dist/targets/mac/pkg.js +1 -0
  151. package/dist/targets/mac/pkg.js.map +1 -1
  152. package/dist/targets/win/nsis/Defines.d.ts +1 -0
  153. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  154. package/dist/targets/win/nsis/Defines.js.map +1 -1
  155. package/dist/targets/win/nsis/NsisTarget.d.ts +8 -1
  156. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  157. package/dist/targets/win/nsis/NsisTarget.js +36 -5
  158. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  159. package/dist/targets/win/nsis/nsisOptions.d.ts +6 -4
  160. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  161. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  162. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  163. package/dist/targets/win/nsis/nsisUtil.js +7 -2
  164. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  165. package/dist/targets/win/winAppUtil.d.ts +2 -2
  166. package/dist/targets/win/winAppUtil.d.ts.map +1 -1
  167. package/dist/targets/win/winAppUtil.js +5 -3
  168. package/dist/targets/win/winAppUtil.js.map +1 -1
  169. package/dist/toolsets/appimage.d.ts.map +1 -1
  170. package/dist/toolsets/appimage.js +19 -19
  171. package/dist/toolsets/appimage.js.map +1 -1
  172. package/dist/toolsets/nsis.js +1 -1
  173. package/dist/toolsets/nsis.js.map +1 -1
  174. package/dist/toolsets/winCodeSign.d.ts +14 -1
  175. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  176. package/dist/toolsets/winCodeSign.js +14 -1
  177. package/dist/toolsets/winCodeSign.js.map +1 -1
  178. package/dist/util/AppFileWalker.js +9 -1
  179. package/dist/util/AppFileWalker.js.map +1 -1
  180. package/dist/util/appFileCopier.d.ts +15 -2
  181. package/dist/util/appFileCopier.d.ts.map +1 -1
  182. package/dist/util/appFileCopier.js +30 -20
  183. package/dist/util/appFileCopier.js.map +1 -1
  184. package/dist/util/config/config.d.ts +1 -1
  185. package/dist/util/config/config.d.ts.map +1 -1
  186. package/dist/util/config/config.js +42 -19
  187. package/dist/util/config/config.js.map +1 -1
  188. package/dist/util/config/fileOptions.d.ts +52 -0
  189. package/dist/util/config/fileOptions.d.ts.map +1 -0
  190. package/dist/util/config/fileOptions.js +210 -0
  191. package/dist/util/config/fileOptions.js.map +1 -0
  192. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  193. package/dist/util/config/legacyConfigGuard.js +31 -4
  194. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  195. package/dist/util/config/legacyOptions.d.ts +11 -0
  196. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  197. package/dist/util/config/legacyOptions.js +36 -10
  198. package/dist/util/config/legacyOptions.js.map +1 -1
  199. package/dist/util/electronGet.d.ts +13 -0
  200. package/dist/util/electronGet.d.ts.map +1 -1
  201. package/dist/util/electronGet.js +40 -17
  202. package/dist/util/electronGet.js.map +1 -1
  203. package/dist/util/removedEnvVars.d.ts +25 -0
  204. package/dist/util/removedEnvVars.d.ts.map +1 -0
  205. package/dist/util/removedEnvVars.js +54 -0
  206. package/dist/util/removedEnvVars.js.map +1 -0
  207. package/dist/util/trustedSourceRoots.d.ts +59 -0
  208. package/dist/util/trustedSourceRoots.d.ts.map +1 -0
  209. package/dist/util/trustedSourceRoots.js +127 -0
  210. package/dist/util/trustedSourceRoots.js.map +1 -0
  211. package/dist/version.d.ts +1 -1
  212. package/dist/version.js +1 -1
  213. package/dist/version.js.map +1 -1
  214. package/package.json +18 -17
  215. package/scheme.json +421 -436
  216. package/templates/nsis/include/installer.nsh +11 -8
  217. package/templates/nsis/installSection.nsh +5 -0
@@ -6,7 +6,9 @@ import * as fs from "fs/promises";
6
6
  import { mkdir, readdir } from "fs/promises";
7
7
  import { Lazy } from "lazy-val";
8
8
  import * as path from "path";
9
+ import * as semver from "semver";
9
10
  import { AppInfo } from "./appInfo.js";
11
+ import { embedAsarIntegrityDigest, FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST } from "./electron/mac/asarIntegrityDigest.js";
10
12
  import { assertSafeHelperName } from "./electron/mac/electronMacUtils.js";
11
13
  import { createKeychain, isSignAllowed, removeKeychain, sign } from "./codeSign/mac/macCodeSign.js";
12
14
  import { combineSignResults, isSignResultSigned } from "./codeSign/signResult.js";
@@ -16,6 +18,7 @@ import { chooseNotNull, PlatformPackager } from "./platformPackager.js";
16
18
  import { ArchiveTarget } from "./targets/ArchiveTarget.js";
17
19
  import { PkgTarget, prepareProductBuildArgs } from "./targets/mac/pkg.js";
18
20
  import { createCommonTarget, NoOpTarget } from "./targets/targetFactory.js";
21
+ import { isPlainObject, replaceMergedExcludedExts } from "./util/config/fileOptions.js";
19
22
  import { isMacOsHighSierra } from "./util/mac/macosVersion.js";
20
23
  import { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from "./util/archCompatibility.js";
21
24
  import { expandMacro as doExpandMacro } from "./util/macroExpander.js";
@@ -24,6 +27,16 @@ import { makeUniversalApp } from "@electron/universal";
24
27
  function isElectronSignOptions(sign) {
25
28
  return typeof sign === "object" && sign !== null;
26
29
  }
30
+ /**
31
+ * Merges the mac → mas (→ masDev) cascade. `deepAssign` merges a later layer into a nested object it took from an earlier one, so each
32
+ * layer's `fileOptions` is copied first: merging the mas configuration must not change the `fileOptions` of the mac one. A later layer's
33
+ * `fileOptions.excludedExts` replaces an earlier one (see replaceMergedExcludedExts).
34
+ */
35
+ function mergeMasConfig(...layers) {
36
+ const config = deepAssign({}, ...layers.map(it => (it != null && isPlainObject(it.fileOptions) ? { ...it, fileOptions: { ...it.fileOptions } } : it)));
37
+ replaceMergedExcludedExts(config, layers);
38
+ return config;
39
+ }
27
40
  export class MacPackager extends PlatformPackager {
28
41
  constructor(info) {
29
42
  super(info, Platform.MAC);
@@ -64,13 +77,13 @@ export class MacPackager extends PlatformPackager {
64
77
  let platformName;
65
78
  switch (platformType) {
66
79
  case "mas":
67
- config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas);
80
+ config = mergeMasConfig(this.platformSpecificBuildOptions, this.config.mas);
68
81
  platformName = "mas";
69
82
  break;
70
83
  case "mas-dev":
71
84
  // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer
72
85
  // carried as a config field; it is derived from `platformType` wherever signing happens.
73
- config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev);
86
+ config = mergeMasConfig(this.platformSpecificBuildOptions, this.config.mas, this.config.masDev);
74
87
  platformName = "mas";
75
88
  break;
76
89
  case "mac":
@@ -215,6 +228,7 @@ export class MacPackager extends PlatformPackager {
215
228
  if (this.info.cancellationToken.cancelled) {
216
229
  return;
217
230
  }
231
+ await this.doAddAsarIntegrityDigest(packContext, platformSpecificBuildOptions, await this.computeAsarOptions(platformSpecificBuildOptions));
218
232
  await this.doAddElectronFuses(packContext);
219
233
  // Mirror the base-class guard: skip signing when the caller explicitly set sign:false
220
234
  // (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).
@@ -222,6 +236,38 @@ export class MacPackager extends PlatformPackager {
222
236
  await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets);
223
237
  }
224
238
  }
239
+ /**
240
+ * Embeds the ASAR integrity digest into the Electron Framework, see `mac.asarIntegrityDigest`. A universal app gets it after the slices are merged: they
241
+ * have no `ElectronAsarIntegrity` entries, and re-signing the framework of a slice would make the slices differ in a way `@electron/universal` rejects.
242
+ */
243
+ async doAddAsarIntegrityDigest(packContext, platformSpecificBuildOptions, asarOptions) {
244
+ // nothing to protect without the entries electron-builder computes: a stock Electron Info.plist still lists the removed default_app.asar
245
+ if (asarOptions == null || asarOptions.disableIntegrity) {
246
+ return;
247
+ }
248
+ if (platformSpecificBuildOptions.asarIntegrityDigest === false) {
249
+ log.info({ reason: "asarIntegrityDigest is set to false" }, "skipped ASAR integrity digest");
250
+ return;
251
+ }
252
+ const electronVersion = semver.coerce(this.info.framework.version);
253
+ if (electronVersion == null || semver.major(electronVersion) < FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST) {
254
+ return;
255
+ }
256
+ if (process.platform !== "darwin") {
257
+ log.warn({ reason: "supported only on macOS, where codesign can sign the modified Electron Framework again" }, "skipped ASAR integrity digest");
258
+ return;
259
+ }
260
+ const frameworkName = `${path.basename(this.info.framework.distMacOsAppName, ".app")} Framework`;
261
+ const embedded = await embedAsarIntegrityDigest(path.join(packContext.appOutDir, `${this.appInfo.productFilename}.app`), frameworkName);
262
+ // an afterPack hook that signs the app or changes it in ways the digest must not cover is where this change bites
263
+ if (embedded && this.info.filterPackagerEventListeners("afterPack", "user").length > 0) {
264
+ log
265
+ .once("asar-integrity-digest-after-afterpack")
266
+ .warn({ solution: "set mac.asarIntegrityDigest to false if your afterPack hook signs the app" }, "electron-builder v27 embeds the ASAR integrity digest into the Electron Framework after the afterPack hook and signs the framework again ad hoc, replacing a signature applied in afterPack. " +
267
+ "Changing app.asar or Info.plist after afterPack now fails the app at launch when the enableEmbeddedAsarIntegrityValidation fuse is on. " +
268
+ "See https://www.electron.build/docs/migration/v27-breaking-changes#macos-asar-integrity-digest");
269
+ }
270
+ }
225
271
  /**
226
272
  * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for
227
273
  * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa,EACb,yBAAyB,EACzB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAmB,cAAc,EAAmC,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACrJ,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAiB,MAAM,0BAA0B,CAAA;AAChG,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAU,MAAM,WAAW,CAAA;AAExD,OAAO,EAAE,eAAe,EAAiC,MAAM,kCAAkC,CAAA;AAGjG,OAAO,EAAE,aAAa,EAAiB,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE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/G,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrI,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;QACpC,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAEnJ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport type { SignOptions } from \"@electron/osx-sign\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { assertSafeHelperName } from \"./electron/mac/electronMacUtils.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, Identity, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { combineSignResults, isSignResultSigned, SigningResult } from \"./codeSign/signResult.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, MasPlatformType, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { ElectronSignOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from \"./util/archCompatibility.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nfunction isElectronSignOptions(sign: MacConfiguration[\"sign\"]): sign is ElectronSignOptions {\n return typeof sign === \"object\" && sign !== null\n}\n\ninterface PlatformConfig<C extends MacConfiguration | MasConfiguration = MacConfiguration | MasConfiguration> {\n type: PlatformType\n config: C\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type. Calls statically known to be a MAS\n * flavor (`mas` / `mas-dev`) get a `MasConfiguration` back, so no cast is needed downstream.\n */\n getPlatformConfig(platformType: MasPlatformType): PlatformConfig<MasConfiguration>\n getPlatformConfig(platformType: PlatformType): PlatformConfig\n getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer\n // carried as a config field; it is derived from `platformType` wherever signing happens.\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev)\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n const macAppInfo = new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n // Electron discovers its helper apps via `${CFBundleName} Helper.app`. We use the product name\n // verbatim for `CFBundleName` and for the on-disk helper/app bundle names, so a name that\n // filename sanitization would change must be rejected (otherwise the two would diverge and break\n // helper discovery). Fail fast during setup.\n assertSafeHelperName(macAppInfo.productName, \"productName\")\n const executableName = this.platformSpecificBuildOptions.executableName ?? this.info.config.executableName\n if (executableName != null) {\n assertSafeHelperName(executableName, \"executableName\")\n }\n return macAppInfo\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n return await super.doPack(config)\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n // Keep both slices symmetric: don't drop platform-mismatched modules per-arch (that asymmetry breaks\n // the universal merge). Single-arch binaries are reconciled below via `computeSingleArchFiles`.\n disableArchFilter: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const universalOpts = platformSpecificBuildOptions.universal\n\n // Single-arch binaries that can't be merged into a universal Mach-O. Two sources:\n // 1. `cpu`/`os`-declared platform packages (e.g. `@esbuild/darwin-arm64`), which the collection filter\n // confines to their native slice — mark the whole package so unique non-binary siblings don't trip the merge.\n // 2. Host binaries identical in both slices inside packages that declare no `cpu`/`os` (e.g. esbuild's\n // install script overwriting `esbuild/bin/esbuild` with the platform binary) — mark the file.\n // Both are reported to `@electron/universal` via `singleArchFiles`; otherwise it aborts on the arch mismatch.\n const singleArchFiles = await this.computeSingleArchFiles(\n path.join(safeX64AppOutDir, appFile),\n path.join(safeArm64AppOutPath, appFile),\n universalOpts?.singleArchFiles ?? undefined\n )\n\n await makeUniversalApp({\n mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs\n ...universalOpts,\n singleArchFiles,\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n /**\n * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for\n * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.\n */\n private async computeSingleArchFiles(x64AppPath: string, arm64AppPath: string, userPattern: string | undefined): Promise<string | undefined> {\n const unpacked = (appPath: string) => path.join(appPath, \"Contents\", \"Resources\", \"app.asar.unpacked\")\n const x64Unpacked = unpacked(x64AppPath)\n const arm64Unpacked = unpacked(arm64AppPath)\n\n // (1) `cpu`/`os`-declared platform packages confined to one slice — mark the whole package.\n const packageNames = new Set<string>()\n await collectSingleArchPackageNames(path.join(x64Unpacked, \"node_modules\"), packageNames)\n await collectSingleArchPackageNames(path.join(arm64Unpacked, \"node_modules\"), packageNames)\n\n // (2) undeclared host binaries identical in both slices (e.g. `esbuild/bin/esbuild`) — mark the file.\n const machOFiles = await collectIdenticalSingleArchMachOFiles(x64Unpacked, arm64Unpacked)\n\n const patterns = [...Array.from(packageNames).map(name => `**/${name}/**`), ...machOFiles]\n if (patterns.length === 0) {\n return userPattern\n }\n\n log.warn(\n { packages: Array.from(packageNames).sort().join(\", \") || \"(none)\", files: machOFiles.sort().join(\", \") || \"(none)\" },\n \"Universal build contains single-architecture binaries; they are copied as-is per slice (not lipo-merged), so each is only usable on architectures whose platform package was installed on this build host. \" +\n \"If these are build-only tools (e.g. esbuild), move them to `devDependencies` or exclude them via `files` to omit them entirely. \" +\n \"If they are needed at runtime, install every target architecture's variant so the universal app works on both Intel and Apple Silicon (pnpm/yarn: `supportedArchitectures`; npm: `--cpu`/`--os`).\"\n )\n return buildSingleArchFilesPattern(patterns, userPattern)\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n let appPath: string = path.join(targetOutDir, `${this.appInfo.productFilename}.app`)\n if (prepackaged != null) {\n appPath = prepackaged\n } else {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n }\n const signResult = await this.sign(appPath, arch, platformType)\n const signed = isSignResultSigned(signResult)\n\n // The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other\n // emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before\n // the .pkg installer is built, and warn when signing was skipped (#9997).\n const packContext: AfterPackContext = {\n appOutDir: path.dirname(appPath),\n outDir: resolvedOutDir,\n arch,\n targets: [target],\n packager: this,\n electronPlatformName: platformConfig.platformName,\n }\n if (signed) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (await this.info.shouldSkipTargetsAfterPack(packContext)) {\n continue\n }\n\n // A development-signed build (mas-dev, or an explicit sign.type \"development\" — see\n // MacTargetHelper.shouldCreateMasInstaller) produces no installer\n const masSignConfig = platformConfig.config.sign\n const masSignOpts = isElectronSignOptions(masSignConfig) ? masSignConfig : undefined\n if (signed && MacTargetHelper.shouldCreateMasInstaller(platformType, masSignOpts?.type)) {\n await this.createMasInstaller(appPath, targetOutDir, arch, platformType)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (\n await this.info.shouldSkipTargetsAfterPack({\n appOutDir: path.dirname(appPath),\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: this.platform.nodeName,\n })\n ) {\n return\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n /**\n * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`\n * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).\n */\n protected async createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: MasPlatformType): Promise<void> {\n const config = this.getPlatformConfig(targetPlatform).config\n const signConfig = config.sign\n const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, targetPlatform, arch, signOpts?.identity)\n }\n\n /**\n * Main signing method with platform awareness. Protected so tests can stub signing\n * (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.\n */\n protected async sign(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<SigningResult> {\n if (!isSignAllowed()) {\n // non-mac host, or the pull-request CI guard — signing cannot happen in this environment\n return \"skipped:unsupported\"\n }\n\n // getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.\n const config = this.getPlatformConfig(targetPlatform).config.sign\n\n // sign: null → user explicitly disabled signing\n if (config === null) {\n return this.helper.handleNullIdentity()\n }\n\n const signOpts = isElectronSignOptions(config) ? config : undefined\n // sign.identity: null → explicit skip; undefined → auto-discover\n const qualifier = signOpts?.identity\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n // `config` is a custom fn/string module path when it's non-null and not an options object\n const hasCustomSign = config != null && !signOpts\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n\n const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts)\n\n if (!identity) {\n return \"skipped:no-certificate\"\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform, hasCustomSign)\n await this.doSign(signOptions, config, identity)\n\n // now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would\n // fail library validation at launch — the case the old blanket entitlements default used to mask\n if (!hasCustomSign) {\n await this.helper.warnAboutForeignSignedBinaries(appPath, identity, targetPlatform, signOpts)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return hasCustomSign ? \"signed:custom\" : \"signed\"\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, signConfig: MacConfiguration[\"sign\"], identity: Identity | null): Promise<void> {\n // Resolve a custom signer only when signConfig is a function or string module path.\n // ElectronSignOptions objects and undefined use @electron/osx-sign directly.\n const customSign =\n signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n // `opts.identity` is resolved once, in MacTargetHelper.resolveSignIdentity — never re-derive it here, or a\n // custom signer and @electron/osx-sign end up signing with different forms of the same certificate\n return customSign ? Promise.resolve(customSign(opts, this)) : sign(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void> {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name. The product name is used verbatim (it is validated in `prepareAppInfo` to\n // require no filename sanitization), so `CFBundleName` matches the on-disk helper bundle names\n // that Electron resolves as `${CFBundleName} Helper.app`.\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n // const activeOpts = this.getPlatformConfig(distType).config\n appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<SigningResult> {\n const targetPlatform: PlatformType = platformType ?? (packContext.electronPlatformName === \"mas\" ? \"mas\" : \"mac\")\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<Array<SigningResult>> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n return await Promise.all(\n directories\n .filter(file => shouldSign(file))\n .map(async (file: string) => {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n return await this.sign(safeSignTarget, packContext.arch, targetPlatform)\n })\n )\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n // the combined result gates the `afterSign` hook — a signed result wins (see PlatformPackager.doSignAfterPack)\n const results = await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return combineSignResults(results)\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n results.push(...(await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))))\n\n return combineSignResults(results)\n }\n}\n"]}
1
+ {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa,EACb,yBAAyB,EACzB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,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ACD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAA;gBACrE,MAAM,cAAc,GAAG,eAAe,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAA;gBAC7E,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;YAC1E,CAAC,CAAC,CACL,CAAA;QACH,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,MAAM,CAAA;QACzD,+GAA+G;QAC/G,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrI,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;QACpC,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAEnJ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport type { SignOptions } from \"@electron/osx-sign\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { embedAsarIntegrityDigest, FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST } from \"./electron/mac/asarIntegrityDigest.js\"\nimport { assertSafeHelperName } from \"./electron/mac/electronMacUtils.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, Identity, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { combineSignResults, isSignResultSigned, SigningResult } from \"./codeSign/signResult.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, MasPlatformType, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { ElectronSignOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { AsarOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { isPlainObject, replaceMergedExcludedExts } from \"./util/config/fileOptions.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from \"./util/archCompatibility.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nfunction isElectronSignOptions(sign: MacConfiguration[\"sign\"]): sign is ElectronSignOptions {\n return typeof sign === \"object\" && sign !== null\n}\n\n/**\n * Merges the mac → mas (→ masDev) cascade. `deepAssign` merges a later layer into a nested object it took from an earlier one, so each\n * layer's `fileOptions` is copied first: merging the mas configuration must not change the `fileOptions` of the mac one. A later layer's\n * `fileOptions.excludedExts` replaces an earlier one (see replaceMergedExcludedExts).\n */\nfunction mergeMasConfig(...layers: Array<MacConfiguration | MasConfiguration | Nullish>): MasConfiguration {\n const config: MasConfiguration = deepAssign({}, ...layers.map(it => (it != null && isPlainObject(it.fileOptions) ? { ...it, fileOptions: { ...it.fileOptions } } : it)))\n replaceMergedExcludedExts(config, layers)\n return config\n}\n\ninterface PlatformConfig<C extends MacConfiguration | MasConfiguration = MacConfiguration | MasConfiguration> {\n type: PlatformType\n config: C\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type. Calls statically known to be a MAS\n * flavor (`mas` / `mas-dev`) get a `MasConfiguration` back, so no cast is needed downstream.\n */\n getPlatformConfig(platformType: MasPlatformType): PlatformConfig<MasConfiguration>\n getPlatformConfig(platformType: PlatformType): PlatformConfig\n getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = mergeMasConfig(this.platformSpecificBuildOptions, this.config.mas)\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer\n // carried as a config field; it is derived from `platformType` wherever signing happens.\n config = mergeMasConfig(this.platformSpecificBuildOptions, this.config.mas, this.config.masDev)\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n const macAppInfo = new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n // Electron discovers its helper apps via `${CFBundleName} Helper.app`. We use the product name\n // verbatim for `CFBundleName` and for the on-disk helper/app bundle names, so a name that\n // filename sanitization would change must be rejected (otherwise the two would diverge and break\n // helper discovery). Fail fast during setup.\n assertSafeHelperName(macAppInfo.productName, \"productName\")\n const executableName = this.platformSpecificBuildOptions.executableName ?? this.info.config.executableName\n if (executableName != null) {\n assertSafeHelperName(executableName, \"executableName\")\n }\n return macAppInfo\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n return await super.doPack(config)\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n // Keep both slices symmetric: don't drop platform-mismatched modules per-arch (that asymmetry breaks\n // the universal merge). Single-arch binaries are reconciled below via `computeSingleArchFiles`.\n disableArchFilter: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const universalOpts = platformSpecificBuildOptions.universal\n\n // Single-arch binaries that can't be merged into a universal Mach-O. Two sources:\n // 1. `cpu`/`os`-declared platform packages (e.g. `@esbuild/darwin-arm64`), which the collection filter\n // confines to their native slice — mark the whole package so unique non-binary siblings don't trip the merge.\n // 2. Host binaries identical in both slices inside packages that declare no `cpu`/`os` (e.g. esbuild's\n // install script overwriting `esbuild/bin/esbuild` with the platform binary) — mark the file.\n // Both are reported to `@electron/universal` via `singleArchFiles`; otherwise it aborts on the arch mismatch.\n const singleArchFiles = await this.computeSingleArchFiles(\n path.join(safeX64AppOutDir, appFile),\n path.join(safeArm64AppOutPath, appFile),\n universalOpts?.singleArchFiles ?? undefined\n )\n\n await makeUniversalApp({\n mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs\n ...universalOpts,\n singleArchFiles,\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddAsarIntegrityDigest(packContext, platformSpecificBuildOptions, await this.computeAsarOptions(platformSpecificBuildOptions))\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n /**\n * Embeds the ASAR integrity digest into the Electron Framework, see `mac.asarIntegrityDigest`. A universal app gets it after the slices are merged: they\n * have no `ElectronAsarIntegrity` entries, and re-signing the framework of a slice would make the slices differ in a way `@electron/universal` rejects.\n */\n protected async doAddAsarIntegrityDigest(\n packContext: AfterPackContext,\n platformSpecificBuildOptions: MacConfiguration | MasConfiguration,\n asarOptions: AsarOptions | null\n ): Promise<void> {\n // nothing to protect without the entries electron-builder computes: a stock Electron Info.plist still lists the removed default_app.asar\n if (asarOptions == null || asarOptions.disableIntegrity) {\n return\n }\n if (platformSpecificBuildOptions.asarIntegrityDigest === false) {\n log.info({ reason: \"asarIntegrityDigest is set to false\" }, \"skipped ASAR integrity digest\")\n return\n }\n const electronVersion = semver.coerce(this.info.framework.version)\n if (electronVersion == null || semver.major(electronVersion) < FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST) {\n return\n }\n if (process.platform !== \"darwin\") {\n log.warn({ reason: \"supported only on macOS, where codesign can sign the modified Electron Framework again\" }, \"skipped ASAR integrity digest\")\n return\n }\n const frameworkName = `${path.basename(this.info.framework.distMacOsAppName, \".app\")} Framework`\n const embedded = await embedAsarIntegrityDigest(path.join(packContext.appOutDir, `${this.appInfo.productFilename}.app`), frameworkName)\n // an afterPack hook that signs the app or changes it in ways the digest must not cover is where this change bites\n if (embedded && this.info.filterPackagerEventListeners(\"afterPack\", \"user\").length > 0) {\n log\n .once(\"asar-integrity-digest-after-afterpack\")\n .warn(\n { solution: \"set mac.asarIntegrityDigest to false if your afterPack hook signs the app\" },\n \"electron-builder v27 embeds the ASAR integrity digest into the Electron Framework after the afterPack hook and signs the framework again ad hoc, replacing a signature applied in afterPack. \" +\n \"Changing app.asar or Info.plist after afterPack now fails the app at launch when the enableEmbeddedAsarIntegrityValidation fuse is on. \" +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#macos-asar-integrity-digest\"\n )\n }\n }\n\n /**\n * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for\n * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.\n */\n private async computeSingleArchFiles(x64AppPath: string, arm64AppPath: string, userPattern: string | undefined): Promise<string | undefined> {\n const unpacked = (appPath: string) => path.join(appPath, \"Contents\", \"Resources\", \"app.asar.unpacked\")\n const x64Unpacked = unpacked(x64AppPath)\n const arm64Unpacked = unpacked(arm64AppPath)\n\n // (1) `cpu`/`os`-declared platform packages confined to one slice — mark the whole package.\n const packageNames = new Set<string>()\n await collectSingleArchPackageNames(path.join(x64Unpacked, \"node_modules\"), packageNames)\n await collectSingleArchPackageNames(path.join(arm64Unpacked, \"node_modules\"), packageNames)\n\n // (2) undeclared host binaries identical in both slices (e.g. `esbuild/bin/esbuild`) — mark the file.\n const machOFiles = await collectIdenticalSingleArchMachOFiles(x64Unpacked, arm64Unpacked)\n\n const patterns = [...Array.from(packageNames).map(name => `**/${name}/**`), ...machOFiles]\n if (patterns.length === 0) {\n return userPattern\n }\n\n log.warn(\n { packages: Array.from(packageNames).sort().join(\", \") || \"(none)\", files: machOFiles.sort().join(\", \") || \"(none)\" },\n \"Universal build contains single-architecture binaries; they are copied as-is per slice (not lipo-merged), so each is only usable on architectures whose platform package was installed on this build host. \" +\n \"If these are build-only tools (e.g. esbuild), move them to `devDependencies` or exclude them via `files` to omit them entirely. \" +\n \"If they are needed at runtime, install every target architecture's variant so the universal app works on both Intel and Apple Silicon (pnpm/yarn: `supportedArchitectures`; npm: `--cpu`/`--os`).\"\n )\n return buildSingleArchFilesPattern(patterns, userPattern)\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n let appPath: string = path.join(targetOutDir, `${this.appInfo.productFilename}.app`)\n if (prepackaged != null) {\n appPath = prepackaged\n } else {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n }\n const signResult = await this.sign(appPath, arch, platformType)\n const signed = isSignResultSigned(signResult)\n\n // The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other\n // emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before\n // the .pkg installer is built, and warn when signing was skipped (#9997).\n const packContext: AfterPackContext = {\n appOutDir: path.dirname(appPath),\n outDir: resolvedOutDir,\n arch,\n targets: [target],\n packager: this,\n electronPlatformName: platformConfig.platformName,\n }\n if (signed) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (await this.info.shouldSkipTargetsAfterPack(packContext)) {\n continue\n }\n\n // A development-signed build (mas-dev, or an explicit sign.type \"development\" — see\n // MacTargetHelper.shouldCreateMasInstaller) produces no installer\n const masSignConfig = platformConfig.config.sign\n const masSignOpts = isElectronSignOptions(masSignConfig) ? masSignConfig : undefined\n if (signed && MacTargetHelper.shouldCreateMasInstaller(platformType, masSignOpts?.type)) {\n await this.createMasInstaller(appPath, targetOutDir, arch, platformType)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (\n await this.info.shouldSkipTargetsAfterPack({\n appOutDir: path.dirname(appPath),\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: this.platform.nodeName,\n })\n ) {\n return\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n /**\n * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`\n * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).\n */\n protected async createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: MasPlatformType): Promise<void> {\n const config = this.getPlatformConfig(targetPlatform).config\n const signConfig = config.sign\n const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, targetPlatform, arch, signOpts?.identity)\n }\n\n /**\n * Main signing method with platform awareness. Protected so tests can stub signing\n * (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.\n */\n protected async sign(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<SigningResult> {\n if (!isSignAllowed()) {\n // non-mac host, or the pull-request CI guard — signing cannot happen in this environment\n return \"skipped:unsupported\"\n }\n\n // getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.\n const config = this.getPlatformConfig(targetPlatform).config.sign\n\n // sign: null → user explicitly disabled signing\n if (config === null) {\n return this.helper.handleNullIdentity()\n }\n\n const signOpts = isElectronSignOptions(config) ? config : undefined\n // sign.identity: null → explicit skip; undefined → auto-discover\n const qualifier = signOpts?.identity\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n // `config` is a custom fn/string module path when it's non-null and not an options object\n const hasCustomSign = config != null && !signOpts\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n\n const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts)\n\n if (!identity) {\n return \"skipped:no-certificate\"\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform, hasCustomSign)\n await this.doSign(signOptions, config, identity)\n\n // now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would\n // fail library validation at launch — the case the old blanket entitlements default used to mask\n if (!hasCustomSign) {\n await this.helper.warnAboutForeignSignedBinaries(appPath, identity, targetPlatform, signOpts)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return hasCustomSign ? \"signed:custom\" : \"signed\"\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, signConfig: MacConfiguration[\"sign\"], identity: Identity | null): Promise<void> {\n // Resolve a custom signer only when signConfig is a function or string module path.\n // ElectronSignOptions objects and undefined use @electron/osx-sign directly.\n const customSign =\n signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n // `opts.identity` is resolved once, in MacTargetHelper.resolveSignIdentity — never re-derive it here, or a\n // custom signer and @electron/osx-sign end up signing with different forms of the same certificate\n return customSign ? Promise.resolve(customSign(opts, this)) : sign(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void> {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name. The product name is used verbatim (it is validated in `prepareAppInfo` to\n // require no filename sanitization), so `CFBundleName` matches the on-disk helper bundle names\n // that Electron resolves as `${CFBundleName} Helper.app`.\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n // const activeOpts = this.getPlatformConfig(distType).config\n appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<SigningResult> {\n const targetPlatform: PlatformType = platformType ?? (packContext.electronPlatformName === \"mas\" ? \"mas\" : \"mac\")\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<Array<SigningResult>> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n return await Promise.all(\n directories\n .filter(file => shouldSign(file))\n .map(async (file: string) => {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n return await this.sign(safeSignTarget, packContext.arch, targetPlatform)\n })\n )\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n // the combined result gates the `afterSign` hook — a signed result wins (see PlatformPackager.doSignAfterPack)\n const results = await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return combineSignResults(results)\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n results.push(...(await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))))\n\n return combineSignResults(results)\n }\n}\n"]}
@@ -69,6 +69,10 @@ export interface FuseOptionsV1 extends Partial<Record<Uncapitalize<keyof typeof
69
69
  * For this fuse to be meaningful, `asar.disableIntegrity` must **not** be
70
70
  * `true` (otherwise the hash is not embedded).
71
71
  *
72
+ * On macOS with Electron ≥ 41, electron-builder also embeds a digest of the `Info.plist` hashes
73
+ * into the Electron Framework (see `mac.asarIntegrityDigest`), so they cannot be changed to match
74
+ * a modified `app.asar` either.
75
+ *
72
76
  * @see https://www.electronjs.org/docs/latest/tutorial/asar-integrity
73
77
  */
74
78
  enableEmbeddedAsarIntegrityValidation?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"FuseOptionsV1.d.ts","sourceRoot":"","sources":["../../src/options/FuseOptionsV1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,aAAc,SAAQ,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,MAA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AAC,MAAM,OAAO,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;IACvG;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAEhC;;;;;;;;OAQG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAA;IAE9C;;;;;;;;OAQG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAA;IAEvC;;;;;;;;;;;;;;;;OAgBG;IACH,qCAAqC,CAAC,EAAE,OAAO,CAAA;IAE/C;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;;;;;;OAQG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAA;IAE9C;;;;;;;;;;;;OAYG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAA;IAE1C;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;;;;;;OAOG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAID,KAAK,WAAW,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAA;AACpC,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAChD;IAAC,OAAO,CAAC,YAAY,CAAC,MAAM,OAAO,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC;CAAC,SAAS,CAAC,KAAK,CAAC,GACpF,IAAI,GACJ,CAAC,wEAAwE,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,OAAO,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC,CACvJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"FuseOptionsV1.js","sourceRoot":"","sources":["../../src/options/FuseOptionsV1.ts"],"names":[],"mappings":"","sourcesContent":["import type { FuseV1Options } from \"@electron/fuses\"\n\n/**\n * Feature flags (\"fuses\") baked into the Electron binary at build time.\n *\n * All options map 1:1 to the flags documented by\n * [`@electron/fuses`](https://github.com/electron/fuses) and the upstream\n * [Electron fuses guide](https://www.electronjs.org/docs/latest/tutorial/fuses).\n *\n * electron-builder flips fuses after packaging and **before** signing so that the final\n * code signature covers the modified binary. On Apple Silicon, the ad-hoc signature is\n * re-applied automatically after flipping fuses.\n */\n\nexport interface FuseOptionsV1 extends Partial<Record<Uncapitalize<keyof typeof FuseV1Options>, boolean>> {\n /**\n * Controls whether the `ELECTRON_RUN_AS_NODE` environment variable is respected.\n *\n * When `true` (the Electron default), setting `ELECTRON_RUN_AS_NODE=1` in the environment\n * makes Electron behave like a plain Node.js process, bypassing the app entirely. Disable\n * this fuse in production apps to prevent that escape path.\n *\n * **Note:** Disabling this fuse also breaks `process.fork()` in the main process because\n * it relies on `ELECTRON_RUN_AS_NODE` internally. Use\n * [Utility Processes](https://www.electronjs.org/docs/latest/api/utility-process) as a\n * replacement.\n *\n * @see https://github.com/electron/fuses\n */\n runAsNode?: boolean\n\n /**\n * Controls whether the Chromium cookie store is encrypted using OS-level cryptography keys.\n *\n * When enabled, cookies are stored encrypted on disk (the same mechanism Chrome uses).\n * **This is a one-way transition**: existing unencrypted cookies are re-encrypted on write, but\n * disabling the fuse afterwards will leave the cookie database unreadable.\n *\n * Most production apps can safely enable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableCookieEncryption?: boolean\n\n /**\n * Controls whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions)\n * and `NODE_EXTRA_CA_CERTS` environment variables are respected.\n *\n * `NODE_OPTIONS` allows injecting arbitrary Node.js runtime flags (e.g. `--require`) and is\n * rarely needed in production. Most apps can safely disable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n\n /**\n * Controls whether the `--inspect`, `--inspect-brk`, and related Node.js debugger flags are\n * honoured.\n *\n * When disabled, `SIGUSR1` no longer opens the V8 inspector in the main process either.\n * Most production apps can safely disable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableNodeCliInspectArguments?: boolean\n\n /**\n * Enables ASAR integrity validation — Electron verifies the embedded SHA-256 hash of\n * `app.asar` before loading it.\n *\n * Platform support:\n * - macOS: Electron ≥ 16.0.0\n * - Windows: Electron ≥ 30.0.0\n *\n * For this fuse to be meaningful, `asar.disableIntegrity` must **not** be\n * `true` (otherwise the hash is not embedded).\n *\n * @see https://www.electronjs.org/docs/latest/tutorial/asar-integrity\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n\n /**\n * When enabled, Electron searches for the app exclusively in `app.asar`, skipping the `app`\n * directory and `default_app.asar` fallbacks.\n *\n * Combined with `enableEmbeddedAsarIntegrityValidation`, this makes it impossible to side-load\n * unverified code by replacing `app.asar` with an unarchived `app/` directory.\n *\n * @see https://github.com/electron/fuses\n */\n onlyLoadAppFromAsar?: boolean\n\n /**\n * When enabled, the browser (main) process uses a separate V8 snapshot file\n * (`browser_v8_context_snapshot.bin`) instead of the shared one.\n *\n * This is only useful when you ship a custom V8 snapshot for the main process that differs\n * from the renderer snapshot. Standard apps do not need this.\n *\n * @see https://github.com/electron/fuses\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n\n /**\n * Controls whether pages loaded from the `file://` protocol receive elevated privileges\n * beyond what a standard web browser would grant.\n *\n * These extra privileges include `fetch` to other `file://` URLs, service workers, and\n * universal frame access for child frames also on `file://`. This behaviour pre-dates modern\n * Electron security best practices.\n *\n * Disable this fuse if your app does not load content directly from `file://` (i.e. you use\n * a [custom protocol](https://www.electronjs.org/docs/latest/tutorial/security#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols)).\n *\n * @see https://github.com/electron/fuses\n */\n grantFileProtocolExtraPrivileges?: boolean\n\n /**\n * Enables V8 signal-based trap handlers for out-of-bounds WebAssembly memory accesses.\n *\n * When enabled, Electron uses OS signals (e.g. `SIGSEGV` on Linux/macOS) to catch Wasm\n * OOB accesses at the hardware level rather than inserting explicit bounds checks in JIT'd\n * code. This improves Wasm performance and is enabled by default in Electron.\n *\n * Disable only if the host environment restricts signal handlers (e.g. certain sandboxing\n * configurations) and you observe crashes in Wasm-heavy workloads.\n *\n * @see https://github.com/electron/fuses\n */\n wasmTrapHandlers?: boolean\n\n /**\n * Re-applies the ad-hoc codesignature on macOS after fuses are flipped.\n *\n * electron-builder already re-signs the app after flipping fuses, so this flag is\n * generally not needed and exists only as a compatibility shim for edge cases.\n *\n * @see https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n// Compile-time exhaustiveness guard (no runtime output — pure type).\n// When @electron/fuses adds a new FuseV1Options entry, the Exclude below becomes non-never,\n// the conditional resolves to the tuple, and TypeScript errors with the name of the missing key(s).\ntype _AssertTrue<T extends true> = T\nexport type _FuseOptionsV1Exhaustive = _AssertTrue<\n [Exclude<Uncapitalize<keyof typeof FuseV1Options>, keyof FuseOptionsV1>] extends [never]\n ? true\n : [\"FuseOptionsV1 is missing documented key(s) — add them with JSDoc above\", Exclude<Uncapitalize<keyof typeof FuseV1Options>, keyof FuseOptionsV1>]\n>\n"]}
1
+ {"version":3,"file":"FuseOptionsV1.js","sourceRoot":"","sources":["../../src/options/FuseOptionsV1.ts"],"names":[],"mappings":"","sourcesContent":["import type { FuseV1Options } from \"@electron/fuses\"\n\n/**\n * Feature flags (\"fuses\") baked into the Electron binary at build time.\n *\n * All options map 1:1 to the flags documented by\n * [`@electron/fuses`](https://github.com/electron/fuses) and the upstream\n * [Electron fuses guide](https://www.electronjs.org/docs/latest/tutorial/fuses).\n *\n * electron-builder flips fuses after packaging and **before** signing so that the final\n * code signature covers the modified binary. On Apple Silicon, the ad-hoc signature is\n * re-applied automatically after flipping fuses.\n */\n\nexport interface FuseOptionsV1 extends Partial<Record<Uncapitalize<keyof typeof FuseV1Options>, boolean>> {\n /**\n * Controls whether the `ELECTRON_RUN_AS_NODE` environment variable is respected.\n *\n * When `true` (the Electron default), setting `ELECTRON_RUN_AS_NODE=1` in the environment\n * makes Electron behave like a plain Node.js process, bypassing the app entirely. Disable\n * this fuse in production apps to prevent that escape path.\n *\n * **Note:** Disabling this fuse also breaks `process.fork()` in the main process because\n * it relies on `ELECTRON_RUN_AS_NODE` internally. Use\n * [Utility Processes](https://www.electronjs.org/docs/latest/api/utility-process) as a\n * replacement.\n *\n * @see https://github.com/electron/fuses\n */\n runAsNode?: boolean\n\n /**\n * Controls whether the Chromium cookie store is encrypted using OS-level cryptography keys.\n *\n * When enabled, cookies are stored encrypted on disk (the same mechanism Chrome uses).\n * **This is a one-way transition**: existing unencrypted cookies are re-encrypted on write, but\n * disabling the fuse afterwards will leave the cookie database unreadable.\n *\n * Most production apps can safely enable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableCookieEncryption?: boolean\n\n /**\n * Controls whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions)\n * and `NODE_EXTRA_CA_CERTS` environment variables are respected.\n *\n * `NODE_OPTIONS` allows injecting arbitrary Node.js runtime flags (e.g. `--require`) and is\n * rarely needed in production. Most apps can safely disable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n\n /**\n * Controls whether the `--inspect`, `--inspect-brk`, and related Node.js debugger flags are\n * honoured.\n *\n * When disabled, `SIGUSR1` no longer opens the V8 inspector in the main process either.\n * Most production apps can safely disable this fuse.\n *\n * @see https://github.com/electron/fuses\n */\n enableNodeCliInspectArguments?: boolean\n\n /**\n * Enables ASAR integrity validation — Electron verifies the embedded SHA-256 hash of\n * `app.asar` before loading it.\n *\n * Platform support:\n * - macOS: Electron ≥ 16.0.0\n * - Windows: Electron ≥ 30.0.0\n *\n * For this fuse to be meaningful, `asar.disableIntegrity` must **not** be\n * `true` (otherwise the hash is not embedded).\n *\n * On macOS with Electron ≥ 41, electron-builder also embeds a digest of the `Info.plist` hashes\n * into the Electron Framework (see `mac.asarIntegrityDigest`), so they cannot be changed to match\n * a modified `app.asar` either.\n *\n * @see https://www.electronjs.org/docs/latest/tutorial/asar-integrity\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n\n /**\n * When enabled, Electron searches for the app exclusively in `app.asar`, skipping the `app`\n * directory and `default_app.asar` fallbacks.\n *\n * Combined with `enableEmbeddedAsarIntegrityValidation`, this makes it impossible to side-load\n * unverified code by replacing `app.asar` with an unarchived `app/` directory.\n *\n * @see https://github.com/electron/fuses\n */\n onlyLoadAppFromAsar?: boolean\n\n /**\n * When enabled, the browser (main) process uses a separate V8 snapshot file\n * (`browser_v8_context_snapshot.bin`) instead of the shared one.\n *\n * This is only useful when you ship a custom V8 snapshot for the main process that differs\n * from the renderer snapshot. Standard apps do not need this.\n *\n * @see https://github.com/electron/fuses\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n\n /**\n * Controls whether pages loaded from the `file://` protocol receive elevated privileges\n * beyond what a standard web browser would grant.\n *\n * These extra privileges include `fetch` to other `file://` URLs, service workers, and\n * universal frame access for child frames also on `file://`. This behaviour pre-dates modern\n * Electron security best practices.\n *\n * Disable this fuse if your app does not load content directly from `file://` (i.e. you use\n * a [custom protocol](https://www.electronjs.org/docs/latest/tutorial/security#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols)).\n *\n * @see https://github.com/electron/fuses\n */\n grantFileProtocolExtraPrivileges?: boolean\n\n /**\n * Enables V8 signal-based trap handlers for out-of-bounds WebAssembly memory accesses.\n *\n * When enabled, Electron uses OS signals (e.g. `SIGSEGV` on Linux/macOS) to catch Wasm\n * OOB accesses at the hardware level rather than inserting explicit bounds checks in JIT'd\n * code. This improves Wasm performance and is enabled by default in Electron.\n *\n * Disable only if the host environment restricts signal handlers (e.g. certain sandboxing\n * configurations) and you observe crashes in Wasm-heavy workloads.\n *\n * @see https://github.com/electron/fuses\n */\n wasmTrapHandlers?: boolean\n\n /**\n * Re-applies the ad-hoc codesignature on macOS after fuses are flipped.\n *\n * electron-builder already re-signs the app after flipping fuses, so this flag is\n * generally not needed and exists only as a compatibility shim for edge cases.\n *\n * @see https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n// Compile-time exhaustiveness guard (no runtime output — pure type).\n// When @electron/fuses adds a new FuseV1Options entry, the Exclude below becomes non-never,\n// the conditional resolves to the tuple, and TypeScript errors with the name of the missing key(s).\ntype _AssertTrue<T extends true> = T\nexport type _FuseOptionsV1Exhaustive = _AssertTrue<\n [Exclude<Uncapitalize<keyof typeof FuseV1Options>, keyof FuseOptionsV1>] extends [never]\n ? true\n : [\"FuseOptionsV1 is missing documented key(s) — add them with JSDoc above\", Exclude<Uncapitalize<keyof typeof FuseV1Options>, keyof FuseOptionsV1>]\n>\n"]}