app-builder-lib 27.0.0-alpha.2 → 27.0.0-alpha.4
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.
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js.map +1 -1
- package/dist/asar/asarFileChecker.d.ts +4 -2
- package/dist/asar/asarFileChecker.d.ts.map +1 -1
- package/dist/asar/asarFileChecker.js +2 -3
- package/dist/asar/asarFileChecker.js.map +1 -1
- package/dist/codeSign/certInfo.d.ts +14 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -1
- package/dist/codeSign/certInfo.js +49 -0
- package/dist/codeSign/certInfo.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +40 -14
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
- package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/hsmSignManager.js +50 -0
- package/dist/codeSign/win/hsmSignManager.js.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.js +82 -0
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
- package/dist/codeSign/{signManager.d.ts → win/signManager.d.ts} +8 -6
- package/dist/codeSign/win/signManager.d.ts.map +1 -0
- package/dist/codeSign/win/signManager.js +19 -0
- package/dist/codeSign/win/signManager.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +71 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js +414 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +9 -4
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +9 -3
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +130 -36
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.js +3 -363
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
- package/dist/configuration.d.ts +22 -123
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +0 -2
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +15 -27
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/injectFFMPEG.js +2 -2
- package/dist/electron/injectFFMPEG.js.map +1 -1
- package/dist/electron/mac/electronMac.js +10 -8
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/win/electronWin.js +1 -2
- package/dist/electron/win/electronWin.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +3 -3
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +2 -2
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +19 -10
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +149 -121
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +9 -2
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +4 -2
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +13 -23
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +52 -122
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +48 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +216 -17
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/types.d.ts +2 -0
- package/dist/node-module-collector/types.d.ts.map +1 -1
- package/dist/node-module-collector/types.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +137 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -0
- package/dist/options/FuseOptionsV1.js +2 -0
- package/dist/options/FuseOptionsV1.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +0 -10
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +93 -126
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +137 -63
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js +12 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.js +1 -1
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +5 -2
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +16 -13
- package/dist/platformPackager.js.map +1 -1
- package/dist/targets/ArchiveTarget.js +2 -2
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +10 -2
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +25 -6
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +4 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +6 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +25 -3
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +14 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +38 -59
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +8 -9
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +4 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +11 -4
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +5 -11
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/launcherScript.d.ts +32 -0
- package/dist/targets/linux/launcherScript.d.ts.map +1 -0
- package/dist/targets/linux/launcherScript.js +24 -0
- package/dist/targets/linux/launcherScript.js.map +1 -0
- package/dist/targets/linux/snap/core24.d.ts +2 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +48 -8
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +2 -2
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +9 -10
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapCommand.js +21 -0
- package/dist/targets/linux/snap/snapCommand.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +12 -12
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +72 -67
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +4 -4
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +9 -9
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +8 -11
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +5 -5
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +2 -2
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +2 -2
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/toolsets/custom.d.ts +1 -0
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +19 -8
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +11 -3
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +36 -0
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +84 -30
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +20 -12
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +9 -4
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/archCompatibility.d.ts +42 -0
- package/dist/util/archCompatibility.d.ts.map +1 -0
- package/dist/util/archCompatibility.js +202 -0
- package/dist/util/archCompatibility.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +1 -1
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +8 -25
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -87
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +0 -3
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +0 -9
- package/dist/util/flags.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +38 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -0
- package/dist/util/{yarn.js → installOrRebuild.js} +65 -14
- package/dist/util/installOrRebuild.js.map +1 -0
- package/dist/util/langs.d.ts.map +1 -1
- package/dist/util/langs.js +1 -0
- package/dist/util/langs.js.map +1 -1
- package/dist/util/license.d.ts.map +1 -1
- package/dist/util/license.js +4 -1
- package/dist/util/license.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts +2 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +40 -58
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +47 -0
- package/dist/util/streamSpawnToFile.d.ts.map +1 -0
- package/dist/util/streamSpawnToFile.js +110 -0
- package/dist/util/streamSpawnToFile.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -1
- package/dist/util/toolsetLock.js +31 -5
- package/dist/util/toolsetLock.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +13 -2
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/vm/vm.d.ts.map +1 -1
- package/dist/vm/vm.js +4 -1
- package/dist/vm/vm.js.map +1 -1
- package/dist/winPackager.d.ts +1 -2
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +17 -22
- package/dist/winPackager.js.map +1 -1
- package/package.json +15 -14
- package/scheme.json +486 -439
- package/templates/appx/appxmanifest.xml +1 -2
- package/templates/nsis/assistedMessages.yml +17 -0
- package/templates/nsis/messages.yml +5 -0
- package/dist/codeSign/signManager.d.ts.map +0 -1
- package/dist/codeSign/signManager.js +0 -2
- package/dist/codeSign/signManager.js.map +0 -1
- package/dist/util/yarn.d.ts +0 -23
- package/dist/util/yarn.d.ts.map +0 -1
- package/dist/util/yarn.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACvJ,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAC/E,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,gBA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C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA6E;IACjH,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IACzD,uBAAuB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA;IACzD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1C,IAAI,OAAO,GAAG,mHAAmH,SAAS,GAAG,cAAc,GAAG,CAAA;IAC9J,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,IAAI,OAAO,CAAA;IAClB,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { replaceDefault as _replaceDefault, Arch, copyDir, exec, log, serializeToYaml, toLinuxArchString, validateShellEmbeddable } from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { chmod, copyFile, mkdir, readdir, rename, rm, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SnapOptionsLegacy } from \"../../../options/SnapOptions.js\"\nimport { getAppImageTools } from \"../../../toolsets/appimage.js\"\nimport { downloadBuilderToolset } from \"../../../util/electronGet.js\"\nimport { isSnapDestructiveMode } from \"../../../util/flags.js\"\nimport { getTemplatePath } from \"../../../util/pathManager.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { SnapcraftYAML } from \"./snapcraft.js\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder.js\"\nconst { outputFile, readFile } = _fsExtra\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptionsLegacy & { base: \"core18\" | \"core20\" | \"core22\" }> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<void> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // Best-effort: remove chrome-sandbox from app dir before mksquashfs scans it.\n await rm(path.join(appOutDir, \"chrome-sandbox\"), { force: true })\n\n // chmod -R g-s to avoid setgid bits in final image\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await exec(\"chmod\", [\"-R\", \"g-s\", dir]).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const { mksquashfs } = await getAppImageTools(\"0.0.0\", snapArch, this.packager.buildResourcesDir)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfs, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = isSnapDestructiveMode()\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n await exec(\"snapcraft\", snapArgs, {\n cwd: stageDir,\n env: { ...process.env, SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/** Single-quote a shell argument, escaping any embedded single quotes. */\nexport function shellQuote(arg: string): string {\n return \"'\" + arg.replace(/'/g, \"'\\\\''\") + \"'\"\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n let content = `#!/bin/bash -e\\nexec \"$SNAP/desktop-init.sh\" \"$SNAP/desktop-common.sh\" \"$SNAP/desktop-gnome-specific.sh\" \"$SNAP/${appPrefix}${executableName}\"`\n if (extraAppArgs.length > 0) {\n content += \" \" + extraAppArgs.map(shellQuote).join(\" \")\n }\n content += ' \"$@\"'\n return content\n}\n"]}
|
|
1
|
+
{"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACvJ,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAC/E,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AA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;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA6E;IACjH,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IACzD,uBAAuB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA;IACzD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1C,OAAO,mBAAmB,CAAC;QACzB,OAAO,EAAE,gBAAgB;QACzB,OAAO,EAAE,CAAC,yBAAyB,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,UAAU,SAAS,GAAG,cAAc,GAAG,CAAC;QAC/I,IAAI,EAAE,YAAY;KACnB,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { replaceDefault as _replaceDefault, Arch, copyDir, exec, log, serializeToYaml, toLinuxArchString, validateShellEmbeddable } from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { chmod, copyFile, mkdir, readdir, rename, rm, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SnapOptionsLegacy } from \"../../../options/SnapOptions.js\"\nimport { getAppImageTools } from \"../../../toolsets/appimage.js\"\nimport { downloadBuilderToolset } from \"../../../util/electronGet.js\"\nimport { isSnapDestructiveMode } from \"../../../util/flags.js\"\nimport { getTemplatePath } from \"../../../util/pathManager.js\"\nimport { buildLauncherScript } from \"../launcherScript.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { shellQuote } from \"./snapCommand.js\"\nimport { SnapcraftYAML } from \"./snapcraft.js\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder.js\"\nconst { outputFile, readFile } = _fsExtra\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptionsLegacy & { base: \"core18\" | \"core20\" | \"core22\" }> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<void> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, this.packager.executableName + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // Best-effort: remove chrome-sandbox from app dir before mksquashfs scans it.\n await rm(path.join(appOutDir, \"chrome-sandbox\"), { force: true })\n\n // chmod -R g-s to avoid setgid bits in final image\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await exec(\"chmod\", [\"-R\", \"g-s\", dir]).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const { mksquashfs } = await getAppImageTools(\"0.0.0\", snapArch, this.packager.buildResourcesDir)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfs, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = isSnapDestructiveMode()\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n await exec(\"snapcraft\", snapArgs, {\n cwd: stageDir,\n env: { ...process.env, SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n return buildLauncherScript({\n shebang: \"#!/bin/bash -e\",\n command: ['\"$SNAP/desktop-init.sh\"', '\"$SNAP/desktop-common.sh\"', '\"$SNAP/desktop-gnome-specific.sh\"', `\"$SNAP/${appPrefix}${executableName}\"`],\n args: extraAppArgs,\n })\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { shellQuote } from "../launcherScript.js";
|
|
2
|
+
export { shellQuote };
|
|
3
|
+
/**
|
|
4
|
+
* Builds the contents of the launcher script that execs `$SNAP/app/<execName>` with the given args.
|
|
5
|
+
* `$@` is forwarded so launch-time arguments still reach the app. The executable name is validated
|
|
6
|
+
* against shell metacharacters and each arg is single-quoted, so embedded characters (e.g. `=`, quotes)
|
|
7
|
+
* are passed literally.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildSnapCommandLauncherScript(opts: {
|
|
10
|
+
execName: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
}): string;
|
|
13
|
+
//# sourceMappingURL=snapCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapCommand.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAStE,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAIjG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { validateShellEmbeddable } from "builder-util";
|
|
2
|
+
import { buildLauncherScript, shellQuote } from "../launcherScript.js";
|
|
3
|
+
// snapd restricts the value of `apps.<app-name>.command` to alphanumeric characters, spaces, and
|
|
4
|
+
// `/ . _ # : $ -`, and splits it on whitespace. Rather than encode those rules per-arg, core24
|
|
5
|
+
// always routes the command through a launcher script (see buildSnapCommandLauncherScript), which
|
|
6
|
+
// sidesteps the character restrictions entirely and keeps a single, uniform command path.
|
|
7
|
+
// See: https://documentation.ubuntu.com/snapcraft/stable/reference/snapcraft-yaml/#apps.%3Capp-name%3E.command
|
|
8
|
+
// Re-exported for backwards compatibility with existing imports/tests.
|
|
9
|
+
export { shellQuote };
|
|
10
|
+
/**
|
|
11
|
+
* Builds the contents of the launcher script that execs `$SNAP/app/<execName>` with the given args.
|
|
12
|
+
* `$@` is forwarded so launch-time arguments still reach the app. The executable name is validated
|
|
13
|
+
* against shell metacharacters and each arg is single-quoted, so embedded characters (e.g. `=`, quotes)
|
|
14
|
+
* are passed literally.
|
|
15
|
+
*/
|
|
16
|
+
export function buildSnapCommandLauncherScript(opts) {
|
|
17
|
+
const { execName, args } = opts;
|
|
18
|
+
validateShellEmbeddable(execName, "executableName");
|
|
19
|
+
return buildLauncherScript({ command: [`"$SNAP/app/${execName}"`], args });
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=snapCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapCommand.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtE,iGAAiG;AACjG,+FAA+F;AAC/F,kGAAkG;AAClG,0FAA0F;AAC1F,+GAA+G;AAE/G,uEAAuE;AACvE,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,IAA0C;IACvF,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IAC/B,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;IACnD,OAAO,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,cAAc,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AAC5E,CAAC","sourcesContent":["import { validateShellEmbeddable } from \"builder-util\"\nimport { buildLauncherScript, shellQuote } from \"../launcherScript.js\"\n\n// snapd restricts the value of `apps.<app-name>.command` to alphanumeric characters, spaces, and\n// `/ . _ # : $ -`, and splits it on whitespace. Rather than encode those rules per-arg, core24\n// always routes the command through a launcher script (see buildSnapCommandLauncherScript), which\n// sidesteps the character restrictions entirely and keeps a single, uniform command path.\n// See: https://documentation.ubuntu.com/snapcraft/stable/reference/snapcraft-yaml/#apps.%3Capp-name%3E.command\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n/**\n * Builds the contents of the launcher script that execs `$SNAP/app/<execName>` with the given args.\n * `$@` is forwarded so launch-time arguments still reach the app. The executable name is validated\n * against shell metacharacters and each arg is single-quoted, so embedded characters (e.g. `=`, quotes)\n * are passed literally.\n */\nexport function buildSnapCommandLauncherScript(opts: { execName: string; args: string[] }): string {\n const { execName, args } = opts\n validateShellEmbeddable(execName, \"executableName\")\n return buildLauncherScript({ command: [`\"$SNAP/app/${execName}\"`], args })\n}\n"]}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { PerFileSignOptions,
|
|
3
|
-
import type { Identity } from "@electron/osx-sign/dist/cjs/util-identities";
|
|
1
|
+
import { type NotarizeOptions } from "@electron/notarize";
|
|
2
|
+
import type { PerFileSignOptions, SignOptions } from "@electron/osx-sign";
|
|
4
3
|
import { Arch } from "builder-util";
|
|
5
4
|
import { Nullish } from "builder-util-runtime";
|
|
6
|
-
import { CertType } from "../../codeSign/mac/macCodeSign.js";
|
|
5
|
+
import { CertType, Identity } from "../../codeSign/mac/macCodeSign.js";
|
|
7
6
|
import type { MacPackager } from "../../macPackager.js";
|
|
8
|
-
import {
|
|
7
|
+
import { ElectronSignOptions, MasConfiguration } from "../../options/macOptions.js";
|
|
9
8
|
export type PlatformType = "mas" | "mas-dev" | "mac";
|
|
10
9
|
export declare class MacTargetHelper {
|
|
11
10
|
private packager;
|
|
12
11
|
constructor(packager: MacPackager);
|
|
13
12
|
handleNullIdentity(): boolean;
|
|
14
|
-
findSigningIdentity(
|
|
15
|
-
buildSignOptions(appPath: string, identity: Identity,
|
|
16
|
-
createMasInstaller(appPath: string, outDir: string, masOptions: MasConfiguration, keychainFile: string | Nullish,
|
|
17
|
-
getOptionsForFile(appPath: string,
|
|
18
|
-
static getCertificateTypes(
|
|
13
|
+
findSigningIdentity(targetPlatform: PlatformType, qualifier: string | undefined, keychainFile: string | Nullish, hasCustomSign: boolean, signOpts: ElectronSignOptions | null | undefined): Promise<Identity | null>;
|
|
14
|
+
buildSignOptions(appPath: string, identity: Identity, config: ElectronSignOptions | null | undefined, keychainFile: string | Nullish, arch: Arch, targetPlatform: PlatformType): Promise<SignOptions>;
|
|
15
|
+
createMasInstaller(appPath: string, outDir: string, masOptions: MasConfiguration, keychainFile: string | Nullish, targetPlatform: PlatformType, arch: Arch, identityQualifier?: string | null): Promise<void>;
|
|
16
|
+
getOptionsForFile(appPath: string, targetPlatform: PlatformType, customSignOptions: ElectronSignOptions | Nullish): Promise<(filePath: string) => PerFileSignOptions>;
|
|
17
|
+
static getCertificateTypes(targetPlatform: PlatformType): CertType[];
|
|
19
18
|
static isMasTarget(targetName: string): boolean;
|
|
19
|
+
static isMasDevelopment(targetName: string): boolean;
|
|
20
20
|
static getPlatformTypeFromTarget(targetName: string): PlatformType;
|
|
21
21
|
/**
|
|
22
22
|
* Returns true when hardened runtime will be active for signing.
|
|
23
23
|
* For non-MAS builds it defaults to on; for MAS it defaults to off.
|
|
24
24
|
*/
|
|
25
|
-
static isHardenedRuntimeEnabledForSigning(
|
|
25
|
+
static isHardenedRuntimeEnabledForSigning(targetPlatform: PlatformType, hardenedRuntime: boolean | null | undefined): boolean;
|
|
26
26
|
static assertSafePathForCommandUsage(pathValue: string, description: string): void;
|
|
27
|
-
static getNotarizeOptions(appPath: string):
|
|
27
|
+
static getNotarizeOptions(appPath: string): NotarizeOptions | undefined;
|
|
28
28
|
notarizeIfProvided(appPath: string): Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=MacTargetHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MacTargetHelper.d.ts","sourceRoot":"","sources":["../../../src/targets/mac/MacTargetHelper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
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;AAGnF,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;AAEpD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,WAAW;IAEzC,kB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EAAE,eAAe,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;IAI7H,MAAM,CAAC,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAMlF,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAyCjE,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAczD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { notarize } from "@electron/notarize";
|
|
1
2
|
import { Arch, InvalidConfigurationError, log, statOrNull } from "builder-util";
|
|
2
|
-
import { dynamicImport } from "../../util/dynamicImport.js";
|
|
3
3
|
import * as path from "path";
|
|
4
|
-
import { findIdentity, reportError } from "../../codeSign/mac/macCodeSign.js";
|
|
4
|
+
import { findIdentity, Identity, reportError } from "../../codeSign/mac/macCodeSign.js";
|
|
5
5
|
import { getTemplatePath } from "../../util/pathManager.js";
|
|
6
6
|
export class MacTargetHelper {
|
|
7
7
|
constructor(packager) {
|
|
@@ -14,8 +14,9 @@ export class MacTargetHelper {
|
|
|
14
14
|
log.info({ reason: "identity explicitly is set to null" }, "skipped macOS code signing");
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
-
async findSigningIdentity(
|
|
18
|
-
const
|
|
17
|
+
async findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts) {
|
|
18
|
+
const isMas = MacTargetHelper.isMasTarget(targetPlatform);
|
|
19
|
+
const certificateTypes = MacTargetHelper.getCertificateTypes(targetPlatform);
|
|
19
20
|
let identity = null;
|
|
20
21
|
for (const certificateType of certificateTypes) {
|
|
21
22
|
identity = await findIdentity(certificateType, qualifier, keychainFile);
|
|
@@ -24,20 +25,13 @@ export class MacTargetHelper {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
if (identity == null) {
|
|
27
|
-
|
|
28
|
-
identity = await findIdentity("Mac Developer", qualifier, keychainFile);
|
|
29
|
-
if (identity != null) {
|
|
30
|
-
log.warn("Mac Developer is used to sign app — it is only for development and testing, not for production");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const noIdentity = !config.sign && identity == null;
|
|
28
|
+
const noIdentity = !hasCustomSign;
|
|
34
29
|
if (qualifier === "-") {
|
|
35
|
-
if (MacTargetHelper.isHardenedRuntimeEnabledForSigning(
|
|
30
|
+
if (MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, signOpts?.hardenedRuntime)) {
|
|
36
31
|
log.warn(null, "ad-hoc signing with hardenedRuntime enabled requires the com.apple.security.cs.disable-library-validation entitlement " +
|
|
37
32
|
"to prevent app launch failures due to library validation. See https://electron.build/code-signing for details.");
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
identity = new IdentityClass("-", undefined);
|
|
34
|
+
identity = new Identity("-", undefined);
|
|
41
35
|
}
|
|
42
36
|
else if (noIdentity) {
|
|
43
37
|
await reportError(isMas, certificateTypes, qualifier, keychainFile, this.packager.forceCodeSigning);
|
|
@@ -46,27 +40,11 @@ export class MacTargetHelper {
|
|
|
46
40
|
}
|
|
47
41
|
return identity;
|
|
48
42
|
}
|
|
49
|
-
async buildSignOptions(appPath, identity,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else if (filter != null) {
|
|
57
|
-
filter = filter.length === 0 ? null : [filter];
|
|
58
|
-
}
|
|
59
|
-
const filterRe = filter == null
|
|
60
|
-
? null
|
|
61
|
-
: filter.map(it => {
|
|
62
|
-
try {
|
|
63
|
-
return new RegExp(it);
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
throw new InvalidConfigurationError(`Invalid regex filter pattern: ${it}. ${e.message}`);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
let binaries = config.binaries || undefined;
|
|
43
|
+
async buildSignOptions(appPath, identity, config, keychainFile, arch, targetPlatform) {
|
|
44
|
+
const isMas = MacTargetHelper.isMasTarget(targetPlatform);
|
|
45
|
+
// `type` is derived from the build flavor, never from user config: mas-dev → development, otherwise distribution.
|
|
46
|
+
const type = MacTargetHelper.isMasDevelopment(targetPlatform) ? "development" : "distribution";
|
|
47
|
+
let binaries = config?.binaries || undefined;
|
|
70
48
|
if (binaries) {
|
|
71
49
|
// Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.
|
|
72
50
|
binaries = (await Promise.all(binaries.flatMap(async (destination) => {
|
|
@@ -80,6 +58,25 @@ export class MacTargetHelper {
|
|
|
80
58
|
}))).flat();
|
|
81
59
|
log.info({ binaries, arch: arch == null ? null : Arch[arch] }, "signing additional user-defined binaries for arch");
|
|
82
60
|
}
|
|
61
|
+
let filter = config?.ignore;
|
|
62
|
+
if (Array.isArray(filter)) {
|
|
63
|
+
if (filter.length == 0) {
|
|
64
|
+
filter = undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (typeof filter === "string") {
|
|
68
|
+
filter = filter.length === 0 ? undefined : [filter];
|
|
69
|
+
}
|
|
70
|
+
const filterRe = typeof filter === "function"
|
|
71
|
+
? null
|
|
72
|
+
: filter?.map(it => {
|
|
73
|
+
try {
|
|
74
|
+
return new RegExp(it);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
throw new InvalidConfigurationError(`Invalid regex filter pattern: ${it}. ${e.message}`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
83
80
|
return {
|
|
84
81
|
identityValidation: false,
|
|
85
82
|
// https://github.com/electron-userland/electron-builder/issues/1699
|
|
@@ -92,6 +89,9 @@ export class MacTargetHelper {
|
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
}
|
|
92
|
+
if (typeof filter === "function" && filter(file)) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
95
|
return (file.endsWith(".kext") ||
|
|
96
96
|
file.startsWith("/Contents/PlugIns", appPath.length) ||
|
|
97
97
|
file.includes("/node_modules/puppeteer/.local-chromium") ||
|
|
@@ -110,15 +110,15 @@ export class MacTargetHelper {
|
|
|
110
110
|
keychain: keychainFile || undefined,
|
|
111
111
|
binaries,
|
|
112
112
|
// https://github.com/electron-userland/electron-builder/issues/1480
|
|
113
|
-
strictVerify: config
|
|
114
|
-
preAutoEntitlements: config
|
|
115
|
-
optionsForFile: await this.getOptionsForFile(appPath,
|
|
116
|
-
provisioningProfile: config
|
|
113
|
+
strictVerify: config?.strictVerify,
|
|
114
|
+
preAutoEntitlements: config?.preAutoEntitlements,
|
|
115
|
+
optionsForFile: await this.getOptionsForFile(appPath, targetPlatform, config),
|
|
116
|
+
provisioningProfile: config?.provisioningProfile || undefined,
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
async createMasInstaller(appPath, outDir, masOptions, keychainFile,
|
|
120
|
-
const certType =
|
|
121
|
-
const masInstallerIdentity = await findIdentity(certType,
|
|
119
|
+
async createMasInstaller(appPath, outDir, masOptions, keychainFile, targetPlatform, arch, identityQualifier) {
|
|
120
|
+
const certType = MacTargetHelper.isMasDevelopment(targetPlatform) ? "Mac Developer" : "3rd Party Mac Developer Installer";
|
|
121
|
+
const masInstallerIdentity = await findIdentity(certType, identityQualifier, keychainFile);
|
|
122
122
|
if (masInstallerIdentity == null) {
|
|
123
123
|
throw new InvalidConfigurationError(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/code-signing`);
|
|
124
124
|
}
|
|
@@ -137,12 +137,13 @@ export class MacTargetHelper {
|
|
|
137
137
|
packager: this.packager,
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
async getOptionsForFile(appPath,
|
|
140
|
+
async getOptionsForFile(appPath, targetPlatform, customSignOptions) {
|
|
141
|
+
const isMas = MacTargetHelper.isMasTarget(targetPlatform);
|
|
141
142
|
const resourceList = await this.packager.resourceList;
|
|
142
143
|
const entitlementsSuffix = isMas ? "mas" : "mac";
|
|
143
144
|
const getEntitlements = (filePath) => {
|
|
144
145
|
if (filePath === appPath) {
|
|
145
|
-
if (customSignOptions
|
|
146
|
+
if (customSignOptions?.entitlements) {
|
|
146
147
|
return customSignOptions.entitlements;
|
|
147
148
|
}
|
|
148
149
|
const p = `entitlements.${entitlementsSuffix}.plist`;
|
|
@@ -154,9 +155,9 @@ export class MacTargetHelper {
|
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
if (filePath.includes("Library/LoginItems")) {
|
|
157
|
-
return customSignOptions
|
|
158
|
+
return customSignOptions?.entitlementsLoginHelper;
|
|
158
159
|
}
|
|
159
|
-
if (customSignOptions
|
|
160
|
+
if (customSignOptions?.entitlementsInherit) {
|
|
160
161
|
return customSignOptions.entitlementsInherit;
|
|
161
162
|
}
|
|
162
163
|
const p = `entitlements.${entitlementsSuffix}.inherit.plist`;
|
|
@@ -167,44 +168,50 @@ export class MacTargetHelper {
|
|
|
167
168
|
return getTemplatePath("entitlements.mac.plist");
|
|
168
169
|
}
|
|
169
170
|
};
|
|
170
|
-
const requirements = isMas ||
|
|
171
|
-
// harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)
|
|
172
|
-
const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false;
|
|
171
|
+
const requirements = isMas || customSignOptions?.requirements == null ? undefined : await this.packager.getResource(customSignOptions.requirements);
|
|
173
172
|
return (filePath) => {
|
|
174
173
|
const entitlements = getEntitlements(filePath);
|
|
175
174
|
return {
|
|
176
175
|
entitlements: entitlements || undefined,
|
|
177
|
-
hardenedRuntime: hardenedRuntime ?? undefined,
|
|
178
|
-
timestamp: customSignOptions
|
|
176
|
+
hardenedRuntime: MacTargetHelper.isHardenedRuntimeEnabledForSigning(targetPlatform, customSignOptions?.hardenedRuntime) ?? undefined,
|
|
177
|
+
timestamp: customSignOptions?.timestamp || undefined,
|
|
179
178
|
requirements: requirements || undefined,
|
|
180
|
-
additionalArguments: customSignOptions
|
|
179
|
+
additionalArguments: customSignOptions?.additionalArguments || undefined,
|
|
181
180
|
};
|
|
182
181
|
};
|
|
183
182
|
}
|
|
184
|
-
static getCertificateTypes(
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
static getCertificateTypes(targetPlatform) {
|
|
184
|
+
switch (targetPlatform) {
|
|
185
|
+
case "mas-dev":
|
|
186
|
+
return ["Mac Developer", "Apple Development"];
|
|
187
|
+
case "mas":
|
|
188
|
+
return ["Apple Distribution", "3rd Party Mac Developer Application"];
|
|
189
|
+
default:
|
|
190
|
+
return ["Developer ID Application"];
|
|
187
191
|
}
|
|
188
|
-
return isMas ? ["Apple Distribution", "3rd Party Mac Developer Application"] : ["Developer ID Application"];
|
|
189
192
|
}
|
|
190
193
|
static isMasTarget(targetName) {
|
|
191
194
|
return targetName === "mas" || targetName === "mas-dev";
|
|
192
195
|
}
|
|
196
|
+
static isMasDevelopment(targetName) {
|
|
197
|
+
return targetName === "mas-dev";
|
|
198
|
+
}
|
|
193
199
|
static getPlatformTypeFromTarget(targetName) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (targetName === "mas-dev") {
|
|
200
|
+
// must check for mas-dev first
|
|
201
|
+
if (MacTargetHelper.isMasDevelopment(targetName)) {
|
|
198
202
|
return "mas-dev";
|
|
199
203
|
}
|
|
204
|
+
if (MacTargetHelper.isMasTarget(targetName)) {
|
|
205
|
+
return "mas";
|
|
206
|
+
}
|
|
200
207
|
return "mac";
|
|
201
208
|
}
|
|
202
209
|
/**
|
|
203
210
|
* Returns true when hardened runtime will be active for signing.
|
|
204
211
|
* For non-MAS builds it defaults to on; for MAS it defaults to off.
|
|
205
212
|
*/
|
|
206
|
-
static isHardenedRuntimeEnabledForSigning(
|
|
207
|
-
return
|
|
213
|
+
static isHardenedRuntimeEnabledForSigning(targetPlatform, hardenedRuntime) {
|
|
214
|
+
return MacTargetHelper.isMasTarget(targetPlatform) ? hardenedRuntime === true : hardenedRuntime !== false;
|
|
208
215
|
}
|
|
209
216
|
static assertSafePathForCommandUsage(pathValue, description) {
|
|
210
217
|
if (/[\0\r\n"'`$;&|<>]/.test(pathValue)) {
|
|
@@ -212,7 +219,6 @@ export class MacTargetHelper {
|
|
|
212
219
|
}
|
|
213
220
|
}
|
|
214
221
|
static getNotarizeOptions(appPath) {
|
|
215
|
-
const tool = "notarytool";
|
|
216
222
|
const teamId = process.env.APPLE_TEAM_ID;
|
|
217
223
|
const appleId = process.env.APPLE_ID;
|
|
218
224
|
const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD;
|
|
@@ -226,7 +232,7 @@ export class MacTargetHelper {
|
|
|
226
232
|
if (!teamId) {
|
|
227
233
|
throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`);
|
|
228
234
|
}
|
|
229
|
-
return {
|
|
235
|
+
return { appPath, appleId, appleIdPassword, teamId };
|
|
230
236
|
}
|
|
231
237
|
const appleApiKey = process.env.APPLE_API_KEY;
|
|
232
238
|
const appleApiKeyId = process.env.APPLE_API_KEY_ID;
|
|
@@ -235,7 +241,7 @@ export class MacTargetHelper {
|
|
|
235
241
|
if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {
|
|
236
242
|
throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`);
|
|
237
243
|
}
|
|
238
|
-
return {
|
|
244
|
+
return { appPath, appleApiKey, appleApiKeyId, appleApiIssuer };
|
|
239
245
|
}
|
|
240
246
|
const keychain = process.env.APPLE_KEYCHAIN;
|
|
241
247
|
const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE;
|
|
@@ -244,7 +250,7 @@ export class MacTargetHelper {
|
|
|
244
250
|
if (keychain) {
|
|
245
251
|
args = { ...args, keychain };
|
|
246
252
|
}
|
|
247
|
-
return {
|
|
253
|
+
return { appPath, ...args };
|
|
248
254
|
}
|
|
249
255
|
return undefined;
|
|
250
256
|
}
|
|
@@ -259,7 +265,6 @@ export class MacTargetHelper {
|
|
|
259
265
|
log.warn({ reason: "`notarize` options were unable to be generated" }, "skipped macOS notarization");
|
|
260
266
|
return;
|
|
261
267
|
}
|
|
262
|
-
const { notarize } = await dynamicImport("@electron/notarize");
|
|
263
268
|
await notarize(options);
|
|
264
269
|
log.info(null, "notarization successful");
|
|
265
270
|
}
|