app-builder-lib 27.0.0-alpha.6 → 27.0.0-alpha.8

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 (143) hide show
  1. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  2. package/dist/codeSign/mac/macCodeSign.js +6 -4
  3. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  4. package/dist/codeSign/signResult.d.ts +26 -0
  5. package/dist/codeSign/signResult.d.ts.map +1 -0
  6. package/dist/codeSign/signResult.js +12 -0
  7. package/dist/codeSign/signResult.js.map +1 -0
  8. package/dist/codeSign/win/signManager.d.ts +2 -1
  9. package/dist/codeSign/win/signManager.d.ts.map +1 -1
  10. package/dist/codeSign/win/signManager.js.map +1 -1
  11. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +25 -1
  12. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  13. package/dist/codeSign/win/signtoolBaseSignManager.js +74 -3
  14. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  15. package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
  16. package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
  17. package/dist/codeSign/win/windowsCodeSign.js +16 -7
  18. package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
  19. package/dist/codeSign/win/windowsSignAzureManager.d.ts +2 -1
  20. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  21. package/dist/codeSign/win/windowsSignAzureManager.js +2 -2
  22. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  23. package/dist/configuration.d.ts +56 -8
  24. package/dist/configuration.d.ts.map +1 -1
  25. package/dist/configuration.js.map +1 -1
  26. package/dist/core.d.ts +5 -0
  27. package/dist/core.d.ts.map +1 -1
  28. package/dist/core.js.map +1 -1
  29. package/dist/fileMatcher.d.ts +15 -0
  30. package/dist/fileMatcher.d.ts.map +1 -1
  31. package/dist/fileMatcher.js +42 -2
  32. package/dist/fileMatcher.js.map +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +1 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/indexInternal.d.ts +2 -1
  38. package/dist/indexInternal.d.ts.map +1 -1
  39. package/dist/indexInternal.js +2 -1
  40. package/dist/indexInternal.js.map +1 -1
  41. package/dist/macPackager.d.ts +16 -8
  42. package/dist/macPackager.d.ts.map +1 -1
  43. package/dist/macPackager.js +59 -32
  44. package/dist/macPackager.js.map +1 -1
  45. package/dist/node-module-collector/nodeModulesCollector.d.ts +11 -1
  46. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  47. package/dist/node-module-collector/nodeModulesCollector.js +28 -5
  48. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  49. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  50. package/dist/node-module-collector/pnpmNodeModulesCollector.js +3 -1
  51. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  52. package/dist/options/PlatformSpecificBuildOptions.d.ts +2 -2
  53. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  54. package/dist/options/SnapOptions.d.ts +8 -4
  55. package/dist/options/SnapOptions.d.ts.map +1 -1
  56. package/dist/options/SnapOptions.js.map +1 -1
  57. package/dist/options/linuxOptions.d.ts +8 -2
  58. package/dist/options/linuxOptions.d.ts.map +1 -1
  59. package/dist/options/linuxOptions.js.map +1 -1
  60. package/dist/options/macOptions.d.ts +18 -8
  61. package/dist/options/macOptions.d.ts.map +1 -1
  62. package/dist/options/macOptions.js.map +1 -1
  63. package/dist/options/pkgOptions.d.ts +1 -1
  64. package/dist/options/pkgOptions.js.map +1 -1
  65. package/dist/options/winOptions.d.ts +8 -7
  66. package/dist/options/winOptions.d.ts.map +1 -1
  67. package/dist/options/winOptions.js.map +1 -1
  68. package/dist/packager.d.ts.map +1 -1
  69. package/dist/packager.js +6 -3
  70. package/dist/packager.js.map +1 -1
  71. package/dist/platformPackager.d.ts +2 -1
  72. package/dist/platformPackager.d.ts.map +1 -1
  73. package/dist/platformPackager.js +5 -3
  74. package/dist/platformPackager.js.map +1 -1
  75. package/dist/publish/PublishManager.js +37 -0
  76. package/dist/publish/PublishManager.js.map +1 -1
  77. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  78. package/dist/publish/updateInfoBuilder.js +9 -5
  79. package/dist/publish/updateInfoBuilder.js.map +1 -1
  80. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  81. package/dist/targets/linux/FlatpakTarget.js +4 -1
  82. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  83. package/dist/targets/linux/FpmTarget.d.ts +7 -0
  84. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  85. package/dist/targets/linux/FpmTarget.js +29 -2
  86. package/dist/targets/linux/FpmTarget.js.map +1 -1
  87. package/dist/targets/linux/appimage/appImageUtil.d.ts +1 -1
  88. package/dist/targets/linux/appimage/appImageUtil.js +3 -3
  89. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  90. package/dist/targets/linux/snap/core24.d.ts +27 -0
  91. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  92. package/dist/targets/linux/snap/core24.js +92 -57
  93. package/dist/targets/linux/snap/core24.js.map +1 -1
  94. package/dist/targets/mac/MacTargetHelper.d.ts +16 -4
  95. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  96. package/dist/targets/mac/MacTargetHelper.js +23 -14
  97. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  98. package/dist/targets/mac/pkg.js +1 -1
  99. package/dist/targets/mac/pkg.js.map +1 -1
  100. package/dist/targets/win/MsiTarget.js +2 -2
  101. package/dist/targets/win/MsiTarget.js.map +1 -1
  102. package/dist/toolsets/7zip.d.ts +32 -0
  103. package/dist/toolsets/7zip.d.ts.map +1 -1
  104. package/dist/toolsets/7zip.js +39 -13
  105. package/dist/toolsets/7zip.js.map +1 -1
  106. package/dist/toolsets/custom.js +4 -2
  107. package/dist/toolsets/custom.js.map +1 -1
  108. package/dist/toolsets/icons.d.ts.map +1 -1
  109. package/dist/toolsets/icons.js +4 -1
  110. package/dist/toolsets/icons.js.map +1 -1
  111. package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
  112. package/dist/toolsets/linuxToolsMac.js +15 -5
  113. package/dist/toolsets/linuxToolsMac.js.map +1 -1
  114. package/dist/util/appFileCopier.d.ts.map +1 -1
  115. package/dist/util/appFileCopier.js +63 -2
  116. package/dist/util/appFileCopier.js.map +1 -1
  117. package/dist/util/electronGet.d.ts +16 -0
  118. package/dist/util/electronGet.d.ts.map +1 -1
  119. package/dist/util/electronGet.js +153 -10
  120. package/dist/util/electronGet.js.map +1 -1
  121. package/dist/util/installOrRebuild.d.ts +6 -0
  122. package/dist/util/installOrRebuild.d.ts.map +1 -1
  123. package/dist/util/installOrRebuild.js +47 -0
  124. package/dist/util/installOrRebuild.js.map +1 -1
  125. package/dist/util/packageMetadata.js +46 -21
  126. package/dist/util/packageMetadata.js.map +1 -1
  127. package/dist/util/repositoryInfo.js +6 -3
  128. package/dist/util/repositoryInfo.js.map +1 -1
  129. package/dist/version.d.ts +1 -1
  130. package/dist/version.js +1 -1
  131. package/dist/version.js.map +1 -1
  132. package/dist/winPackager.d.ts +4 -3
  133. package/dist/winPackager.d.ts.map +1 -1
  134. package/dist/winPackager.js +22 -16
  135. package/dist/winPackager.js.map +1 -1
  136. package/package.json +10 -10
  137. package/scheme.json +63 -35
  138. package/templates/nsis/common.nsh +2 -2
  139. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +68 -4
  140. package/templates/nsis/include/extractAppPackage.nsh +1 -1
  141. package/templates/nsis/include/installUtil.nsh +2 -2
  142. package/templates/nsis/include/installer.nsh +1 -1
  143. package/templates/nsis/installer.nsi +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"core24.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/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C,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;IACzG,CAAC;IAEO,uBAAuB,CAAC,KAAsC;QACpE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,KAAK,CAAA;QACd,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,IAAI,IAAI,EAAE,SAAS,KAAK,iBAAiB,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC5E,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAI,KAAoB,EAAE,QAAa;QAClE,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;YAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACnD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA;YAC1B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/C,CAAC;CACF","sourcesContent":["import { Arch, archFromString, copyDir, InvalidConfigurationError, log, removeNullish, toLinuxArchString } from \"builder-util\"\n\nimport { deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport * as yaml from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SlotDescriptor, SnapOptions24 } from \"../../../options/SnapOptions.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { buildSnapCommandLauncherScript } from \"./snapCommand.js\"\nimport { App, Part, SnapcraftYAML } from \"./snapcraft.js\"\nimport { buildSnap, DEFAULT_STAGE_PACKAGES, SNAPCRAFT_YAML_OPTIONS } from \"./snapcraftBuilder.js\"\nconst { chmod, copy, mkdir, readdir, remove, writeFile } = _fsExtra\n\n// Electron's setuid sandbox helper. Removed from the staged app when the snap runs with\n// `--no-sandbox` (snap confinement supplies its own sandbox via the browser-support interface).\nconst CHROME_SANDBOX = \"chrome-sandbox\"\n// Launcher script name used when the app command cannot be expressed inline (see resolveSnapCommand).\nconst SNAP_COMMAND_LAUNCHER = \"command.sh\"\n\n/** Snap build strategy for core24 — generates a native snapcraft.yaml and invokes the snapcraft CLI. */\nexport class SnapCore24 extends SnapCore<SnapOptions24> {\n // browser-support is intentionally absent here; it is auto-injected in mapSnapOptionsToSnapcraftYAML\n // when the user has not provided custom plugs, so it always lands in both root plugs and app plugs.\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n // Snap file hierarchy:\n // - snap/gui/ gets automatically copied to meta/gui/ in the final snap\n // - Desktop files in meta/gui/ are used for menu integration\n readonly configRelativePath = \"snap\"\n readonly guiRelativePath = path.join(this.configRelativePath, \"gui\")\n\n // Computed in createDescriptor (mapSnapOptionsToSnapcraftYAML) and consumed in buildSnap.\n // getSnapCore() returns a fresh SnapCore24 per arch build, so this per-instance state is\n // never shared across builds.\n private removeChromeSandbox = false\n // Args embedded into the generated launcher script (executableArgs + forceX11/no-sandbox flags).\n private commandArgs: string[] = []\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n return await this.mapSnapOptionsToSnapcraftYAML(arch)\n }\n\n private isHostMode(): boolean {\n return this.options.useDestructiveMode === true\n }\n\n /** Writes the snapcraft.yaml, stages app files, then invokes `buildSnap()` to run the actual snapcraft build. */\n async buildSnap(params: { snap: SnapcraftYAML; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, artifactPath } = params\n\n const snapDirResolved = path.resolve(stageDir, this.configRelativePath)\n const snapcraftYamlPath = path.join(snapDirResolved, \"snapcraft.yaml\")\n\n // Create snap/gui directory for desktop files and icons\n // Snapcraft will automatically copy snap/gui/ contents to meta/gui/ in the final snap\n const guiOutput = path.resolve(stageDir, this.guiRelativePath)\n await mkdir(guiOutput, { recursive: true })\n\n const yamlContent = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, yamlContent, \"utf8\")\n log.debug(snap, \"generated snapcraft.yaml\")\n\n // Copy icon to snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopExtraProps: Record<string, string> = {}\n const icon = this.helper.maxIconPath\n if (icon) {\n const iconFileName = `${snap.name}${path.extname(icon)}`\n await copy(icon, path.join(guiOutput, iconFileName))\n // Icon path will be available at ${SNAP}/meta/gui/<icon-file> after installation\n desktopExtraProps.Icon = `\\${SNAP}/meta/gui/${iconFileName}`\n }\n\n // Create desktop file in snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopFilePath = path.join(guiOutput, `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFilePath, desktopExtraProps)\n\n // Copy app files to the project root `app` directory so `source: app`\n // in the generated `snapcraft.yaml` (which is under `snap/`) can be\n // resolved by snapcraft running in the build environment.\n const appDir = path.resolve(stageDir, \"app\")\n if (path.resolve(appDir) !== path.resolve(appOutDir)) {\n log.debug({ to: log.filePath(appDir), from: log.filePath(appOutDir) }, \"copying app files to project root app directory\")\n await copyDir(appOutDir, appDir)\n }\n\n // Drop the setuid chrome-sandbox helper before snapcraft stages the app — it is unusable under\n // strict confinement when launching with --no-sandbox (mirrors SnapCoreLegacy).\n if (this.removeChromeSandbox) {\n await remove(path.join(appDir, CHROME_SANDBOX))\n }\n\n // Write the launcher script the command always points at (see SNAP_COMMAND_LAUNCHER).\n // It lands at the snap root ($SNAP/command.sh) — it is intentionally not added to `organize`.\n const launcherPath = path.join(appDir, SNAP_COMMAND_LAUNCHER)\n await writeFile(launcherPath, buildSnapCommandLauncherScript({ execName: this.packager.executableName, args: this.commandArgs }), { mode: 0o755 })\n await chmod(launcherPath, 0o755)\n\n // Auto-generate `organize` mapping for the app part so top-level helper\n // binaries and resources are placed under `app/` inside the snap. Update\n // the already-written `snapcraft.yaml` so the build sees the mapping.\n try {\n const appPart = snap.parts[snap.name]\n if (appPart) {\n const entries = (await readdir(appOutDir)).sort()\n // Null-prototype map: entry names come from the filesystem, so a top-level file named\n // \"__proto__\" / \"constructor\" / \"toString\" must not read inherited keys (which would make\n // the membership check below skip it) or interact with Object.prototype on assignment.\n const organize: Record<string, string> = Object.assign(Object.create(null), appPart.organize)\n for (const entry of entries) {\n if (!entry) {\n continue\n }\n // Skip files no longer present in the staged app dir (e.g. removed chrome-sandbox) so\n // snapcraft doesn't fail trying to organize a missing source.\n if (this.removeChromeSandbox && entry === CHROME_SANDBOX) {\n continue\n }\n // Never organize the launcher under app/. It must stay at the snap root ($SNAP/command.sh)\n // to match apps.<name>.command. This matters when appOutDir === appDir, where readdir\n // would otherwise pick up the launcher we just wrote.\n if (entry === SNAP_COMMAND_LAUNCHER) {\n continue\n }\n if (organize[entry]) {\n continue\n }\n organize[entry] = `app/${entry}`\n }\n appPart.organize = organize\n\n const updatedYaml = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, updatedYaml, \"utf8\")\n log.debug({ organize }, \"updated snapcraft.yaml with organize mapping\")\n }\n } catch (e: any) {\n log.warn({ error: e.message }, \"failed to generate and update organize mapping\")\n }\n\n const buildMode = {\n useLXD: this.options.useLXD === true,\n useMultipass: this.options.useMultipass === true,\n useDestructiveMode: this.options.useDestructiveMode === true,\n remoteBuild: this.options.remoteBuild || undefined,\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null) {\n const shouldSkip = await this.packager.packagerOptions.effectiveOptionComputed({ snap, ...buildMode })\n if (shouldSkip) {\n return [artifactPath]\n }\n }\n\n const rootOptions = this.packager.config.snapcraft\n const snaps = await buildSnap({\n snapcraftConfig: snap,\n artifactPath,\n stageDir,\n packager: this.packager,\n cscLink: rootOptions?.cscLink,\n ...buildMode,\n })\n return snaps\n }\n\n /** Converts `SnapOptions24` into a fully resolved `SnapcraftYAML` descriptor for the given architecture. */\n async mapSnapOptionsToSnapcraftYAML(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const appName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n // Default to [\"gnome\"] in normal builds; no extensions in host/destructive-mode (where the\n // gnome extension is incompatible). Throw if the user explicitly includes \"gnome\" in host mode.\n const hostMode = this.isHostMode()\n const extensionsList: string[] = options.extensions != null ? [...options.extensions] : hostMode ? [] : [\"gnome\"]\n if (hostMode && extensionsList.includes(\"gnome\")) {\n throw new InvalidConfigurationError(\n `The \"gnome\" snapcraft extension is incompatible with host/destructive-mode builds.\\n` +\n `In this mode snapcraft cannot resolve the extension's command-chain source ` +\n `(/usr/share/snapcraft/extensions/desktop/command-chain) and will fail.\\n\\n` +\n `To resolve this, choose one of:\\n` +\n ` 1. Remove \"gnome\" from snapcraft.core24.extensions (or set it to []) and add any\\n` +\n ` required stage-packages manually.\\n` +\n ` 2. Switch to an isolated build environment by setting snapcraft.core24.useLXD: true\\n` +\n ` or snapcraft.core24.useMultipass: true instead of useDestructiveMode.\\n\\n` +\n `See: https://snapcraft.io/docs/gnome-extension`\n )\n }\n const resolvedExtensions = extensionsList.length > 0 ? extensionsList : undefined\n const useGnomeExtension = extensionsList.includes(\"gnome\")\n\n // Create the app part\n const appPart: Part = {\n plugin: \"dump\",\n source: \"app\",\n \"build-packages\": options.buildPackages?.length ? options.buildPackages : undefined,\n \"stage-packages\": this.expandDefaultsInArray(options.stagePackages, DEFAULT_STAGE_PACKAGES),\n after: this.expandDefaultsInArray(options.after, []),\n stage: options.appPartStage?.length ? options.appPartStage : undefined,\n }\n\n // Process plugs and slots\n // When using GNOME extension, we don't need to manually configure content snaps\n // The extension will handle: gnome-46-2404, gtk-3-themes, icon-themes, sound-themes\n let rootPlugs: Record<string, any> | undefined\n let appPlugs: string[] | undefined\n\n if (useGnomeExtension) {\n // With GNOME extension, only process user-provided custom plugs\n const result = options.plugs ? this.processPlugOrSlots(options.plugs) : { root: undefined, app: undefined }\n rootPlugs = result.root\n // Extension automatically adds common plugs, so we only add custom ones\n appPlugs = result.app\n } else {\n // Without GNOME extension, we need manual content snaps\n const defaultRootPlugs: Record<string, any> = {\n \"gtk-3-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/themes\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"icon-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/icons\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"sound-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/sounds\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"gnome-46-2404\": {\n interface: \"content\",\n target: \"$SNAP/gnome-platform\",\n \"default-provider\": \"gnome-46-2404\",\n },\n \"gpu-2404\": {\n interface: \"content\",\n target: \"$SNAP/gpu-2404\",\n \"default-provider\": \"mesa-2404\",\n },\n }\n\n const result = options.plugs\n ? this.processPlugOrSlots(options.plugs)\n : hostMode\n ? { root: undefined, app: this.defaultPlugs }\n : {\n root: defaultRootPlugs,\n app: this.defaultPlugs,\n }\n rootPlugs = result.root\n appPlugs = result.app\n }\n\n // Always add browser-support with allow-sandbox so Chromium's internal sandbox\n // can create user namespaces under strict confinement. Without allow-sandbox: true\n // the app crashes immediately with \"FATAL: Permission denied (13)\" in credentials.cc.\n // Skip the injection only when the user has explicitly provided their own plugs\n // (they are responsible for including browser-support in that case).\n if (!options.plugs) {\n rootPlugs = { ...rootPlugs, \"browser-support\": { interface: \"browser-support\", \"allow-sandbox\": true } }\n if (!appPlugs?.includes(\"browser-support\")) {\n appPlugs = [...(appPlugs ?? []), \"browser-support\"]\n }\n }\n\n const { root: rootSlots, app: appSlots } = options.slots ? this.processPlugOrSlots(options.slots) : { root: undefined, app: undefined }\n\n // Build the effective arg list for the snap command.\n // Start with any user-supplied executableArgs, then conditionally add --no-sandbox\n // if browser-support with allow-sandbox:true is not present in the resolved plugs\n // (mirrors the same logic in SnapCoreLegacy.buildSnap).\n const extraArgs: string[] = [...(this.options.executableArgs ?? [])]\n if (this.options.forceX11 === true) {\n if (!extraArgs.includes(\"--ozone-platform=x11\")) {\n extraArgs.push(\"--ozone-platform=x11\")\n }\n }\n const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(rootPlugs)\n if (noSandbox && !extraArgs.includes(\"--no-sandbox\")) {\n extraArgs.push(\"--no-sandbox\")\n }\n // With --no-sandbox the setuid chrome-sandbox helper is unused; strip it from the snap.\n this.removeChromeSandbox = noSandbox\n\n // The command always points at a generated launcher script (written in buildSnap). This keeps a\n // single uniform command path and sidesteps snapd's character/word-splitting rules for the\n // command field (e.g. --ozone-platform=x11, --js-flags=\"...\").\n this.commandArgs = extraArgs\n\n // Create the app configuration\n const desktopBaseName = this.helper.getDesktopFileName(appName)\n const app: App = {\n command: SNAP_COMMAND_LAUNCHER,\n \"command-chain\": undefined, // explicitly undefined so removeNullish strips it; extensions supply their own command-chain\n plugs: appPlugs,\n slots: appSlots,\n autostart: options.autoStart ? `${desktopBaseName}.desktop` : undefined,\n desktop: `meta/gui/${desktopBaseName}.desktop`,\n extensions: resolvedExtensions,\n }\n\n // Icon path — build-time relative path so snapcraft can find the file in snap/gui/\n await this.helper.icons\n const iconPath = this.helper.maxIconPath != null ? `snap/gui/${appName}${path.extname(this.helper.maxIconPath)}` : undefined\n\n // Process hooks if configured\n const hooksConfig = options.hooks\n const hooks = hooksConfig ? await this.processHooks(hooksConfig) : undefined\n\n // Parts configuration - the extension automatically adds a gnome/sdk part\n // Don't manually add desktop-launch when using the extension\n const parts: Record<string, Part> = {\n [appName]: appPart,\n }\n\n // Note: `organize` will be generated later in `buildSnap` based on the\n // actual contents of the built app directory so helper binaries and\n // resources are automatically moved under `app/` in the snap.\n\n // Build the snapcraft configuration\n const snapcraft: SnapcraftYAML = {\n // Required fields\n name: appName,\n base: \"core24\",\n confinement: options.confinement || \"strict\",\n parts: parts,\n\n // Architecture/Platform — only needed for cross-compilation; snapcraft 8\n // defaults to host arch and snapcraft 7 rejects this field entirely.\n ...(arch !== archFromString(process.arch)\n ? {\n platforms: {\n [toLinuxArchString(arch, \"snap\")]: {\n \"build-for\": toLinuxArchString(arch, \"snap\"),\n \"build-on\": toLinuxArchString(archFromString(process.arch), \"snap\"),\n },\n },\n }\n : {}),\n\n // Metadata - with fallbacks from appInfo\n version: appInfo.version,\n summary: options.summary || appInfo.productName,\n description: this.helper.getDescription(options),\n grade: options.grade || \"stable\",\n title: options.title || appInfo.productName,\n icon: iconPath,\n\n // Build configuration\n compression: options.compression || undefined,\n assumes: this.normalizeAssumesList(options.assumes),\n\n // Environment\n environment: this.buildEnvironment(options),\n\n // User-supplied layout always wins. Without gnome extension and not in host mode, fall back to content-snap defaults.\n layout: options.layout ?? (useGnomeExtension || hostMode ? undefined : this.buildDefaultLayout(options)),\n\n // Interfaces\n plugs: rootPlugs,\n slots: rootSlots,\n\n // Hooks\n hooks: hooks,\n\n // Apps\n apps: {\n [appName]: app,\n },\n }\n\n return removeNullish(snapcraft)\n }\n\n /**\n * Build environment variables with proper defaults\n */\n private buildEnvironment(options: SnapOptions24): Record<string, string | null> | undefined {\n const env: Record<string, string | null> = {}\n\n // Add default TMPDIR for Electron/Chromium apps\n if (!options.environment?.TMPDIR) {\n env.TMPDIR = \"$XDG_RUNTIME_DIR\"\n }\n\n if (options.environment) {\n deepAssign(env, options.environment)\n }\n\n return Object.keys(env).length > 0 ? env : undefined\n }\n\n /**\n * Build default layout for core24 with GNOME platform content snaps (non-extension mode)\n * This allows the app to access libraries from the gnome-46-2404 and mesa-2404 content snaps\n */\n private buildDefaultLayout(options: SnapOptions24): Record<string, any> | undefined {\n // If user provides custom layout, use that instead\n if (options.layout) {\n return options.layout\n }\n\n // Default layout for core24 Electron apps using GNOME content snaps WITHOUT extension\n return {\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\",\n },\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\",\n },\n \"/usr/share/xml/iso-codes\": {\n bind: \"$SNAP/gnome-platform/usr/share/xml/iso-codes\",\n },\n \"/usr/share/libdrm\": {\n bind: \"$SNAP/gpu-2404/libdrm\",\n },\n \"/usr/share/drirc.d\": {\n symlink: \"$SNAP/gpu-2404/drirc.d\",\n },\n }\n }\n\n /**\n * Process hooks directory into hook definitions\n */\n private async processHooks(hooksPath: string): Promise<Record<string, any> | undefined> {\n try {\n const buildResourcesDir = this.packager.buildResourcesDir\n const hooksDir = path.resolve(buildResourcesDir, hooksPath)\n if (!hooksDir.startsWith(buildResourcesDir + path.sep) && hooksDir !== buildResourcesDir) {\n throw new InvalidConfigurationError(`snapcraft.core24.hooks must resolve within the build resources directory (got \"${hooksDir}\")`)\n }\n const hookFiles = await readdir(hooksDir)\n\n if (hookFiles.length === 0) {\n return undefined\n }\n\n const hooks: Record<string, any> = {}\n for (const hookFile of hookFiles) {\n const hookName = path.basename(hookFile, path.extname(hookFile))\n if (!isValidKey(hookName)) {\n throw new InvalidConfigurationError(`Invalid hook name: ${hookName}`)\n }\n hooks[hookName] = {\n // Hook definitions will be populated by snapcraft from the files\n // Just register that these hooks exist\n }\n }\n\n return hooks\n } catch (e: any) {\n log.error({ message: e.message }, \"error processing Snap hooks directory\")\n throw e\n }\n }\n\n /**\n * Normalize assumes list (can be string or array)\n */\n normalizeAssumesList(assumes: Array<string> | string | Nullish): string[] | undefined {\n if (!assumes) {\n return undefined\n }\n if (typeof assumes === \"string\") {\n return [assumes]\n }\n return assumes.length > 0 ? assumes : undefined\n }\n\n /**\n * Process plugs or slots into root-level definitions and app-level references\n */\n processPlugOrSlots<T extends Array<string | SlotDescriptor | PlugDescriptor> | SlotDescriptor | PlugDescriptor | null>(\n items: T\n ): {\n root: Record<string, unknown> | undefined\n app: string[] | undefined\n } {\n if (!items || (Array.isArray(items) && items.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, unknown> = {}\n const app: string[] = []\n\n // Handle single descriptor object\n if (!Array.isArray(items)) {\n Object.entries(items).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n return { root, app }\n }\n\n // Handle array - support \"default\" keyword\n const processedItems = this.expandDefaultsInArray(items, this.defaultPlugs)\n for (const item of processedItems ?? []) {\n if (typeof item === \"string\") {\n // Simple string reference\n app.push(item)\n } else {\n // Descriptor object with configuration\n Object.entries(item).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n }\n }\n\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n }\n\n private isBrowserSandboxAllowed(plugs: Record<string, any> | undefined): boolean {\n if (!plugs) {\n return false\n }\n for (const plug of Object.values(plugs)) {\n if (plug?.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n return false\n }\n\n /**\n * Expand \"default\" keyword in arrays of anything\n */\n private expandDefaultsInArray<T>(items: T[] | Nullish, defaults: T[]): T[] | undefined {\n const result: Array<T> = []\n for (const item of items ?? []) {\n if (typeof item === \"string\" && item === \"default\") {\n result.push(...defaults)\n } else {\n result.push(item)\n }\n }\n return result.length > 0 ? result : undefined\n }\n}\n"]}
1
+ {"version":3,"file":"core24.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/core24.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAE9H,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AACtE,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAA;AAEnE,wFAAwF;AACxF,gGAAgG;AAChG,MAAM,cAAc,GAAG,gBAAgB,CAAA;AACvC,sGAAsG;AACtG,MAAM,qBAAqB,GAAG,YAAY,CAAA;AAE1C,wGAAwG;AACxG,MAAM,OAAO,UAAW,SAAQ,QAAuB;IAAvD;;QACE,qGAAqG;QACrG,oGAAoG;QACpG,iBAAY,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;QAElJ,uBAAuB;QACvB,uEAAu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CAAC,EAAE,CAAC;YACxC,IAAI,IAAI,EAAE,SAAS,KAAK,iBAAiB,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC5E,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAI,KAAoB,EAAE,QAAa;QAClE,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;YAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACnD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA;YAC1B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/C,CAAC;CACF","sourcesContent":["import { Arch, archFromString, copyDir, InvalidConfigurationError, log, removeNullish, toLinuxArchString } from \"builder-util\"\n\nimport { deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport * as yaml from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SlotDescriptor, SnapOptions24 } from \"../../../options/SnapOptions.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { buildSnapCommandLauncherScript } from \"./snapCommand.js\"\nimport { App, Part, SnapcraftYAML } from \"./snapcraft.js\"\nimport { buildSnap, DEFAULT_STAGE_PACKAGES, SNAPCRAFT_YAML_OPTIONS } from \"./snapcraftBuilder.js\"\nconst { chmod, copy, mkdir, readdir, remove, writeFile } = _fsExtra\n\n// Electron's setuid sandbox helper. Removed from the staged app when the snap runs with\n// `--no-sandbox` (snap confinement supplies its own sandbox via the browser-support interface).\nconst CHROME_SANDBOX = \"chrome-sandbox\"\n// Launcher script name used when the app command cannot be expressed inline (see resolveSnapCommand).\nconst SNAP_COMMAND_LAUNCHER = \"command.sh\"\n\n/** Snap build strategy for core24 — generates a native snapcraft.yaml and invokes the snapcraft CLI. */\nexport class SnapCore24 extends SnapCore<SnapOptions24> {\n // browser-support is intentionally absent here; it is auto-injected in mapSnapOptionsToSnapcraftYAML\n // when the user has not provided custom plugs, so it always lands in both root plugs and app plugs.\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n // Snap file hierarchy:\n // - snap/gui/ gets automatically copied to meta/gui/ in the final snap\n // - Desktop files in meta/gui/ are used for menu integration\n readonly configRelativePath = \"snap\"\n readonly guiRelativePath = path.join(this.configRelativePath, \"gui\")\n\n // Computed in createDescriptor (mapSnapOptionsToSnapcraftYAML) and consumed in buildSnap.\n // getSnapCore() returns a fresh SnapCore24 per arch build, so this per-instance state is\n // never shared across builds.\n private removeChromeSandbox = false\n // Args embedded into the generated launcher script (executableArgs + forceX11/no-sandbox flags).\n private commandArgs: string[] = []\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n return await this.mapSnapOptionsToSnapcraftYAML(arch)\n }\n\n private isHostMode(): boolean {\n return this.options.useDestructiveMode === true\n }\n\n /** Writes the snapcraft.yaml, stages app files, then invokes `buildSnap()` to run the actual snapcraft build. */\n async buildSnap(params: { snap: SnapcraftYAML; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, artifactPath } = params\n\n const snapDirResolved = path.resolve(stageDir, this.configRelativePath)\n const snapcraftYamlPath = path.join(snapDirResolved, \"snapcraft.yaml\")\n\n // Create snap/gui directory for desktop files and icons\n // Snapcraft will automatically copy snap/gui/ contents to meta/gui/ in the final snap\n const guiOutput = path.resolve(stageDir, this.guiRelativePath)\n await mkdir(guiOutput, { recursive: true })\n\n const yamlContent = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, yamlContent, \"utf8\")\n log.debug(snap, \"generated snapcraft.yaml\")\n\n // Copy icon to snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopExtraProps: Record<string, string> = {}\n const icon = this.helper.maxIconPath\n if (icon) {\n const iconFileName = `${snap.name}${path.extname(icon)}`\n await copy(icon, path.join(guiOutput, iconFileName))\n // Icon path will be available at ${SNAP}/meta/gui/<icon-file> after installation\n desktopExtraProps.Icon = `\\${SNAP}/meta/gui/${iconFileName}`\n }\n\n // Create desktop file in snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopFilePath = path.join(guiOutput, `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFilePath, desktopExtraProps)\n\n // Copy app files to the project root `app` directory so `source: app`\n // in the generated `snapcraft.yaml` (which is under `snap/`) can be\n // resolved by snapcraft running in the build environment.\n const appDir = path.resolve(stageDir, \"app\")\n if (path.resolve(appDir) !== path.resolve(appOutDir)) {\n log.debug({ to: log.filePath(appDir), from: log.filePath(appOutDir) }, \"copying app files to project root app directory\")\n await copyDir(appOutDir, appDir)\n }\n\n // Drop the setuid chrome-sandbox helper before snapcraft stages the app — it is unusable under\n // strict confinement when launching with --no-sandbox (mirrors SnapCoreLegacy).\n if (this.removeChromeSandbox) {\n await remove(path.join(appDir, CHROME_SANDBOX))\n }\n\n // Write the launcher script the command always points at (see SNAP_COMMAND_LAUNCHER).\n // It lands at the snap root ($SNAP/command.sh) — it is intentionally not added to `organize`.\n const launcherPath = path.join(appDir, SNAP_COMMAND_LAUNCHER)\n await writeFile(launcherPath, buildSnapCommandLauncherScript({ execName: this.packager.executableName, args: this.commandArgs }), { mode: 0o755 })\n await chmod(launcherPath, 0o755)\n\n // Auto-generate `organize` mapping for the app part so top-level helper\n // binaries and resources are placed under `app/` inside the snap. Update\n // the already-written `snapcraft.yaml` so the build sees the mapping.\n try {\n const appPart = snap.parts[snap.name]\n if (appPart) {\n const entries = (await readdir(appOutDir)).sort()\n // Null-prototype map: entry names come from the filesystem, so a top-level file named\n // \"__proto__\" / \"constructor\" / \"toString\" must not read inherited keys (which would make\n // the membership check below skip it) or interact with Object.prototype on assignment.\n const organize: Record<string, string> = Object.assign(Object.create(null), appPart.organize)\n for (const entry of entries) {\n if (!entry) {\n continue\n }\n // Skip files no longer present in the staged app dir (e.g. removed chrome-sandbox) so\n // snapcraft doesn't fail trying to organize a missing source.\n if (this.removeChromeSandbox && entry === CHROME_SANDBOX) {\n continue\n }\n // Never organize the launcher under app/. It must stay at the snap root ($SNAP/command.sh)\n // to match apps.<name>.command. This matters when appOutDir === appDir, where readdir\n // would otherwise pick up the launcher we just wrote.\n if (entry === SNAP_COMMAND_LAUNCHER) {\n continue\n }\n if (organize[entry]) {\n continue\n }\n organize[entry] = `app/${entry}`\n }\n appPart.organize = organize\n\n const updatedYaml = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, updatedYaml, \"utf8\")\n log.debug({ organize }, \"updated snapcraft.yaml with organize mapping\")\n }\n } catch (e: any) {\n log.warn({ error: e.message }, \"failed to generate and update organize mapping\")\n }\n\n const buildMode = {\n useLXD: this.options.useLXD === true,\n useMultipass: this.options.useMultipass === true,\n useDestructiveMode: this.options.useDestructiveMode === true,\n remoteBuild: this.options.remoteBuild || undefined,\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null) {\n const shouldSkip = await this.packager.packagerOptions.effectiveOptionComputed({ snap, ...buildMode })\n if (shouldSkip) {\n return [artifactPath]\n }\n }\n\n const rootOptions = this.packager.config.snapcraft\n const snaps = await buildSnap({\n snapcraftConfig: snap,\n artifactPath,\n stageDir,\n packager: this.packager,\n cscLink: rootOptions?.cscLink,\n ...buildMode,\n })\n return snaps\n }\n\n /** Converts `SnapOptions24` into a fully resolved `SnapcraftYAML` descriptor for the given architecture. */\n async mapSnapOptionsToSnapcraftYAML(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const appName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n // Default to [\"gnome\"] in normal builds; no extensions in host/destructive-mode (where the\n // gnome extension is incompatible). Throw if the user explicitly includes \"gnome\" in host mode.\n const hostMode = this.isHostMode()\n const extensionsList: string[] = options.extensions != null ? [...options.extensions] : hostMode ? [] : [\"gnome\"]\n if (hostMode && extensionsList.includes(\"gnome\")) {\n throw new InvalidConfigurationError(\n `The \"gnome\" snapcraft extension is incompatible with host/destructive-mode builds.\\n` +\n `In this mode snapcraft cannot resolve the extension's command-chain source ` +\n `(/usr/share/snapcraft/extensions/desktop/command-chain) and will fail.\\n\\n` +\n `To resolve this, choose one of:\\n` +\n ` 1. Remove \"gnome\" from snapcraft.core24.extensions (or set it to []) and add any\\n` +\n ` required stage-packages manually.\\n` +\n ` 2. Switch to an isolated build environment by setting snapcraft.core24.useLXD: true\\n` +\n ` or snapcraft.core24.useMultipass: true instead of useDestructiveMode.\\n\\n` +\n `See: https://snapcraft.io/docs/gnome-extension`\n )\n }\n const resolvedExtensions = extensionsList.length > 0 ? extensionsList : undefined\n const useGnomeExtension = extensionsList.includes(\"gnome\")\n\n // Snap store review rejects classic-confinement snaps that declare plugs or layout, so skip\n // the generated defaults for classic (mirrors SnapCoreLegacy). Explicitly configured values\n // are kept, but warn that the store is likely to reject them.\n const isClassic = options.confinement === \"classic\"\n if (isClassic && (options.plugs != null || options.layout != null)) {\n log.warn(\n { confinement: \"classic\", plugs: options.plugs != null, layout: options.layout != null },\n \"classic confinement does not support plugs or layout; keeping the explicitly configured values, but the snap store review is likely to reject them\"\n )\n }\n\n // Create the app part\n const appPart: Part = {\n plugin: \"dump\",\n source: \"app\",\n \"build-packages\": options.buildPackages?.length ? options.buildPackages : undefined,\n \"stage-packages\": this.expandDefaultsInArray(options.stagePackages, DEFAULT_STAGE_PACKAGES),\n after: this.expandDefaultsInArray(options.after, []),\n stage: options.appPartStage?.length ? options.appPartStage : undefined,\n }\n\n // Process plugs and slots (see resolvePlugs for the per-build-flavor rules)\n let { root: rootPlugs, app: appPlugs }: { root: Record<string, any> | undefined; app: string[] | undefined } = this.resolvePlugs(\n options,\n isClassic,\n hostMode,\n useGnomeExtension\n )\n\n // Always add browser-support with allow-sandbox so Chromium's internal sandbox\n // can create user namespaces under strict confinement. Without allow-sandbox: true\n // the app crashes immediately with \"FATAL: Permission denied (13)\" in credentials.cc.\n // Skip the injection when the user has explicitly provided their own plugs\n // (they are responsible for including browser-support in that case) and for\n // classic confinement, where plugs must not be declared at all.\n if (!options.plugs && !isClassic) {\n rootPlugs = { ...rootPlugs, \"browser-support\": { interface: \"browser-support\", \"allow-sandbox\": true } }\n if (!appPlugs?.includes(\"browser-support\")) {\n appPlugs = [...(appPlugs ?? []), \"browser-support\"]\n }\n }\n\n const { root: rootSlots, app: appSlots } = options.slots ? this.processPlugOrSlots(options.slots) : { root: undefined, app: undefined }\n\n // Build the effective arg list for the snap command.\n // Start with any user-supplied executableArgs, then conditionally add --no-sandbox\n // if browser-support with allow-sandbox:true is not present in the resolved plugs\n // (mirrors the same logic in SnapCoreLegacy.buildSnap).\n const extraArgs: string[] = [...(this.options.executableArgs ?? [])]\n if (this.options.forceX11 === true) {\n if (!extraArgs.includes(\"--ozone-platform=x11\")) {\n extraArgs.push(\"--ozone-platform=x11\")\n }\n }\n const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(rootPlugs)\n if (noSandbox && !extraArgs.includes(\"--no-sandbox\")) {\n extraArgs.push(\"--no-sandbox\")\n }\n // With --no-sandbox the setuid chrome-sandbox helper is unused; strip it from the snap.\n this.removeChromeSandbox = noSandbox\n\n // The command always points at a generated launcher script (written in buildSnap). This keeps a\n // single uniform command path and sidesteps snapd's character/word-splitting rules for the\n // command field (e.g. --ozone-platform=x11, --js-flags=\"...\").\n this.commandArgs = extraArgs\n\n // Create the app configuration\n const desktopBaseName = this.helper.getDesktopFileName(appName)\n const app: App = {\n command: SNAP_COMMAND_LAUNCHER,\n \"command-chain\": undefined, // explicitly undefined so removeNullish strips it; extensions supply their own command-chain\n plugs: appPlugs,\n slots: appSlots,\n autostart: options.autoStart ? `${desktopBaseName}.desktop` : undefined,\n desktop: `meta/gui/${desktopBaseName}.desktop`,\n extensions: resolvedExtensions,\n }\n\n // Icon path — build-time relative path so snapcraft can find the file in snap/gui/\n await this.helper.icons\n const iconPath = this.helper.maxIconPath != null ? `snap/gui/${appName}${path.extname(this.helper.maxIconPath)}` : undefined\n\n // Process hooks if configured\n const hooksConfig = options.hooks\n const hooks = hooksConfig ? await this.processHooks(hooksConfig) : undefined\n\n // Parts configuration - the extension automatically adds a gnome/sdk part\n // Don't manually add desktop-launch when using the extension\n const parts: Record<string, Part> = {\n [appName]: appPart,\n }\n\n // Note: `organize` will be generated later in `buildSnap` based on the\n // actual contents of the built app directory so helper binaries and\n // resources are automatically moved under `app/` in the snap.\n\n // Build the snapcraft configuration\n const snapcraft: SnapcraftYAML = {\n // Required fields\n name: appName,\n base: \"core24\",\n confinement: options.confinement || \"strict\",\n parts: parts,\n\n // Architecture/Platform — only needed for cross-compilation; snapcraft 8\n // defaults to host arch and snapcraft 7 rejects this field entirely.\n ...(arch !== archFromString(process.arch)\n ? {\n platforms: {\n [toLinuxArchString(arch, \"snap\")]: {\n \"build-for\": toLinuxArchString(arch, \"snap\"),\n \"build-on\": toLinuxArchString(archFromString(process.arch), \"snap\"),\n },\n },\n }\n : {}),\n\n // Metadata - with fallbacks from appInfo\n version: appInfo.version,\n summary: options.summary || appInfo.productName,\n description: this.helper.getDescription(options),\n grade: options.grade || \"stable\",\n title: options.title || appInfo.productName,\n icon: iconPath,\n\n // Build configuration\n compression: options.compression || undefined,\n assumes: this.normalizeAssumesList(options.assumes),\n\n // Environment\n environment: this.buildEnvironment(options),\n\n // Layout (see resolveLayout for the per-build-flavor rules)\n layout: this.resolveLayout(options, isClassic, hostMode, useGnomeExtension),\n\n // Interfaces\n plugs: rootPlugs,\n slots: rootSlots,\n\n // Hooks\n hooks: hooks,\n\n // Apps\n apps: {\n [appName]: app,\n },\n }\n\n return removeNullish(snapcraft)\n }\n\n /**\n * Resolve the root-level plug definitions and the app-level plug references for the build flavor.\n *\n * Explicitly configured plugs always win — they are kept even under classic confinement\n * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:\n * - classic confinement: no plugs at all — the snap store review rejects classic snaps that declare plugs\n * - GNOME extension: no defaults — the extension supplies the common plugs and content snaps\n * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself\n * - host/destructive mode: app-level default plugs only, no content-snap root plugs\n * - default (strict, no extension): manual content-snap root plugs plus the app-level default plugs\n */\n private resolvePlugs(\n options: SnapOptions24,\n isClassic: boolean,\n hostMode: boolean,\n useGnomeExtension: boolean\n ): { root: Record<string, any> | undefined; app: string[] | undefined } {\n if (options.plugs) {\n return this.processPlugOrSlots(options.plugs)\n }\n if (isClassic) {\n return { root: undefined, app: undefined }\n }\n if (useGnomeExtension) {\n return { root: undefined, app: undefined }\n }\n if (hostMode) {\n return { root: undefined, app: this.defaultPlugs }\n }\n return { root: this.buildDefaultRootPlugs(), app: this.defaultPlugs }\n }\n\n /**\n * Default root-level content-snap plugs used without the GNOME extension, wiring up the\n * GNOME platform, theme, and GPU content snaps manually.\n */\n private buildDefaultRootPlugs(): Record<string, any> {\n return {\n \"gtk-3-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/themes\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"icon-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/icons\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"sound-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/sounds\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"gnome-46-2404\": {\n interface: \"content\",\n target: \"$SNAP/gnome-platform\",\n \"default-provider\": \"gnome-46-2404\",\n },\n \"gpu-2404\": {\n interface: \"content\",\n target: \"$SNAP/gpu-2404\",\n \"default-provider\": \"mesa-2404\",\n },\n }\n }\n\n /**\n * Resolve the snap-wide layout for the build flavor.\n *\n * An explicitly configured layout always wins — it is kept even under classic confinement\n * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:\n * - classic confinement: no layout — the snap store review rejects classic snaps that declare one\n * - GNOME extension or host/destructive mode: no layout needed\n * - default (strict, no extension): content-snap default layout\n */\n private resolveLayout(options: SnapOptions24, isClassic: boolean, hostMode: boolean, useGnomeExtension: boolean): Record<string, any> | undefined {\n if (options.layout != null) {\n return options.layout\n }\n if (isClassic || useGnomeExtension || hostMode) {\n return undefined\n }\n return this.buildDefaultLayout(options)\n }\n\n /**\n * Build environment variables with proper defaults\n */\n private buildEnvironment(options: SnapOptions24): Record<string, string | null> | undefined {\n const env: Record<string, string | null> = {}\n\n // Add default TMPDIR for Electron/Chromium apps\n if (!options.environment?.TMPDIR) {\n env.TMPDIR = \"$XDG_RUNTIME_DIR\"\n }\n\n if (options.environment) {\n deepAssign(env, options.environment)\n }\n\n return Object.keys(env).length > 0 ? env : undefined\n }\n\n /**\n * Build default layout for core24 with GNOME platform content snaps (non-extension mode)\n * This allows the app to access libraries from the gnome-46-2404 and mesa-2404 content snaps\n */\n private buildDefaultLayout(options: SnapOptions24): Record<string, any> | undefined {\n // If user provides custom layout, use that instead\n if (options.layout) {\n return options.layout\n }\n\n // Default layout for core24 Electron apps using GNOME content snaps WITHOUT extension\n return {\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\",\n },\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\",\n },\n \"/usr/share/xml/iso-codes\": {\n bind: \"$SNAP/gnome-platform/usr/share/xml/iso-codes\",\n },\n \"/usr/share/libdrm\": {\n bind: \"$SNAP/gpu-2404/libdrm\",\n },\n \"/usr/share/drirc.d\": {\n symlink: \"$SNAP/gpu-2404/drirc.d\",\n },\n }\n }\n\n /**\n * Process hooks directory into hook definitions\n */\n private async processHooks(hooksPath: string): Promise<Record<string, any> | undefined> {\n try {\n const buildResourcesDir = this.packager.buildResourcesDir\n const hooksDir = path.resolve(buildResourcesDir, hooksPath)\n if (!hooksDir.startsWith(buildResourcesDir + path.sep) && hooksDir !== buildResourcesDir) {\n throw new InvalidConfigurationError(`snapcraft.core24.hooks must resolve within the build resources directory (got \"${hooksDir}\")`)\n }\n const hookFiles = await readdir(hooksDir)\n\n if (hookFiles.length === 0) {\n return undefined\n }\n\n const hooks: Record<string, any> = {}\n for (const hookFile of hookFiles) {\n const hookName = path.basename(hookFile, path.extname(hookFile))\n if (!isValidKey(hookName)) {\n throw new InvalidConfigurationError(`Invalid hook name: ${hookName}`)\n }\n hooks[hookName] = {\n // Hook definitions will be populated by snapcraft from the files\n // Just register that these hooks exist\n }\n }\n\n return hooks\n } catch (e: any) {\n log.error({ message: e.message }, \"error processing Snap hooks directory\")\n throw e\n }\n }\n\n /**\n * Normalize assumes list (can be string or array)\n */\n normalizeAssumesList(assumes: Array<string> | string | Nullish): string[] | undefined {\n if (!assumes) {\n return undefined\n }\n if (typeof assumes === \"string\") {\n return [assumes]\n }\n return assumes.length > 0 ? assumes : undefined\n }\n\n /**\n * Process plugs or slots into root-level definitions and app-level references\n */\n processPlugOrSlots<T extends Array<string | SlotDescriptor | PlugDescriptor> | SlotDescriptor | PlugDescriptor | null>(\n items: T\n ): {\n root: Record<string, unknown> | undefined\n app: string[] | undefined\n } {\n if (!items || (Array.isArray(items) && items.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, unknown> = {}\n const app: string[] = []\n\n // Handle single descriptor object\n if (!Array.isArray(items)) {\n Object.entries(items).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n return { root, app }\n }\n\n // Handle array - support \"default\" keyword\n const processedItems = this.expandDefaultsInArray(items, this.defaultPlugs)\n for (const item of processedItems ?? []) {\n if (typeof item === \"string\") {\n // Simple string reference\n app.push(item)\n } else {\n // Descriptor object with configuration\n Object.entries(item).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n }\n }\n\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n }\n\n private isBrowserSandboxAllowed(plugs: Record<string, any> | undefined): boolean {\n if (!plugs) {\n return false\n }\n for (const plug of Object.values(plugs)) {\n if (plug?.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n return false\n }\n\n /**\n * Expand \"default\" keyword in arrays of anything\n */\n private expandDefaultsInArray<T>(items: T[] | Nullish, defaults: T[]): T[] | undefined {\n const result: Array<T> = []\n for (const item of items ?? []) {\n if (typeof item === \"string\" && item === \"default\") {\n result.push(...defaults)\n } else {\n result.push(item)\n }\n }\n return result.length > 0 ? result : undefined\n }\n}\n"]}
@@ -1,15 +1,17 @@
1
1
  import { type NotarizeOptions } from "@electron/notarize";
2
- import type { PerFileSignOptions, SignOptions } from "@electron/osx-sign";
2
+ import type { PerFileSignOptions, SigningDistributionType, SignOptions } from "@electron/osx-sign";
3
3
  import { Arch } from "builder-util";
4
4
  import { Nullish } from "builder-util-runtime";
5
5
  import { CertType, Identity } from "../../codeSign/mac/macCodeSign.js";
6
+ import { SigningResult } from "../../codeSign/signResult.js";
6
7
  import type { MacPackager } from "../../macPackager.js";
7
8
  import { ElectronSignOptions, MasConfiguration } from "../../options/macOptions.js";
8
- export type PlatformType = "mas" | "mas-dev" | "mac";
9
+ export type MasPlatformType = "mas" | "mas-dev";
10
+ export type PlatformType = MasPlatformType | "mac";
9
11
  export declare class MacTargetHelper {
10
12
  private packager;
11
13
  constructor(packager: MacPackager);
12
- handleNullIdentity(): boolean;
14
+ handleNullIdentity(): SigningResult;
13
15
  findSigningIdentity(targetPlatform: PlatformType, qualifier: string | undefined, keychainFile: string | Nullish, hasCustomSign: boolean, signOpts: ElectronSignOptions | null | undefined): Promise<Identity | null>;
14
16
  /**
15
17
  * Resolves the effective app entitlements file — same precedence as `getOptionsForFile()` — and
@@ -20,7 +22,17 @@ export declare class MacTargetHelper {
20
22
  buildSignOptions(appPath: string, identity: Identity, config: ElectronSignOptions | null | undefined, keychainFile: string | Nullish, arch: Arch, targetPlatform: PlatformType): Promise<SignOptions>;
21
23
  createMasInstaller(appPath: string, outDir: string, masOptions: MasConfiguration, keychainFile: string | Nullish, targetPlatform: PlatformType, arch: Arch, identityQualifier?: string | null): Promise<void>;
22
24
  getOptionsForFile(appPath: string, targetPlatform: PlatformType, customSignOptions: ElectronSignOptions | Nullish): Promise<(filePath: string) => PerFileSignOptions>;
23
- static getCertificateTypes(targetPlatform: PlatformType): CertType[];
25
+ /**
26
+ * The effective signing type: an explicit `sign.type` wins, otherwise derived from the build flavor
27
+ * (`mas-dev` → `development`, otherwise `distribution`).
28
+ */
29
+ static resolveSigningType(targetPlatform: PlatformType, configType: SigningDistributionType | Nullish): SigningDistributionType;
30
+ static getCertificateTypes(targetPlatform: PlatformType, type: SigningDistributionType): CertType[];
31
+ /**
32
+ * The MAS `.pkg` installer is only built for distribution signing — a development-signed build
33
+ * (`mas-dev`, or an explicit `sign.type: "development"` on a `mas` build) is installed directly.
34
+ */
35
+ static shouldCreateMasInstaller(targetPlatform: PlatformType, configType: SigningDistributionType | Nullish): targetPlatform is MasPlatformType;
24
36
  static isMasTarget(targetName: string): boolean;
25
37
  static isMasDevelopment(targetName: string): boolean;
26
38
  static getPlatformTypeFromTarget(targetName: string): PlatformType;
@@ -1 +1 @@
1
- {"version":3,"file":"MacTargetHelper.d.ts","sourceRoot":"","sources":["../../../src/targets/mac/MacTargetHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAsC,MAAM,oBAAoB,CAAA;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAA2B,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAClG,OAAO,EAAE,IAAI,EAA8C,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAgB,QAAQ,EAAe,MAAM,mCAAmC,CAAA;AACjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInF,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;AAEpD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,WAAW;IAEzC,kBAAkB,IAAI,OAAO;IAQvB,mBAAmB,CACvB,cAAc,EAAE,YAAY,EAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,YAAY,EAAE,MAAM,GAAG,OAAO,EAC9B,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAC/C,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAgC3B;;;;OAIG;IACG,2BAA2B,CAAC,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,mBAAmB,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAepH,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,EAC9C,YAAY,EAAE,MAA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M,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAyCjE,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAczD"}
@@ -13,11 +13,11 @@ export class MacTargetHelper {
13
13
  throw new InvalidConfigurationError("identity explicitly is set to null, but forceCodeSigning is set to true");
14
14
  }
15
15
  log.info({ reason: "identity explicitly is set to null" }, "skipped macOS code signing");
16
- return false;
16
+ return "skipped:disabled";
17
17
  }
18
18
  async findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts) {
19
19
  const isMas = MacTargetHelper.isMasTarget(targetPlatform);
20
- const certificateTypes = MacTargetHelper.getCertificateTypes(targetPlatform);
20
+ const certificateTypes = MacTargetHelper.getCertificateTypes(targetPlatform, MacTargetHelper.resolveSigningType(targetPlatform, signOpts?.type));
21
21
  let identity = null;
22
22
  for (const certificateType of certificateTypes) {
23
23
  identity = await findIdentity(certificateType, qualifier, keychainFile);
@@ -30,7 +30,7 @@ export class MacTargetHelper {
30
30
  if (qualifier === "-") {
31
31
  if (MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, signOpts?.hardenedRuntime) && !(await this.isLibraryValidationDisabled(targetPlatform, signOpts))) {
32
32
  log.warn(null, "ad-hoc signing with hardenedRuntime enabled requires the com.apple.security.cs.disable-library-validation entitlement " +
33
- "to prevent app launch failures due to library validation. See https://electron.build/code-signing for details.");
33
+ "to prevent app launch failures due to library validation. See https://electron.build/docs/features/code-signing for details.");
34
34
  }
35
35
  identity = new Identity("-", undefined);
36
36
  }
@@ -63,8 +63,7 @@ export class MacTargetHelper {
63
63
  }
64
64
  async buildSignOptions(appPath, identity, config, keychainFile, arch, targetPlatform) {
65
65
  const isMas = MacTargetHelper.isMasTarget(targetPlatform);
66
- // `type` is derived from the build flavor, never from user config: mas-dev → development, otherwise distribution.
67
- const type = MacTargetHelper.isMasDevelopment(targetPlatform) ? "development" : "distribution";
66
+ const type = MacTargetHelper.resolveSigningType(targetPlatform, config?.type);
68
67
  let binaries = config?.binaries || undefined;
69
68
  if (binaries) {
70
69
  // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.
@@ -141,7 +140,7 @@ export class MacTargetHelper {
141
140
  const certType = MacTargetHelper.isMasDevelopment(targetPlatform) ? "Mac Developer" : "3rd Party Mac Developer Installer";
142
141
  const masInstallerIdentity = await findIdentity(certType, identityQualifier, keychainFile);
143
142
  if (masInstallerIdentity == null) {
144
- throw new InvalidConfigurationError(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/code-signing`);
143
+ throw new InvalidConfigurationError(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/docs/features/code-signing`);
145
144
  }
146
145
  MacTargetHelper.assertSafePathForCommandUsage(outDir, "output directory");
147
146
  // mas uploaded to AppStore, so, use "-" instead of space for name
@@ -201,15 +200,25 @@ export class MacTargetHelper {
201
200
  };
202
201
  };
203
202
  }
204
- static getCertificateTypes(targetPlatform) {
205
- switch (targetPlatform) {
206
- case "mas-dev":
207
- return ["Mac Developer", "Apple Development"];
208
- case "mas":
209
- return ["Apple Distribution", "3rd Party Mac Developer Application"];
210
- default:
211
- return ["Developer ID Application"];
203
+ /**
204
+ * The effective signing type: an explicit `sign.type` wins, otherwise derived from the build flavor
205
+ * (`mas-dev` → `development`, otherwise `distribution`).
206
+ */
207
+ static resolveSigningType(targetPlatform, configType) {
208
+ return configType ?? (MacTargetHelper.isMasDevelopment(targetPlatform) ? "development" : "distribution");
209
+ }
210
+ static getCertificateTypes(targetPlatform, type) {
211
+ if (type === "development") {
212
+ return ["Mac Developer", "Apple Development"];
212
213
  }
214
+ return MacTargetHelper.isMasTarget(targetPlatform) ? ["Apple Distribution", "3rd Party Mac Developer Application"] : ["Developer ID Application"];
215
+ }
216
+ /**
217
+ * The MAS `.pkg` installer is only built for distribution signing — a development-signed build
218
+ * (`mas-dev`, or an explicit `sign.type: "development"` on a `mas` build) is installed directly.
219
+ */
220
+ static shouldCreateMasInstaller(targetPlatform, configType) {
221
+ return MacTargetHelper.isMasTarget(targetPlatform) && MacTargetHelper.resolveSigningType(targetPlatform, configType) !== "development";
213
222
  }
214
223
  static isMasTarget(targetName) {
215
224
  return targetName === "mas" || targetName === "mas-dev";
@@ -1 +1 @@
1
- {"version":3,"file":"MacTargetHelper.js","sourceRoot":"","sources":["../../../src/targets/mac/MacTargetHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4D,MAAM,oBAAoB,CAAA;AAEvG,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE/E,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAY,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAGjG,OAAO,EAAE,cAAc,EAAe,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAI3D,MAAM,OAAO,eAAe;IAC1B,YAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;IAAG,CAAC;IAE7C,kBAAkB;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,yBAAyB,CAAC,yEAAyE,CAAC,CAAA;QAChH,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,EAAE,4BAA4B,CAAC,CAAA;QACxF,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,cAA4B,EAC5B,SAA6B,EAC7B,YAA8B,EAC9B,aAAsB,EACtB,QAAgD;QAEhD,MAAM,KAAK,GAAG,eAAe,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;QACzD,MAAM,gBAAgB,GAAG,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC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,CAAC,eAAe,CAAC,QAAQ,CAAA;QAC9D,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC;YAC9B,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,gDAAgD,EAAE,EAAE,4BAA4B,CAAC,CAAA;YACpG,OAAM;QACR,CAAC;QACD,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAC3D,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,gDAAgD,EAAE,EAAE,4BAA4B,CAAC,CAAA;YACpG,OAAM;QACR,CAAC;QACD,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;QACvB,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAA;IAC3C,CAAC;CACF","sourcesContent":["import { notarize, type NotarizeOptions, type NotaryToolKeychainCredentials } from \"@electron/notarize\"\nimport type { PerFileSignOptions, SigningDistributionType, SignOptions } from \"@electron/osx-sign\"\nimport { Arch, InvalidConfigurationError, log, statOrNull } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { CertType, findIdentity, Identity, reportError } from \"../../codeSign/mac/macCodeSign.js\"\nimport type { MacPackager } from \"../../macPackager.js\"\nimport { ElectronSignOptions, MasConfiguration } from \"../../options/macOptions.js\"\nimport { parsePlistFile, PlistObject } from \"../../util/mac/plist.js\"\nimport { getTemplatePath } from \"../../util/pathManager.js\"\n\nexport type PlatformType = \"mas\" | \"mas-dev\" | \"mac\"\n\nexport class MacTargetHelper {\n constructor(private packager: MacPackager) {}\n\n handleNullIdentity(): boolean {\n if (this.packager.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return false\n }\n\n async findSigningIdentity(\n targetPlatform: PlatformType,\n qualifier: string | undefined,\n keychainFile: string | Nullish,\n hasCustomSign: boolean,\n signOpts: ElectronSignOptions | null | undefined\n ): Promise<Identity | null> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n const certificateTypes = MacTargetHelper.getCertificateTypes(targetPlatform)\n\n let identity: Identity | null = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n const noIdentity = !hasCustomSign\n if (qualifier === \"-\") {\n if (MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, signOpts?.hardenedRuntime) && !(await this.isLibraryValidationDisabled(targetPlatform, signOpts))) {\n log.warn(\n null,\n \"ad-hoc signing with hardenedRuntime enabled requires the com.apple.security.cs.disable-library-validation entitlement \" +\n \"to prevent app launch failures due to library validation. See https://electron.build/code-signing for details.\"\n )\n }\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.packager.forceCodeSigning)\n return null\n }\n }\n\n return identity\n }\n\n /**\n * Resolves the effective app entitlements file — same precedence as `getOptionsForFile()` — and\n * returns whether it grants `com.apple.security.cs.disable-library-validation`.\n * Fails open: returns false (so callers still warn) when the file cannot be read or parsed.\n */\n async isLibraryValidationDisabled(targetPlatform: PlatformType, signOpts: ElectronSignOptions | Nullish): Promise<boolean> {\n let file = signOpts?.entitlements\n if (!file) {\n const p = `entitlements.${MacTargetHelper.isMasTarget(targetPlatform) ? \"mas\" : \"mac\"}.plist`\n file = (await this.packager.resourceList).includes(p) ? path.join(this.packager.buildResourcesDir, p) : getTemplatePath(\"entitlements.mac.plist\")\n }\n try {\n const entitlements = await parsePlistFile<PlistObject>(file)\n return entitlements[\"com.apple.security.cs.disable-library-validation\"] === true\n } catch (e: any) {\n log.debug({ file, error: e.message }, \"cannot read entitlements to verify library validation\")\n return false\n }\n }\n\n async buildSignOptions(\n appPath: string,\n identity: Identity,\n config: ElectronSignOptions | null | undefined,\n keychainFile: string | Nullish,\n arch: Arch,\n targetPlatform: PlatformType\n ): Promise<SignOptions> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n // `type` is derived from the build flavor, never from user config: mas-dev → development, otherwise distribution.\n const type: SigningDistributionType = MacTargetHelper.isMasDevelopment(targetPlatform) ? \"development\" : \"distribution\"\n\n let binaries = config?.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = (\n await Promise.all(\n binaries.flatMap(async destination => {\n const expandedDestination = this.packager.expandArch(destination, arch)\n return await Promise.all(\n expandedDestination.map(async d => {\n if (await statOrNull(d)) {\n return d\n }\n return path.resolve(appPath, d)\n })\n )\n })\n )\n ).flat()\n log.info({ binaries, arch: arch == null ? null : Arch[arch] }, \"signing additional user-defined binaries for arch\")\n }\n\n let filter = config?.ignore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = undefined\n }\n } else if (typeof filter === \"string\") {\n filter = filter.length === 0 ? undefined : [filter]\n }\n\n const filterRe =\n typeof filter === \"function\"\n ? null\n : filter?.map(it => {\n try {\n return new RegExp(it)\n } catch (e: any) {\n throw new InvalidConfigurationError(`Invalid regex filter pattern: ${it}. ${e.message}`)\n }\n })\n\n return {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n if (typeof filter === \"function\" && filter(file)) {\n return true\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.packager.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: config?.strictVerify,\n preAutoEntitlements: config?.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, targetPlatform, config),\n provisioningProfile: config?.provisioningProfile || undefined,\n }\n }\n\n async createMasInstaller(\n appPath: string,\n outDir: string,\n masOptions: MasConfiguration,\n keychainFile: string | Nullish,\n targetPlatform: PlatformType,\n arch: Arch,\n identityQualifier?: string | null\n ): Promise<void> {\n const certType = MacTargetHelper.isMasDevelopment(targetPlatform) ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, identityQualifier, keychainFile)\n\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n MacTargetHelper.assertSafePathForCommandUsage(outDir, \"output directory\")\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n // path.basename prevents path traversal if a crafted artifactName contains \"../../\"\n const artifactName = path.basename(this.packager.expandArtifactNamePattern(masOptions, \"pkg\", arch))\n MacTargetHelper.assertSafePathForCommandUsage(artifactName, \"artifact name\")\n const artifactPath = path.resolve(outDir, artifactName)\n await this.packager.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.packager.emitArtifactBuildCompleted({\n file: artifactPath,\n target: null,\n arch: Arch.x64,\n safeArtifactName: this.packager.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.packager.platformOptions.defaultArch),\n packager: this.packager,\n })\n }\n\n async getOptionsForFile(appPath: string, targetPlatform: PlatformType, customSignOptions: ElectronSignOptions | Nullish): Promise<(filePath: string) => PerFileSignOptions> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n const resourceList = await this.packager.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n if (filePath === appPath) {\n if (customSignOptions?.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.packager.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions?.entitlementsLoginHelper\n }\n\n if (customSignOptions?.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.packager.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || customSignOptions?.requirements == null ? undefined : await this.packager.getResource(customSignOptions.requirements)\n\n return (filePath: string): PerFileSignOptions => {\n const entitlements = getEntitlements(filePath)\n return {\n entitlements: entitlements || undefined,\n hardenedRuntime: MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, customSignOptions?.hardenedRuntime) ?? undefined,\n timestamp: customSignOptions?.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions?.additionalArguments || undefined,\n }\n }\n }\n\n static getCertificateTypes(targetPlatform: PlatformType): CertType[] {\n switch (targetPlatform) {\n case \"mas-dev\":\n return [\"Mac Developer\", \"Apple Development\"]\n case \"mas\":\n return [\"Apple Distribution\", \"3rd Party Mac Developer Application\"]\n default:\n return [\"Developer ID Application\"]\n }\n }\n\n static isMasTarget(targetName: string): boolean {\n return targetName === \"mas\" || targetName === \"mas-dev\"\n }\n\n static isMasDevelopment(targetName: string): boolean {\n return targetName === \"mas-dev\"\n }\n\n static getPlatformTypeFromTarget(targetName: string): PlatformType {\n // must check for mas-dev first\n if (MacTargetHelper.isMasDevelopment(targetName)) {\n return \"mas-dev\"\n }\n if (MacTargetHelper.isMasTarget(targetName)) {\n return \"mas\"\n }\n return \"mac\"\n }\n\n /**\n * Returns true when hardened runtime will be active for signing.\n * For non-MAS builds it defaults to on; for MAS it defaults to off.\n */\n static isHardenedRuntimeEnabledForSigning(targetPlatform: PlatformType, hardenedRuntime: boolean | null | undefined): boolean {\n return MacTargetHelper.isMasTarget(targetPlatform) ? hardenedRuntime === true : hardenedRuntime !== false\n }\n\n static assertSafePathForCommandUsage(pathValue: string, description: string): void {\n if (/[\\0\\r\\n\"'`$;&|<>]/.test(pathValue)) {\n throw new InvalidConfigurationError(`Invalid ${description}: contains unsupported shell-special characters`)\n }\n }\n\n static getNotarizeOptions(appPath: string): NotarizeOptions | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { appPath, appleId, appleIdPassword, teamId }\n }\n\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { appPath, ...args }\n }\n\n return undefined\n }\n\n async notarizeIfProvided(appPath: string): Promise<void> {\n const notarizeOptions = this.packager.platformOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = MacTargetHelper.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n}\n"]}
1
+ {"version":3,"file":"MacTargetHelper.js","sourceRoot":"","sources":["../../../src/targets/mac/MacTargetHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4D,MAAM,oBAAoB,CAAA;AAEvG,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE/E,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAY,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAIjG,OAAO,EAAE,cAAc,EAAe,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAK3D,MAAM,OAAO,eAAe;IAC1B,YAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;IAAG,CAAC;IAE7C,kBAAkB;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,yBAAyB,CAAC,yEAAyE,CAAC,CAAA;QAChH,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,EAAE,4BAA4B,CAAC,CAAA;QACxF,OAAO,kBAAkB,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,cAA4B,EAC5B,SAA6B,EAC7B,YAA8B,EAC9B,aAAsB,EACtB,QAAgD;QAEhD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,CAAC,CAAA;YACrH,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA;QAChE,CAAC;QAED,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAA;QAC3C,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAA;QAC1D,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,IAAI,GAAkC,EAAE,eAAe,EAAE,CAAA;YAC7D,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAA;YAC9B,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,CAAA;QAC7B,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAe;QACtC,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAA;QAC9D,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC;YAC9B,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,gDAAgD,EAAE,EAAE,4BAA4B,CAAC,CAAA;YACpG,OAAM;QACR,CAAC;QACD,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;QAC3D,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,gDAAgD,EAAE,EAAE,4BAA4B,CAAC,CAAA;YACpG,OAAM;QACR,CAAC;QACD,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;QACvB,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAA;IAC3C,CAAC;CACF","sourcesContent":["import { notarize, type NotarizeOptions, type NotaryToolKeychainCredentials } from \"@electron/notarize\"\nimport type { PerFileSignOptions, SigningDistributionType, SignOptions } from \"@electron/osx-sign\"\nimport { Arch, InvalidConfigurationError, log, statOrNull } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { CertType, findIdentity, Identity, reportError } from \"../../codeSign/mac/macCodeSign.js\"\nimport { SigningResult } from \"../../codeSign/signResult.js\"\nimport type { MacPackager } from \"../../macPackager.js\"\nimport { ElectronSignOptions, MasConfiguration } from \"../../options/macOptions.js\"\nimport { parsePlistFile, PlistObject } from \"../../util/mac/plist.js\"\nimport { getTemplatePath } from \"../../util/pathManager.js\"\n\nexport type MasPlatformType = \"mas\" | \"mas-dev\"\nexport type PlatformType = MasPlatformType | \"mac\"\n\nexport class MacTargetHelper {\n constructor(private packager: MacPackager) {}\n\n handleNullIdentity(): SigningResult {\n if (this.packager.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return \"skipped:disabled\"\n }\n\n async findSigningIdentity(\n targetPlatform: PlatformType,\n qualifier: string | undefined,\n keychainFile: string | Nullish,\n hasCustomSign: boolean,\n signOpts: ElectronSignOptions | null | undefined\n ): Promise<Identity | null> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n const certificateTypes = MacTargetHelper.getCertificateTypes(targetPlatform, MacTargetHelper.resolveSigningType(targetPlatform, signOpts?.type))\n\n let identity: Identity | null = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n const noIdentity = !hasCustomSign\n if (qualifier === \"-\") {\n if (MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, signOpts?.hardenedRuntime) && !(await this.isLibraryValidationDisabled(targetPlatform, signOpts))) {\n log.warn(\n null,\n \"ad-hoc signing with hardenedRuntime enabled requires the com.apple.security.cs.disable-library-validation entitlement \" +\n \"to prevent app launch failures due to library validation. See https://electron.build/docs/features/code-signing for details.\"\n )\n }\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.packager.forceCodeSigning)\n return null\n }\n }\n\n return identity\n }\n\n /**\n * Resolves the effective app entitlements file — same precedence as `getOptionsForFile()` — and\n * returns whether it grants `com.apple.security.cs.disable-library-validation`.\n * Fails open: returns false (so callers still warn) when the file cannot be read or parsed.\n */\n async isLibraryValidationDisabled(targetPlatform: PlatformType, signOpts: ElectronSignOptions | Nullish): Promise<boolean> {\n let file = signOpts?.entitlements\n if (!file) {\n const p = `entitlements.${MacTargetHelper.isMasTarget(targetPlatform) ? \"mas\" : \"mac\"}.plist`\n file = (await this.packager.resourceList).includes(p) ? path.join(this.packager.buildResourcesDir, p) : getTemplatePath(\"entitlements.mac.plist\")\n }\n try {\n const entitlements = await parsePlistFile<PlistObject>(file)\n return entitlements[\"com.apple.security.cs.disable-library-validation\"] === true\n } catch (e: any) {\n log.debug({ file, error: e.message }, \"cannot read entitlements to verify library validation\")\n return false\n }\n }\n\n async buildSignOptions(\n appPath: string,\n identity: Identity,\n config: ElectronSignOptions | null | undefined,\n keychainFile: string | Nullish,\n arch: Arch,\n targetPlatform: PlatformType\n ): Promise<SignOptions> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n const type = MacTargetHelper.resolveSigningType(targetPlatform, config?.type)\n\n let binaries = config?.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = (\n await Promise.all(\n binaries.flatMap(async destination => {\n const expandedDestination = this.packager.expandArch(destination, arch)\n return await Promise.all(\n expandedDestination.map(async d => {\n if (await statOrNull(d)) {\n return d\n }\n return path.resolve(appPath, d)\n })\n )\n })\n )\n ).flat()\n log.info({ binaries, arch: arch == null ? null : Arch[arch] }, \"signing additional user-defined binaries for arch\")\n }\n\n let filter = config?.ignore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = undefined\n }\n } else if (typeof filter === \"string\") {\n filter = filter.length === 0 ? undefined : [filter]\n }\n\n const filterRe =\n typeof filter === \"function\"\n ? null\n : filter?.map(it => {\n try {\n return new RegExp(it)\n } catch (e: any) {\n throw new InvalidConfigurationError(`Invalid regex filter pattern: ${it}. ${e.message}`)\n }\n })\n\n return {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n if (typeof filter === \"function\" && filter(file)) {\n return true\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.packager.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: config?.strictVerify,\n preAutoEntitlements: config?.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, targetPlatform, config),\n provisioningProfile: config?.provisioningProfile || undefined,\n }\n }\n\n async createMasInstaller(\n appPath: string,\n outDir: string,\n masOptions: MasConfiguration,\n keychainFile: string | Nullish,\n targetPlatform: PlatformType,\n arch: Arch,\n identityQualifier?: string | null\n ): Promise<void> {\n const certType = MacTargetHelper.isMasDevelopment(targetPlatform) ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, identityQualifier, keychainFile)\n\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/docs/features/code-signing`)\n }\n\n MacTargetHelper.assertSafePathForCommandUsage(outDir, \"output directory\")\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n // path.basename prevents path traversal if a crafted artifactName contains \"../../\"\n const artifactName = path.basename(this.packager.expandArtifactNamePattern(masOptions, \"pkg\", arch))\n MacTargetHelper.assertSafePathForCommandUsage(artifactName, \"artifact name\")\n const artifactPath = path.resolve(outDir, artifactName)\n await this.packager.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.packager.emitArtifactBuildCompleted({\n file: artifactPath,\n target: null,\n arch: Arch.x64,\n safeArtifactName: this.packager.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.packager.platformOptions.defaultArch),\n packager: this.packager,\n })\n }\n\n async getOptionsForFile(appPath: string, targetPlatform: PlatformType, customSignOptions: ElectronSignOptions | Nullish): Promise<(filePath: string) => PerFileSignOptions> {\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n const resourceList = await this.packager.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n if (filePath === appPath) {\n if (customSignOptions?.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.packager.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions?.entitlementsLoginHelper\n }\n\n if (customSignOptions?.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.packager.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || customSignOptions?.requirements == null ? undefined : await this.packager.getResource(customSignOptions.requirements)\n\n return (filePath: string): PerFileSignOptions => {\n const entitlements = getEntitlements(filePath)\n return {\n entitlements: entitlements || undefined,\n hardenedRuntime: MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, customSignOptions?.hardenedRuntime) ?? undefined,\n timestamp: customSignOptions?.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions?.additionalArguments || undefined,\n }\n }\n }\n\n /**\n * The effective signing type: an explicit `sign.type` wins, otherwise derived from the build flavor\n * (`mas-dev` → `development`, otherwise `distribution`).\n */\n static resolveSigningType(targetPlatform: PlatformType, configType: SigningDistributionType | Nullish): SigningDistributionType {\n return configType ?? (MacTargetHelper.isMasDevelopment(targetPlatform) ? \"development\" : \"distribution\")\n }\n\n static getCertificateTypes(targetPlatform: PlatformType, type: SigningDistributionType): CertType[] {\n if (type === \"development\") {\n return [\"Mac Developer\", \"Apple Development\"]\n }\n return MacTargetHelper.isMasTarget(targetPlatform) ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n }\n\n /**\n * The MAS `.pkg` installer is only built for distribution signing — a development-signed build\n * (`mas-dev`, or an explicit `sign.type: \"development\"` on a `mas` build) is installed directly.\n */\n static shouldCreateMasInstaller(targetPlatform: PlatformType, configType: SigningDistributionType | Nullish): targetPlatform is MasPlatformType {\n return MacTargetHelper.isMasTarget(targetPlatform) && MacTargetHelper.resolveSigningType(targetPlatform, configType) !== \"development\"\n }\n\n static isMasTarget(targetName: string): boolean {\n return targetName === \"mas\" || targetName === \"mas-dev\"\n }\n\n static isMasDevelopment(targetName: string): boolean {\n return targetName === \"mas-dev\"\n }\n\n static getPlatformTypeFromTarget(targetName: string): PlatformType {\n // must check for mas-dev first\n if (MacTargetHelper.isMasDevelopment(targetName)) {\n return \"mas-dev\"\n }\n if (MacTargetHelper.isMasTarget(targetName)) {\n return \"mas\"\n }\n return \"mac\"\n }\n\n /**\n * Returns true when hardened runtime will be active for signing.\n * For non-MAS builds it defaults to on; for MAS it defaults to off.\n */\n static isHardenedRuntimeEnabledForSigning(targetPlatform: PlatformType, hardenedRuntime: boolean | null | undefined): boolean {\n return MacTargetHelper.isMasTarget(targetPlatform) ? hardenedRuntime === true : hardenedRuntime !== false\n }\n\n static assertSafePathForCommandUsage(pathValue: string, description: string): void {\n if (/[\\0\\r\\n\"'`$;&|<>]/.test(pathValue)) {\n throw new InvalidConfigurationError(`Invalid ${description}: contains unsupported shell-special characters`)\n }\n }\n\n static getNotarizeOptions(appPath: string): NotarizeOptions | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { appPath, appleId, appleIdPassword, teamId }\n }\n\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { appPath, ...args }\n }\n\n return undefined\n }\n\n async notarizeIfProvided(appPath: string): Promise<void> {\n const notarizeOptions = this.packager.platformOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = MacTargetHelper.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n}\n"]}
@@ -64,7 +64,7 @@ export class PkgTarget extends Target {
64
64
  this.buildComponentPackage(appPath, componentPropertyListFile, innerPackageFile),
65
65
  ]))[0];
66
66
  if (identity == null && packager.forceCodeSigning) {
67
- throw new Error(`Cannot find valid "${certType}" to sign standalone installer, please see https://electron.build/code-signing`);
67
+ throw new Error(`Cannot find valid "${certType}" to sign standalone installer, please see https://electron.build/docs/features/code-signing`);
68
68
  }
69
69
  const args = prepareProductBuildArgs(identity, keychainFile);
70
70
  args.push("--distribution", distInfoFile);
@@ -1 +1 @@
1
- {"version":3,"file":"pkg.js","sourceRoot":"","sources":["../../../src/targets/mac/pkg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAe,MAAM,yBAAyB,CAAA;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAElE,MAAM,QAAQ,GAAG,w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GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;IAClE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,cAAc,CAAc,aAAa,CAAC,CAAA;QAC9D,MAAM,OAAO,GAAG,KAAK,CAAC,0BAA0B,CAAA;QAChD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC/E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAA;IACjB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,iBAAyB,EAAE,OAAkC;IAC7F,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;AACjH,CAAC","sourcesContent":["import { Arch, debug, exec, statOrNull, use } from \"builder-util\"\nimport { deepAssign, Nullish } from \"builder-util-runtime\"\nimport { readdirSync } from \"fs\"\nimport { readFile, unlink, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { filterCFBundleIdentifier } from \"../../appInfo.js\"\nimport { findIdentity } from \"../../codeSign/mac/macCodeSign.js\"\nimport type { Identity } from \"../../codeSign/mac/macCodeSign.js\"\nimport { Target } from \"../../core.js\"\nimport { MacPackager } from \"../../macPackager.js\"\nimport { PkgOptions } from \"../../options/pkgOptions.js\"\nimport { savePlistFile, parsePlistFile, PlistObject } from \"../../util/mac/plist.js\"\nimport { getNotLocalizedLicenseFile } from \"../../util/license.js\"\n\nconst certType = \"Developer ID Installer\"\n\n// Maps electron-builder Arch to Apple's architecture names for productbuild requirements plist\nfunction archToAppleArchitectures(arch: Arch): string[] {\n switch (arch) {\n case Arch.arm64:\n return [\"arm64\"]\n case Arch.x64:\n return [\"x86_64\"]\n case Arch.universal:\n return [\"arm64\", \"x86_64\"]\n case Arch.ia32:\n return [\"i386\"]\n default:\n return [\"arm64\", \"x86_64\"]\n }\n}\n\ntype ExtraPackages = {\n packagePath: string\n packages: string[]\n}\n\n// http://www.shanekirk.com/2013/10/creating-flat-packages-in-osx/\n// to use --scripts, we must build .app bundle separately using pkgbuild\n// productbuild --scripts doesn't work (because scripts in this case not added to our package)\n// https://github.com/electron-userland/@electron/osx-sign/issues/96#issuecomment-274986942\nexport class PkgTarget extends Target {\n readonly options: PkgOptions\n\n constructor(\n private readonly packager: MacPackager,\n readonly outDir: string\n ) {\n super(\"pkg\")\n this.options = deepAssign(\n {\n allowAnywhere: true,\n allowCurrentUserHome: true,\n allowRootDirectory: true,\n },\n packager.getOptionsForTarget<PkgOptions>(\"pkg\")\n )\n }\n\n async build(appPath: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const options = this.options\n const appInfo = packager.appInfo\n\n // pkg doesn't like not ASCII symbols (Could not open package to list files: /Volumes/test/t-gIjdGK/test-project-0/dist/Test App ßW-1.1.0.pkg)\n const artifactName = packager.expandArtifactNamePattern(options, \"pkg\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.emitArtifactBuildStarted({\n targetPresentableName: \"pkg\",\n file: artifactPath,\n arch,\n })\n\n const keychainFile = (await packager.codeSigningInfo.value).keychainFile\n\n const appOutDir = this.outDir\n // https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html\n const distInfoFile = path.join(appOutDir, \"distribution.xml\")\n\n const extraPackages = this.getExtraPackages()\n\n const innerPackageFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.pkg`)\n const componentPropertyListFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.plist`)\n const identity = (\n await Promise.all([\n findIdentity(certType, options.identity, keychainFile),\n this.customizeDistributionConfiguration(distInfoFile, appPath, extraPackages, arch),\n this.buildComponentPackage(appPath, componentPropertyListFile, innerPackageFile),\n ])\n )[0]\n\n if (identity == null && packager.forceCodeSigning) {\n throw new Error(`Cannot find valid \"${certType}\" to sign standalone installer, please see https://electron.build/code-signing`)\n }\n\n const args = prepareProductBuildArgs(identity, keychainFile)\n args.push(\"--distribution\", distInfoFile)\n if (extraPackages) {\n args.push(\"--package-path\", extraPackages.packagePath)\n }\n args.push(artifactPath)\n use(options.productbuild, it => args.push(...(it as any)))\n await exec(\"productbuild\", args, {\n cwd: appOutDir,\n })\n await Promise.all([unlink(innerPackageFile), unlink(distInfoFile)])\n await packager.helper.notarizeIfProvided(artifactPath)\n await packager.emitArtifactBuildCompleted({\n file: artifactPath,\n target: this,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"pkg\", arch),\n packager,\n })\n }\n\n private getExtraPackages(): ExtraPackages | null {\n const extraPkgsDir = this.options.extraPkgsDir\n if (extraPkgsDir == null) {\n return null\n }\n const packagePath = path.join(this.packager.buildResourcesDir, extraPkgsDir)\n let files: Array<string>\n try {\n files = readdirSync(packagePath)\n } catch (e: any) {\n if (e.code === \"ENOENT\") {\n return null\n } else {\n throw e\n }\n }\n const packages = files.filter(file => file.endsWith(\".pkg\"))\n if (packages.length === 0) {\n return null\n }\n return { packagePath, packages }\n }\n\n private async customizeDistributionConfiguration(distInfoFile: string, appPath: string, extraPackages: ExtraPackages | null, arch: Arch) {\n const options = this.options\n\n // Build requirements plist for productbuild to generate correct hostArchitectures and allowed-os-versions\n // This is the Apple-recommended way to specify architecture and OS requirements\n // See: man productbuild, section \"PRE-INSTALL REQUIREMENTS PROPERTY LIST\"\n const requirements: Record<string, any> = {}\n\n // Set architecture based on build target - productbuild will generate correct hostArchitectures in distribution XML\n // On macOS Big Sur+, productbuild defaults to both arm64 and x86_64 unless we specify otherwise\n requirements.arch = archToAppleArchitectures(arch)\n\n // Set minimum OS version - productbuild will generate allowed-os-versions in distribution XML\n const minimumSystemVersion = this.packager.platformOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n requirements.os = [minimumSystemVersion]\n }\n\n const requirementsPlistFile = await this.packager.tempDirManager.getTempFile({ suffix: \".plist\", prefix: \"productbuild-requirements\" })\n await savePlistFile(requirementsPlistFile, requirements)\n\n const args = [\"--synthesize\", \"--product\", requirementsPlistFile, \"--component\", appPath]\n if (extraPackages) {\n extraPackages.packages.forEach(pkg => {\n args.push(\"--package\", path.join(extraPackages.packagePath, pkg))\n })\n }\n args.push(distInfoFile)\n await exec(\"productbuild\", args, {\n cwd: this.outDir,\n })\n\n let distInfo = await readFile(distInfoFile, \"utf-8\")\n\n if (options.mustClose != null && options.mustClose.length !== 0) {\n const startContent = ` <pkg-ref id=\"${this.packager.appInfo.id}\">\\n <must-close>\\n`\n const endContent = \" </must-close>\\n </pkg-ref>\\n</installer-gui-script>\"\n let mustCloseContent = \"\"\n options.mustClose.forEach(appId => {\n mustCloseContent += ` <app id=\"${appId}\"/>\\n`\n })\n distInfo = distInfo.replace(\"</installer-gui-script>\", `${startContent}${mustCloseContent}${endContent}`)\n }\n\n const insertIndex = distInfo.lastIndexOf(\"</installer-gui-script>\")\n distInfo =\n distInfo.substring(0, insertIndex) +\n ` <domains enable_anywhere=\"${options.allowAnywhere}\" enable_currentUserHome=\"${options.allowCurrentUserHome}\" enable_localSystem=\"${options.allowRootDirectory}\" />\\n` +\n distInfo.substring(insertIndex)\n\n if (options.background != null) {\n const background = await this.packager.getResource(options.background.file)\n if (background != null) {\n const alignment = options.background.alignment || \"center\"\n // noinspection SpellCheckingInspection\n const scaling = options.background.scaling || \"tofit\"\n distInfo = distInfo.substring(0, insertIndex) + ` <background file=\"${background}\" alignment=\"${alignment}\" scaling=\"${scaling}\"/>\\n` + distInfo.substring(insertIndex)\n distInfo =\n distInfo.substring(0, insertIndex) + ` <background-darkAqua file=\"${background}\" alignment=\"${alignment}\" scaling=\"${scaling}\"/>\\n` + distInfo.substring(insertIndex)\n }\n }\n\n const welcome = await this.packager.getResource(options.welcome)\n if (welcome != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <welcome file=\"${welcome}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n const license = await getNotLocalizedLicenseFile(options.license, this.packager)\n if (license != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <license file=\"${license}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n const conclusion = await this.packager.getResource(options.conclusion)\n if (conclusion != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <conclusion file=\"${conclusion}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n debug(distInfo)\n await writeFile(distInfoFile, distInfo)\n }\n\n private async buildComponentPackage(appPath: string, propertyListOutputFile: string, packageOutputFile: string) {\n const options = this.options\n const rootPath = path.dirname(appPath)\n\n // first produce a component plist template\n await exec(\"pkgbuild\", [\"--analyze\", \"--root\", rootPath, propertyListOutputFile])\n\n // process the template plist\n const plistInfo = (await parsePlistFile<PlistObject[]>(propertyListOutputFile)).filter((it: PlistObject) => it.RootRelativeBundlePath !== \"Electron.dSYM\")\n let packageInfo: any = {}\n if (plistInfo.length > 0) {\n packageInfo = plistInfo[0]\n\n // ChildBundles lists all of electron binaries within the .app.\n // There is no particular reason for removing that key, except to be as close as possible to\n // the PackageInfo generated by previous versions of electron-builder.\n delete packageInfo.ChildBundles\n\n if (options.isRelocatable != null) {\n packageInfo.BundleIsRelocatable = options.isRelocatable\n }\n\n if (options.isVersionChecked != null) {\n packageInfo.BundleIsVersionChecked = options.isVersionChecked\n }\n\n if (options.hasStrictIdentifier != null) {\n packageInfo.BundleHasStrictIdentifier = options.hasStrictIdentifier\n }\n\n if (options.overwriteAction != null) {\n packageInfo.BundleOverwriteAction = options.overwriteAction\n }\n }\n\n // now build the package\n const args = [\"--root\", rootPath, \"--identifier\", this.packager.appInfo.id, \"--component-plist\", propertyListOutputFile]\n\n use(this.options.installLocation || \"/Applications\", it => args.push(\"--install-location\", it))\n\n // Pass the version explicitly — macOS 15+ pkgbuild no longer infers it from the bundle\n const pkgVersion = await resolvePkgBuildVersion(appPath, this.packager.appInfo.version)\n args.push(\"--version\", pkgVersion)\n\n const scriptsDir = resolveScriptsDir(this.packager.buildResourcesDir, options.scripts)\n if (scriptsDir && (await statOrNull(scriptsDir))?.isDirectory()) {\n const dirContents = readdirSync(scriptsDir)\n dirContents.forEach(name => {\n if (name.includes(\"preinstall\")) {\n packageInfo.BundlePreInstallScriptPath = name\n } else if (name.includes(\"postinstall\")) {\n packageInfo.BundlePostInstallScriptPath = name\n }\n })\n args.push(\"--scripts\", scriptsDir)\n }\n if (plistInfo.length > 0) {\n await savePlistFile(propertyListOutputFile, plistInfo)\n }\n\n args.push(packageOutputFile)\n\n await exec(\"pkgbuild\", args)\n }\n}\n\nexport function prepareProductBuildArgs(identity: Identity | null, keychain: string | Nullish): Array<string> {\n const args: Array<string> = []\n if (identity != null) {\n args.push(\"--sign\", identity.hash!)\n if (keychain != null) {\n args.push(\"--keychain\", keychain)\n }\n }\n return args\n}\n\n/**\n * Resolves the version string to pass as `--version` to pkgbuild.\n * Reads CFBundleShortVersionString from the app bundle's Info.plist (what pkgbuild\n * previously inferred automatically), falling back to the appInfo version.\n */\nexport async function resolvePkgBuildVersion(appPath: string, fallback: string): Promise<string> {\n const infoPlistPath = path.join(appPath, \"Contents\", \"Info.plist\")\n try {\n const plist = await parsePlistFile<PlistObject>(infoPlistPath)\n const version = plist.CFBundleShortVersionString\n return typeof version === \"string\" && version.length > 0 ? version : fallback\n } catch {\n return fallback\n }\n}\n\n/**\n * Resolves the scripts directory path for pkgbuild.\n * Returns null when scripts is explicitly set to null (disabled).\n * Returns a custom path when scripts is a non-empty string.\n * Falls back to the default \"pkg-scripts\" directory otherwise.\n */\nexport function resolveScriptsDir(buildResourcesDir: string, scripts: string | null | undefined): string | null {\n if (scripts === null) {\n return null\n }\n return scripts != null ? path.resolve(buildResourcesDir, scripts) : path.join(buildResourcesDir, \"pkg-scripts\")\n}\n"]}
1
+ {"version":3,"file":"pkg.js","sourceRoot":"","sources":["../../../src/targets/mac/pkg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAe,MAAM,yBAAyB,CAAA;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAElE,MAAM,QAAQ,GAAG,wBAAwB,CAAA;AAEzC,+FAA+F;AAC/F,SAAS,wBAAwB,CAAC,IAAU;IAC1C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,IAAI,CAAC,KAAK;YACb,OAAO,CAAC,OAAO,CAAC,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG;YACX,OAAO,CAAC,QAAQ,CAAC,CAAA;QACnB,KAAK,IAAI,CAAC,SAAS;YACjB,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAC5B,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,CAAC,MAAM,CAAC,CAAA;QACjB;YACE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC9B,CAAC;AACH,CAAC;AAOD,kEAAkE;AAClE,wEAA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C;IAC7F,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;AACjH,CAAC","sourcesContent":["import { Arch, debug, exec, statOrNull, use } from \"builder-util\"\nimport { deepAssign, Nullish } from \"builder-util-runtime\"\nimport { readdirSync } from \"fs\"\nimport { readFile, unlink, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { filterCFBundleIdentifier } from \"../../appInfo.js\"\nimport { findIdentity } from \"../../codeSign/mac/macCodeSign.js\"\nimport type { Identity } from \"../../codeSign/mac/macCodeSign.js\"\nimport { Target } from \"../../core.js\"\nimport { MacPackager } from \"../../macPackager.js\"\nimport { PkgOptions } from \"../../options/pkgOptions.js\"\nimport { savePlistFile, parsePlistFile, PlistObject } from \"../../util/mac/plist.js\"\nimport { getNotLocalizedLicenseFile } from \"../../util/license.js\"\n\nconst certType = \"Developer ID Installer\"\n\n// Maps electron-builder Arch to Apple's architecture names for productbuild requirements plist\nfunction archToAppleArchitectures(arch: Arch): string[] {\n switch (arch) {\n case Arch.arm64:\n return [\"arm64\"]\n case Arch.x64:\n return [\"x86_64\"]\n case Arch.universal:\n return [\"arm64\", \"x86_64\"]\n case Arch.ia32:\n return [\"i386\"]\n default:\n return [\"arm64\", \"x86_64\"]\n }\n}\n\ntype ExtraPackages = {\n packagePath: string\n packages: string[]\n}\n\n// http://www.shanekirk.com/2013/10/creating-flat-packages-in-osx/\n// to use --scripts, we must build .app bundle separately using pkgbuild\n// productbuild --scripts doesn't work (because scripts in this case not added to our package)\n// https://github.com/electron-userland/@electron/osx-sign/issues/96#issuecomment-274986942\nexport class PkgTarget extends Target {\n readonly options: PkgOptions\n\n constructor(\n private readonly packager: MacPackager,\n readonly outDir: string\n ) {\n super(\"pkg\")\n this.options = deepAssign(\n {\n allowAnywhere: true,\n allowCurrentUserHome: true,\n allowRootDirectory: true,\n },\n packager.getOptionsForTarget<PkgOptions>(\"pkg\")\n )\n }\n\n async build(appPath: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const options = this.options\n const appInfo = packager.appInfo\n\n // pkg doesn't like not ASCII symbols (Could not open package to list files: /Volumes/test/t-gIjdGK/test-project-0/dist/Test App ßW-1.1.0.pkg)\n const artifactName = packager.expandArtifactNamePattern(options, \"pkg\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.emitArtifactBuildStarted({\n targetPresentableName: \"pkg\",\n file: artifactPath,\n arch,\n })\n\n const keychainFile = (await packager.codeSigningInfo.value).keychainFile\n\n const appOutDir = this.outDir\n // https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html\n const distInfoFile = path.join(appOutDir, \"distribution.xml\")\n\n const extraPackages = this.getExtraPackages()\n\n const innerPackageFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.pkg`)\n const componentPropertyListFile = path.join(appOutDir, `${filterCFBundleIdentifier(appInfo.id)}.plist`)\n const identity = (\n await Promise.all([\n findIdentity(certType, options.identity, keychainFile),\n this.customizeDistributionConfiguration(distInfoFile, appPath, extraPackages, arch),\n this.buildComponentPackage(appPath, componentPropertyListFile, innerPackageFile),\n ])\n )[0]\n\n if (identity == null && packager.forceCodeSigning) {\n throw new Error(`Cannot find valid \"${certType}\" to sign standalone installer, please see https://electron.build/docs/features/code-signing`)\n }\n\n const args = prepareProductBuildArgs(identity, keychainFile)\n args.push(\"--distribution\", distInfoFile)\n if (extraPackages) {\n args.push(\"--package-path\", extraPackages.packagePath)\n }\n args.push(artifactPath)\n use(options.productbuild, it => args.push(...(it as any)))\n await exec(\"productbuild\", args, {\n cwd: appOutDir,\n })\n await Promise.all([unlink(innerPackageFile), unlink(distInfoFile)])\n await packager.helper.notarizeIfProvided(artifactPath)\n await packager.emitArtifactBuildCompleted({\n file: artifactPath,\n target: this,\n arch,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"pkg\", arch),\n packager,\n })\n }\n\n private getExtraPackages(): ExtraPackages | null {\n const extraPkgsDir = this.options.extraPkgsDir\n if (extraPkgsDir == null) {\n return null\n }\n const packagePath = path.join(this.packager.buildResourcesDir, extraPkgsDir)\n let files: Array<string>\n try {\n files = readdirSync(packagePath)\n } catch (e: any) {\n if (e.code === \"ENOENT\") {\n return null\n } else {\n throw e\n }\n }\n const packages = files.filter(file => file.endsWith(\".pkg\"))\n if (packages.length === 0) {\n return null\n }\n return { packagePath, packages }\n }\n\n private async customizeDistributionConfiguration(distInfoFile: string, appPath: string, extraPackages: ExtraPackages | null, arch: Arch) {\n const options = this.options\n\n // Build requirements plist for productbuild to generate correct hostArchitectures and allowed-os-versions\n // This is the Apple-recommended way to specify architecture and OS requirements\n // See: man productbuild, section \"PRE-INSTALL REQUIREMENTS PROPERTY LIST\"\n const requirements: Record<string, any> = {}\n\n // Set architecture based on build target - productbuild will generate correct hostArchitectures in distribution XML\n // On macOS Big Sur+, productbuild defaults to both arm64 and x86_64 unless we specify otherwise\n requirements.arch = archToAppleArchitectures(arch)\n\n // Set minimum OS version - productbuild will generate allowed-os-versions in distribution XML\n const minimumSystemVersion = this.packager.platformOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n requirements.os = [minimumSystemVersion]\n }\n\n const requirementsPlistFile = await this.packager.tempDirManager.getTempFile({ suffix: \".plist\", prefix: \"productbuild-requirements\" })\n await savePlistFile(requirementsPlistFile, requirements)\n\n const args = [\"--synthesize\", \"--product\", requirementsPlistFile, \"--component\", appPath]\n if (extraPackages) {\n extraPackages.packages.forEach(pkg => {\n args.push(\"--package\", path.join(extraPackages.packagePath, pkg))\n })\n }\n args.push(distInfoFile)\n await exec(\"productbuild\", args, {\n cwd: this.outDir,\n })\n\n let distInfo = await readFile(distInfoFile, \"utf-8\")\n\n if (options.mustClose != null && options.mustClose.length !== 0) {\n const startContent = ` <pkg-ref id=\"${this.packager.appInfo.id}\">\\n <must-close>\\n`\n const endContent = \" </must-close>\\n </pkg-ref>\\n</installer-gui-script>\"\n let mustCloseContent = \"\"\n options.mustClose.forEach(appId => {\n mustCloseContent += ` <app id=\"${appId}\"/>\\n`\n })\n distInfo = distInfo.replace(\"</installer-gui-script>\", `${startContent}${mustCloseContent}${endContent}`)\n }\n\n const insertIndex = distInfo.lastIndexOf(\"</installer-gui-script>\")\n distInfo =\n distInfo.substring(0, insertIndex) +\n ` <domains enable_anywhere=\"${options.allowAnywhere}\" enable_currentUserHome=\"${options.allowCurrentUserHome}\" enable_localSystem=\"${options.allowRootDirectory}\" />\\n` +\n distInfo.substring(insertIndex)\n\n if (options.background != null) {\n const background = await this.packager.getResource(options.background.file)\n if (background != null) {\n const alignment = options.background.alignment || \"center\"\n // noinspection SpellCheckingInspection\n const scaling = options.background.scaling || \"tofit\"\n distInfo = distInfo.substring(0, insertIndex) + ` <background file=\"${background}\" alignment=\"${alignment}\" scaling=\"${scaling}\"/>\\n` + distInfo.substring(insertIndex)\n distInfo =\n distInfo.substring(0, insertIndex) + ` <background-darkAqua file=\"${background}\" alignment=\"${alignment}\" scaling=\"${scaling}\"/>\\n` + distInfo.substring(insertIndex)\n }\n }\n\n const welcome = await this.packager.getResource(options.welcome)\n if (welcome != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <welcome file=\"${welcome}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n const license = await getNotLocalizedLicenseFile(options.license, this.packager)\n if (license != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <license file=\"${license}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n const conclusion = await this.packager.getResource(options.conclusion)\n if (conclusion != null) {\n distInfo = distInfo.substring(0, insertIndex) + ` <conclusion file=\"${conclusion}\"/>\\n` + distInfo.substring(insertIndex)\n }\n\n debug(distInfo)\n await writeFile(distInfoFile, distInfo)\n }\n\n private async buildComponentPackage(appPath: string, propertyListOutputFile: string, packageOutputFile: string) {\n const options = this.options\n const rootPath = path.dirname(appPath)\n\n // first produce a component plist template\n await exec(\"pkgbuild\", [\"--analyze\", \"--root\", rootPath, propertyListOutputFile])\n\n // process the template plist\n const plistInfo = (await parsePlistFile<PlistObject[]>(propertyListOutputFile)).filter((it: PlistObject) => it.RootRelativeBundlePath !== \"Electron.dSYM\")\n let packageInfo: any = {}\n if (plistInfo.length > 0) {\n packageInfo = plistInfo[0]\n\n // ChildBundles lists all of electron binaries within the .app.\n // There is no particular reason for removing that key, except to be as close as possible to\n // the PackageInfo generated by previous versions of electron-builder.\n delete packageInfo.ChildBundles\n\n if (options.isRelocatable != null) {\n packageInfo.BundleIsRelocatable = options.isRelocatable\n }\n\n if (options.isVersionChecked != null) {\n packageInfo.BundleIsVersionChecked = options.isVersionChecked\n }\n\n if (options.hasStrictIdentifier != null) {\n packageInfo.BundleHasStrictIdentifier = options.hasStrictIdentifier\n }\n\n if (options.overwriteAction != null) {\n packageInfo.BundleOverwriteAction = options.overwriteAction\n }\n }\n\n // now build the package\n const args = [\"--root\", rootPath, \"--identifier\", this.packager.appInfo.id, \"--component-plist\", propertyListOutputFile]\n\n use(this.options.installLocation || \"/Applications\", it => args.push(\"--install-location\", it))\n\n // Pass the version explicitly — macOS 15+ pkgbuild no longer infers it from the bundle\n const pkgVersion = await resolvePkgBuildVersion(appPath, this.packager.appInfo.version)\n args.push(\"--version\", pkgVersion)\n\n const scriptsDir = resolveScriptsDir(this.packager.buildResourcesDir, options.scripts)\n if (scriptsDir && (await statOrNull(scriptsDir))?.isDirectory()) {\n const dirContents = readdirSync(scriptsDir)\n dirContents.forEach(name => {\n if (name.includes(\"preinstall\")) {\n packageInfo.BundlePreInstallScriptPath = name\n } else if (name.includes(\"postinstall\")) {\n packageInfo.BundlePostInstallScriptPath = name\n }\n })\n args.push(\"--scripts\", scriptsDir)\n }\n if (plistInfo.length > 0) {\n await savePlistFile(propertyListOutputFile, plistInfo)\n }\n\n args.push(packageOutputFile)\n\n await exec(\"pkgbuild\", args)\n }\n}\n\nexport function prepareProductBuildArgs(identity: Identity | null, keychain: string | Nullish): Array<string> {\n const args: Array<string> = []\n if (identity != null) {\n args.push(\"--sign\", identity.hash!)\n if (keychain != null) {\n args.push(\"--keychain\", keychain)\n }\n }\n return args\n}\n\n/**\n * Resolves the version string to pass as `--version` to pkgbuild.\n * Reads CFBundleShortVersionString from the app bundle's Info.plist (what pkgbuild\n * previously inferred automatically), falling back to the appInfo version.\n */\nexport async function resolvePkgBuildVersion(appPath: string, fallback: string): Promise<string> {\n const infoPlistPath = path.join(appPath, \"Contents\", \"Info.plist\")\n try {\n const plist = await parsePlistFile<PlistObject>(infoPlistPath)\n const version = plist.CFBundleShortVersionString\n return typeof version === \"string\" && version.length > 0 ? version : fallback\n } catch {\n return fallback\n }\n}\n\n/**\n * Resolves the scripts directory path for pkgbuild.\n * Returns null when scripts is explicitly set to null (disabled).\n * Returns a custom path when scripts is a non-empty string.\n * Falls back to the default \"pkg-scripts\" directory otherwise.\n */\nexport function resolveScriptsDir(buildResourcesDir: string, scripts: string | null | undefined): string | null {\n if (scripts === null) {\n return null\n }\n return scripts != null ? path.resolve(buildResourcesDir, scripts) : path.join(buildResourcesDir, \"pkg-scripts\")\n}\n"]}