app-builder-lib 27.0.0-alpha.11 → 27.0.0-alpha.13

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 (254) hide show
  1. package/dist/asar/asarUtil.js +1 -1
  2. package/dist/asar/asarUtil.js.map +1 -1
  3. package/dist/codeSign/certInfo.d.ts +4 -1
  4. package/dist/codeSign/certInfo.d.ts.map +1 -1
  5. package/dist/codeSign/certInfo.js +5 -3
  6. package/dist/codeSign/certInfo.js.map +1 -1
  7. package/dist/codeSign/forceCodeSigning.d.ts +22 -0
  8. package/dist/codeSign/forceCodeSigning.d.ts.map +1 -0
  9. package/dist/codeSign/forceCodeSigning.js +18 -0
  10. package/dist/codeSign/forceCodeSigning.js.map +1 -0
  11. package/dist/codeSign/mac/macCodeSign.d.ts +13 -1
  12. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  13. package/dist/codeSign/mac/macCodeSign.js +29 -2
  14. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  15. package/dist/codeSign/mac/macSignatureVerifier.d.ts +23 -0
  16. package/dist/codeSign/mac/macSignatureVerifier.d.ts.map +1 -0
  17. package/dist/codeSign/mac/macSignatureVerifier.js +96 -0
  18. package/dist/codeSign/mac/macSignatureVerifier.js.map +1 -0
  19. package/dist/codeSign/win/authenticodeSignature.d.ts +83 -0
  20. package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
  21. package/dist/codeSign/win/authenticodeSignature.js +289 -0
  22. package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
  23. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
  24. package/dist/codeSign/win/pkcs11SignManager.js +4 -3
  25. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
  26. package/dist/codeSign/win/publisherName.d.ts +31 -0
  27. package/dist/codeSign/win/publisherName.d.ts.map +1 -0
  28. package/dist/codeSign/win/publisherName.js +78 -0
  29. package/dist/codeSign/win/publisherName.js.map +1 -0
  30. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +27 -9
  31. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  32. package/dist/codeSign/win/signtoolBaseSignManager.js +80 -49
  33. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  34. package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
  35. package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
  36. package/dist/codeSign/win/verifyUpdatePublisher.js +101 -0
  37. package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
  38. package/dist/codeSign/win/windowsSignAzureManager.d.ts +1 -1
  39. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  40. package/dist/codeSign/win/windowsSignAzureManager.js +24 -6
  41. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  42. package/dist/configuration.d.ts +56 -12
  43. package/dist/configuration.d.ts.map +1 -1
  44. package/dist/configuration.js.map +1 -1
  45. package/dist/electron/ElectronFramework.d.ts +15 -0
  46. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  47. package/dist/electron/ElectronFramework.js +33 -2
  48. package/dist/electron/ElectronFramework.js.map +1 -1
  49. package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
  50. package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
  51. package/dist/electron/mac/asarIntegrityDigest.js +122 -0
  52. package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
  53. package/dist/electron/mac/electronMac.js +1 -28
  54. package/dist/electron/mac/electronMac.js.map +1 -1
  55. package/dist/electron/mac/electronMacUtils.d.ts +9 -0
  56. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
  57. package/dist/electron/mac/electronMacUtils.js +37 -0
  58. package/dist/electron/mac/electronMacUtils.js.map +1 -1
  59. package/dist/fileMatcher.d.ts +34 -11
  60. package/dist/fileMatcher.d.ts.map +1 -1
  61. package/dist/fileMatcher.js +125 -36
  62. package/dist/fileMatcher.js.map +1 -1
  63. package/dist/forge-maker.d.ts +64 -0
  64. package/dist/forge-maker.d.ts.map +1 -1
  65. package/dist/forge-maker.js +104 -2
  66. package/dist/forge-maker.js.map +1 -1
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +5 -4
  70. package/dist/index.js.map +1 -1
  71. package/dist/indexInternal.d.ts +9 -3
  72. package/dist/indexInternal.d.ts.map +1 -1
  73. package/dist/indexInternal.js +8 -3
  74. package/dist/indexInternal.js.map +1 -1
  75. package/dist/linuxPackager.js +1 -1
  76. package/dist/linuxPackager.js.map +1 -1
  77. package/dist/macPackager.d.ts +32 -0
  78. package/dist/macPackager.d.ts.map +1 -1
  79. package/dist/macPackager.js +215 -13
  80. package/dist/macPackager.js.map +1 -1
  81. package/dist/options/FuseOptionsV1.d.ts +4 -0
  82. package/dist/options/FuseOptionsV1.d.ts.map +1 -1
  83. package/dist/options/FuseOptionsV1.js.map +1 -1
  84. package/dist/options/PlatformSpecificBuildOptions.d.ts +93 -21
  85. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  86. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  87. package/dist/options/SquirrelWindowsOptions.d.ts +3 -0
  88. package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
  89. package/dist/options/SquirrelWindowsOptions.js.map +1 -1
  90. package/dist/options/macOptions.d.ts +22 -3
  91. package/dist/options/macOptions.d.ts.map +1 -1
  92. package/dist/options/macOptions.js.map +1 -1
  93. package/dist/options/winOptions.d.ts +68 -19
  94. package/dist/options/winOptions.d.ts.map +1 -1
  95. package/dist/options/winOptions.js +20 -0
  96. package/dist/options/winOptions.js.map +1 -1
  97. package/dist/packager.d.ts +3 -0
  98. package/dist/packager.d.ts.map +1 -1
  99. package/dist/packager.js +11 -2
  100. package/dist/packager.js.map +1 -1
  101. package/dist/platformPackager.d.ts +18 -7
  102. package/dist/platformPackager.d.ts.map +1 -1
  103. package/dist/platformPackager.js +56 -15
  104. package/dist/platformPackager.js.map +1 -1
  105. package/dist/publish/PublishManager.d.ts +4 -0
  106. package/dist/publish/PublishManager.d.ts.map +1 -1
  107. package/dist/publish/PublishManager.js +106 -28
  108. package/dist/publish/PublishManager.js.map +1 -1
  109. package/dist/publish/manifestUploadCheck.d.ts +10 -0
  110. package/dist/publish/manifestUploadCheck.d.ts.map +1 -0
  111. package/dist/publish/manifestUploadCheck.js +75 -0
  112. package/dist/publish/manifestUploadCheck.js.map +1 -0
  113. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  114. package/dist/publish/updateInfoBuilder.js +51 -17
  115. package/dist/publish/updateInfoBuilder.js.map +1 -1
  116. package/dist/publish/updateManifestVerifier.d.ts +22 -0
  117. package/dist/publish/updateManifestVerifier.d.ts.map +1 -0
  118. package/dist/publish/updateManifestVerifier.js +65 -0
  119. package/dist/publish/updateManifestVerifier.js.map +1 -0
  120. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  121. package/dist/targets/ArchiveTarget.js +6 -2
  122. package/dist/targets/ArchiveTarget.js.map +1 -1
  123. package/dist/targets/archive.d.ts +6 -0
  124. package/dist/targets/archive.d.ts.map +1 -1
  125. package/dist/targets/archive.js +15 -5
  126. package/dist/targets/archive.js.map +1 -1
  127. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  128. package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
  129. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  130. package/dist/targets/linux/FlatpakTarget.js +5 -5
  131. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  132. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  133. package/dist/targets/linux/FpmTarget.js +12 -17
  134. package/dist/targets/linux/FpmTarget.js.map +1 -1
  135. package/dist/targets/linux/LinuxTargetHelper.js +1 -1
  136. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  137. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  138. package/dist/targets/linux/appimage/AppImageTarget.js +6 -1
  139. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  140. package/dist/targets/linux/appimage/appImageUtil.js +9 -9
  141. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  142. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -1
  143. package/dist/targets/linux/flatpakBundle.js +25 -20
  144. package/dist/targets/linux/flatpakBundle.js.map +1 -1
  145. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  146. package/dist/targets/linux/snap/core24.js +2 -9
  147. package/dist/targets/linux/snap/core24.js.map +1 -1
  148. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  149. package/dist/targets/linux/snap/coreLegacy.js +22 -6
  150. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  151. package/dist/targets/linux/snap/snapPlugs.d.ts +2 -2
  152. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -1
  153. package/dist/targets/linux/snap/snapPlugs.js +1 -1
  154. package/dist/targets/linux/snap/snapPlugs.js.map +1 -1
  155. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  156. package/dist/targets/linux/snap/snapcraftBuilder.js +19 -17
  157. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  158. package/dist/targets/mac/MacTargetHelper.d.ts +21 -3
  159. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  160. package/dist/targets/mac/MacTargetHelper.js +140 -13
  161. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  162. package/dist/targets/mac/pkg.d.ts.map +1 -1
  163. package/dist/targets/mac/pkg.js +8 -5
  164. package/dist/targets/mac/pkg.js.map +1 -1
  165. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  166. package/dist/targets/win/nsis/NsisTarget.js +15 -3
  167. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  168. package/dist/targets/win/nsis/nsisOptions.d.ts +1 -1
  169. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  170. package/dist/toolsets/nsis.js +1 -1
  171. package/dist/toolsets/nsis.js.map +1 -1
  172. package/dist/toolsets/winCodeSign.d.ts +14 -1
  173. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  174. package/dist/toolsets/winCodeSign.js +14 -1
  175. package/dist/toolsets/winCodeSign.js.map +1 -1
  176. package/dist/toolsets/wine.d.ts +3 -0
  177. package/dist/toolsets/wine.d.ts.map +1 -1
  178. package/dist/toolsets/wine.js +14 -5
  179. package/dist/toolsets/wine.js.map +1 -1
  180. package/dist/util/appFileCopier.d.ts.map +1 -1
  181. package/dist/util/appFileCopier.js +15 -11
  182. package/dist/util/appFileCopier.js.map +1 -1
  183. package/dist/util/buildOutputVerifier.d.ts +40 -0
  184. package/dist/util/buildOutputVerifier.d.ts.map +1 -0
  185. package/dist/util/buildOutputVerifier.js +420 -0
  186. package/dist/util/buildOutputVerifier.js.map +1 -0
  187. package/dist/util/config/config.d.ts.map +1 -1
  188. package/dist/util/config/config.js +9 -1
  189. package/dist/util/config/config.js.map +1 -1
  190. package/dist/util/config/fileOptions.d.ts +22 -0
  191. package/dist/util/config/fileOptions.d.ts.map +1 -1
  192. package/dist/util/config/fileOptions.js +92 -2
  193. package/dist/util/config/fileOptions.js.map +1 -1
  194. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  195. package/dist/util/config/legacyConfigGuard.js +2 -2
  196. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  197. package/dist/util/config/legacyOptions.d.ts +9 -2
  198. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  199. package/dist/util/config/legacyOptions.js +20 -2
  200. package/dist/util/config/legacyOptions.js.map +1 -1
  201. package/dist/util/electronGet.d.ts.map +1 -1
  202. package/dist/util/electronGet.js +3 -1
  203. package/dist/util/electronGet.js.map +1 -1
  204. package/dist/util/flags.d.ts.map +1 -1
  205. package/dist/util/flags.js +3 -9
  206. package/dist/util/flags.js.map +1 -1
  207. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  208. package/dist/util/mac/macosIconComposer.js +6 -5
  209. package/dist/util/mac/macosIconComposer.js.map +1 -1
  210. package/dist/util/macroExpander.js +1 -1
  211. package/dist/util/macroExpander.js.map +1 -1
  212. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -1
  213. package/dist/util/nativeBinaryVerifier.js +3 -1
  214. package/dist/util/nativeBinaryVerifier.js.map +1 -1
  215. package/dist/util/packageMetadata.js +1 -1
  216. package/dist/util/packageMetadata.js.map +1 -1
  217. package/dist/util/removedEnvVars.d.ts +2 -0
  218. package/dist/util/removedEnvVars.d.ts.map +1 -1
  219. package/dist/util/removedEnvVars.js +15 -1
  220. package/dist/util/removedEnvVars.js.map +1 -1
  221. package/dist/util/streamSpawnToFile.d.ts +3 -1
  222. package/dist/util/streamSpawnToFile.d.ts.map +1 -1
  223. package/dist/util/streamSpawnToFile.js +6 -2
  224. package/dist/util/streamSpawnToFile.js.map +1 -1
  225. package/dist/version.d.ts +1 -1
  226. package/dist/version.js +1 -1
  227. package/dist/version.js.map +1 -1
  228. package/dist/vm/ParallelsVm.d.ts +10 -0
  229. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  230. package/dist/vm/ParallelsVm.js +22 -8
  231. package/dist/vm/ParallelsVm.js.map +1 -1
  232. package/dist/vm/PwshVm.d.ts +0 -1
  233. package/dist/vm/PwshVm.d.ts.map +1 -1
  234. package/dist/vm/PwshVm.js +10 -15
  235. package/dist/vm/PwshVm.js.map +1 -1
  236. package/dist/vm/WineVm.d.ts.map +1 -1
  237. package/dist/vm/WineVm.js +4 -4
  238. package/dist/vm/WineVm.js.map +1 -1
  239. package/dist/vm/vm.d.ts +9 -3
  240. package/dist/vm/vm.d.ts.map +1 -1
  241. package/dist/vm/vm.js +40 -32
  242. package/dist/vm/vm.js.map +1 -1
  243. package/dist/winPackager.d.ts +16 -1
  244. package/dist/winPackager.d.ts.map +1 -1
  245. package/dist/winPackager.js +77 -19
  246. package/dist/winPackager.js.map +1 -1
  247. package/package.json +12 -10
  248. package/scheme.json +662 -50
  249. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +14 -9
  250. package/templates/nsis/installSection.nsh +5 -0
  251. package/dist/vm/MonoVm.d.ts +0 -9
  252. package/dist/vm/MonoVm.d.ts.map +0 -1
  253. package/dist/vm/MonoVm.js +0 -16
  254. package/dist/vm/MonoVm.js.map +0 -1
@@ -0,0 +1,122 @@
1
+ import { exec, Executables, InvalidConfigurationError, log, sanitizeDirPath } from "builder-util";
2
+ import { createHash } from "crypto";
3
+ import { open } from "fs/promises";
4
+ import * as path from "path";
5
+ import { parsePlistFile } from "../../util/mac/plist.js";
6
+ /**
7
+ * Marks the slot Electron (>= 41) reserves in the `Electron Framework` binary for the digest of the
8
+ * `ElectronAsarIntegrity` Info.plist dictionary. The sentinel is followed by `used` (1 byte), `version` (1 byte) and
9
+ * the SHA-256 digest (32 bytes); Electron skips the check (fails open) while `used` is 0.
10
+ * @see https://github.com/electron/electron/blob/main/shell/common/asar/integrity_digest.mm
11
+ */
12
+ export const ASAR_INTEGRITY_DIGEST_SENTINEL = "AGbevlPCksUGKNL8TSn7wGmJEuJsXb2A";
13
+ /** electron/electron#48587, first released in 41.0.0-alpha.1 and not backported. */
14
+ export const FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST = 41;
15
+ const DIGEST_VERSION = 1;
16
+ const DIGEST_LENGTH = 32;
17
+ // used + version + digest
18
+ const SLOT_LENGTH = 2 + DIGEST_LENGTH;
19
+ const SCAN_CHUNK_SIZE = 4 * 1024 * 1024;
20
+ /**
21
+ * Computes the version 1 digest Electron validates the `ElectronAsarIntegrity` dictionary against: SHA-256 over the
22
+ * UTF-8 key, algorithm and hash of every entry, in key order.
23
+ * @internal
24
+ */
25
+ export function computeAsarIntegrityDigest(integrity) {
26
+ const hash = createHash("sha256");
27
+ // Electron sorts the keys with NSLiteralSearch (UTF-16 code unit order), which is what the default sort() does; localeCompare would not match
28
+ for (const key of Object.keys(integrity).sort()) {
29
+ const { algorithm, hash: headerHash } = integrity[key];
30
+ hash.update(key).update(algorithm).update(headerHash);
31
+ }
32
+ return hash.digest();
33
+ }
34
+ /**
35
+ * Writes `digest` into every digest slot of an `Electron Framework` binary (one per architecture slice) and returns how
36
+ * many slots were written, 0 if the binary has none (Electron < 41). The slots are counted and bounds-checked before the
37
+ * first write, so a failure never leaves one slice of a universal binary enforcing a digest the other lacks.
38
+ * @internal
39
+ */
40
+ export async function writeAsarIntegrityDigest(binaryPath, digest) {
41
+ if (digest.length !== DIGEST_LENGTH) {
42
+ throw new Error(`ASAR integrity digest must be ${DIGEST_LENGTH} bytes, got ${digest.length}`);
43
+ }
44
+ const sentinel = Buffer.from(ASAR_INTEGRITY_DIGEST_SENTINEL);
45
+ const handle = await open(binaryPath, "r+");
46
+ try {
47
+ const { size } = await handle.stat();
48
+ const slotOffsets = (await findSentinels(handle, size, sentinel)).map(it => it + sentinel.length);
49
+ if (slotOffsets.length > 2) {
50
+ throw new Error(`Found ${slotOffsets.length} ASAR integrity digest slots in ${binaryPath}, at most 2 are expected (one per slice of a universal binary)`);
51
+ }
52
+ for (const offset of slotOffsets) {
53
+ if (offset + SLOT_LENGTH > size) {
54
+ throw new Error(`ASAR integrity digest slot at offset ${offset} of ${binaryPath} is truncated, the binary is corrupted or not an Electron Framework`);
55
+ }
56
+ }
57
+ const payload = Buffer.alloc(SLOT_LENGTH);
58
+ payload[0] = 1; // used
59
+ payload[1] = DIGEST_VERSION;
60
+ digest.copy(payload, 2);
61
+ for (const offset of slotOffsets) {
62
+ await handle.write(payload, 0, payload.length, offset);
63
+ }
64
+ return slotOffsets.length;
65
+ }
66
+ finally {
67
+ await handle.close();
68
+ }
69
+ }
70
+ /**
71
+ * Embeds the digest of the app's `ElectronAsarIntegrity` Info.plist entries into its Electron Framework, then signs the
72
+ * framework again, ad hoc: the write invalidates its signature (Electron's arm64 builds ship linker-signed), and Apple
73
+ * Silicon refuses to load a binary whose signature is invalid. Code signing the app afterwards replaces the ad-hoc
74
+ * signature. macOS only (codesign). Returns whether the digest was embedded.
75
+ * @internal
76
+ */
77
+ export async function embedAsarIntegrityDigest(appPath, frameworkName) {
78
+ const safeAppPath = sanitizeDirPath(appPath);
79
+ const infoPlistPath = path.join(safeAppPath, "Contents", "Info.plist");
80
+ const integrity = await readAsarIntegrity(infoPlistPath);
81
+ if (integrity == null || Object.keys(integrity).length === 0) {
82
+ log.warn({ file: log.filePath(infoPlistPath), reason: "Info.plist has no ElectronAsarIntegrity entries" }, "skipped ASAR integrity digest");
83
+ return false;
84
+ }
85
+ // frameworkName is a file name, not a path: resolving it on its own would root it at the cwd. Containment keeps both paths inside the app
86
+ const frameworksDir = path.join(safeAppPath, "Contents", "Frameworks");
87
+ const frameworkPath = sanitizeDirPath(path.join(frameworksDir, `${frameworkName}.framework`), frameworksDir);
88
+ const binaryPath = sanitizeDirPath(path.join(frameworkPath, frameworkName), frameworkPath);
89
+ if ((await writeAsarIntegrityDigest(binaryPath, computeAsarIntegrityDigest(integrity))) === 0) {
90
+ log.warn({ file: log.filePath(binaryPath), reason: "the binary has no ASAR integrity digest slot" }, "skipped ASAR integrity digest");
91
+ return false;
92
+ }
93
+ // --deep: Electron's x64 builds ship the framework's nested code unsigned, and codesign refuses to seal a bundle around unsigned code
94
+ // Copied/verified from electron/packager:
95
+ // https://github.com/electron/packager/blob/8c5cc941018b1d890c7152734972c44b9b98f268/src/mac.ts#L704-L733
96
+ await exec(Executables.resolve("codesign"), ["--sign", "-", "--force", "--deep", "--preserve-metadata=entitlements,requirements,flags,runtime", frameworkPath]);
97
+ log.info({ file: log.filePath(frameworkPath) }, "embedded ASAR integrity digest");
98
+ return true;
99
+ }
100
+ // parsePlistFile reads the XML format electron-builder writes; an afterPack hook that edits Info.plist with `defaults write` leaves it binary
101
+ async function readAsarIntegrity(infoPlistPath) {
102
+ try {
103
+ return (await parsePlistFile(infoPlistPath)).ElectronAsarIntegrity;
104
+ }
105
+ catch (e) {
106
+ throw new InvalidConfigurationError(`Cannot read ${infoPlistPath} to embed the ASAR integrity digest: ${e.message}. Keep Info.plist in the XML format electron-builder writes (\`defaults write\` converts it to binary, PlistBuddy and \`plutil -replace\` keep it XML), or set mac.asarIntegrityDigest to false`);
107
+ }
108
+ }
109
+ async function findSentinels(handle, size, sentinel) {
110
+ // each read overlaps the next chunk by sentinel.length - 1 bytes, so a sentinel straddling a chunk boundary is found (once)
111
+ const buffer = Buffer.allocUnsafe(SCAN_CHUNK_SIZE + sentinel.length - 1);
112
+ const offsets = [];
113
+ for (let start = 0; start < size; start += SCAN_CHUNK_SIZE) {
114
+ const { bytesRead } = await handle.read(buffer, 0, Math.min(buffer.length, size - start), start);
115
+ const chunk = buffer.subarray(0, bytesRead);
116
+ for (let index = chunk.indexOf(sentinel); index !== -1; index = chunk.indexOf(sentinel, index + 1)) {
117
+ offsets.push(start + index);
118
+ }
119
+ }
120
+ return offsets;
121
+ }
122
+ //# sourceMappingURL=asarIntegrityDigest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asarIntegrityDigest.js","sourceRoot":"","sources":["../../../src/electron/mac/asarIntegrityDigest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAc,IAAI,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,kCAAkC,CAAA;AAEhF,oFAAoF;AACpF,MAAM,CAAC,MAAM,+CAA+C,GAAG,EAAE,CAAA;AAEjE,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,aAAa,GAAG,EAAE,CAAA;AACxB,0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anitizeDirPath } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { FileHandle, open } from \"fs/promises\"\nimport * as path from \"path\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\nimport { parsePlistFile } from \"../../util/mac/plist.js\"\n\n/**\n * Marks the slot Electron (>= 41) reserves in the `Electron Framework` binary for the digest of the\n * `ElectronAsarIntegrity` Info.plist dictionary. The sentinel is followed by `used` (1 byte), `version` (1 byte) and\n * the SHA-256 digest (32 bytes); Electron skips the check (fails open) while `used` is 0.\n * @see https://github.com/electron/electron/blob/main/shell/common/asar/integrity_digest.mm\n */\nexport const ASAR_INTEGRITY_DIGEST_SENTINEL = \"AGbevlPCksUGKNL8TSn7wGmJEuJsXb2A\"\n\n/** electron/electron#48587, first released in 41.0.0-alpha.1 and not backported. */\nexport const FIRST_ELECTRON_MAJOR_WITH_ASAR_INTEGRITY_DIGEST = 41\n\nconst DIGEST_VERSION = 1\nconst DIGEST_LENGTH = 32\n// used + version + digest\nconst SLOT_LENGTH = 2 + DIGEST_LENGTH\nconst SCAN_CHUNK_SIZE = 4 * 1024 * 1024\n\n/**\n * Computes the version 1 digest Electron validates the `ElectronAsarIntegrity` dictionary against: SHA-256 over the\n * UTF-8 key, algorithm and hash of every entry, in key order.\n * @internal\n */\nexport function computeAsarIntegrityDigest(integrity: AsarIntegrity): Buffer {\n const hash = createHash(\"sha256\")\n // Electron sorts the keys with NSLiteralSearch (UTF-16 code unit order), which is what the default sort() does; localeCompare would not match\n for (const key of Object.keys(integrity).sort()) {\n const { algorithm, hash: headerHash } = integrity[key]\n hash.update(key).update(algorithm).update(headerHash)\n }\n return hash.digest()\n}\n\n/**\n * Writes `digest` into every digest slot of an `Electron Framework` binary (one per architecture slice) and returns how\n * many slots were written, 0 if the binary has none (Electron < 41). The slots are counted and bounds-checked before the\n * first write, so a failure never leaves one slice of a universal binary enforcing a digest the other lacks.\n * @internal\n */\nexport async function writeAsarIntegrityDigest(binaryPath: string, digest: Buffer): Promise<number> {\n if (digest.length !== DIGEST_LENGTH) {\n throw new Error(`ASAR integrity digest must be ${DIGEST_LENGTH} bytes, got ${digest.length}`)\n }\n\n const sentinel = Buffer.from(ASAR_INTEGRITY_DIGEST_SENTINEL)\n const handle = await open(binaryPath, \"r+\")\n try {\n const { size } = await handle.stat()\n const slotOffsets = (await findSentinels(handle, size, sentinel)).map(it => it + sentinel.length)\n if (slotOffsets.length > 2) {\n throw new Error(`Found ${slotOffsets.length} ASAR integrity digest slots in ${binaryPath}, at most 2 are expected (one per slice of a universal binary)`)\n }\n for (const offset of slotOffsets) {\n if (offset + SLOT_LENGTH > size) {\n throw new Error(`ASAR integrity digest slot at offset ${offset} of ${binaryPath} is truncated, the binary is corrupted or not an Electron Framework`)\n }\n }\n\n const payload = Buffer.alloc(SLOT_LENGTH)\n payload[0] = 1 // used\n payload[1] = DIGEST_VERSION\n digest.copy(payload, 2)\n for (const offset of slotOffsets) {\n await handle.write(payload, 0, payload.length, offset)\n }\n return slotOffsets.length\n } finally {\n await handle.close()\n }\n}\n\n/**\n * Embeds the digest of the app's `ElectronAsarIntegrity` Info.plist entries into its Electron Framework, then signs the\n * framework again, ad hoc: the write invalidates its signature (Electron's arm64 builds ship linker-signed), and Apple\n * Silicon refuses to load a binary whose signature is invalid. Code signing the app afterwards replaces the ad-hoc\n * signature. macOS only (codesign). Returns whether the digest was embedded.\n * @internal\n */\nexport async function embedAsarIntegrityDigest(appPath: string, frameworkName: string): Promise<boolean> {\n const safeAppPath = sanitizeDirPath(appPath)\n const infoPlistPath = path.join(safeAppPath, \"Contents\", \"Info.plist\")\n const integrity = await readAsarIntegrity(infoPlistPath)\n if (integrity == null || Object.keys(integrity).length === 0) {\n log.warn({ file: log.filePath(infoPlistPath), reason: \"Info.plist has no ElectronAsarIntegrity entries\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // frameworkName is a file name, not a path: resolving it on its own would root it at the cwd. Containment keeps both paths inside the app\n const frameworksDir = path.join(safeAppPath, \"Contents\", \"Frameworks\")\n const frameworkPath = sanitizeDirPath(path.join(frameworksDir, `${frameworkName}.framework`), frameworksDir)\n const binaryPath = sanitizeDirPath(path.join(frameworkPath, frameworkName), frameworkPath)\n if ((await writeAsarIntegrityDigest(binaryPath, computeAsarIntegrityDigest(integrity))) === 0) {\n log.warn({ file: log.filePath(binaryPath), reason: \"the binary has no ASAR integrity digest slot\" }, \"skipped ASAR integrity digest\")\n return false\n }\n\n // --deep: Electron's x64 builds ship the framework's nested code unsigned, and codesign refuses to seal a bundle around unsigned code\n // Copied/verified from electron/packager:\n // https://github.com/electron/packager/blob/8c5cc941018b1d890c7152734972c44b9b98f268/src/mac.ts#L704-L733\n await exec(Executables.resolve(\"codesign\"), [\"--sign\", \"-\", \"--force\", \"--deep\", \"--preserve-metadata=entitlements,requirements,flags,runtime\", frameworkPath])\n log.info({ file: log.filePath(frameworkPath) }, \"embedded ASAR integrity digest\")\n return true\n}\n\n// parsePlistFile reads the XML format electron-builder writes; an afterPack hook that edits Info.plist with `defaults write` leaves it binary\nasync function readAsarIntegrity(infoPlistPath: string): Promise<AsarIntegrity | undefined> {\n try {\n return (await parsePlistFile<{ ElectronAsarIntegrity?: AsarIntegrity }>(infoPlistPath)).ElectronAsarIntegrity\n } catch (e: any) {\n throw new InvalidConfigurationError(\n `Cannot read ${infoPlistPath} to embed the ASAR integrity digest: ${e.message}. Keep Info.plist in the XML format electron-builder writes (\\`defaults write\\` converts it to binary, PlistBuddy and \\`plutil -replace\\` keep it XML), or set mac.asarIntegrityDigest to false`\n )\n }\n}\n\nasync function findSentinels(handle: FileHandle, size: number, sentinel: Buffer): Promise<Array<number>> {\n // each read overlaps the next chunk by sentinel.length - 1 bytes, so a sentinel straddling a chunk boundary is found (once)\n const buffer = Buffer.allocUnsafe(SCAN_CHUNK_SIZE + sentinel.length - 1)\n const offsets: Array<number> = []\n for (let start = 0; start < size; start += SCAN_CHUNK_SIZE) {\n const { bytesRead } = await handle.read(buffer, 0, Math.min(buffer.length, size - start), start)\n const chunk = buffer.subarray(0, bytesRead)\n for (let index = chunk.indexOf(sentinel); index !== -1; index = chunk.indexOf(sentinel, index + 1)) {\n offsets.push(start + index)\n }\n }\n return offsets\n}\n"]}
@@ -7,7 +7,7 @@ import { normalizeExt } from "../../platformPackager.js";
7
7
  import { savePlistFile, parsePlistFile } from "../../util/mac/plist.js";
8
8
  import { createBrandingOpts } from "../ElectronFramework.js";
9
9
  import { MacTargetHelper } from "../../targets/mac/MacTargetHelper.js";
10
- import { assertSafeHelperName, getAvailableHelperSuffixes } from "./electronMacUtils.js";
10
+ import { assertSafeHelperName, configureLocalhostAts, getAvailableHelperSuffixes } from "./electronMacUtils.js";
11
11
  function doRename(basePath, oldName, newName) {
12
12
  return rename(path.join(basePath, oldName), path.join(basePath, newName));
13
13
  }
@@ -213,31 +213,4 @@ export async function createMacApp(packager, appOutDir, asarIntegrity, targetPla
213
213
  const now = Date.now() / 1000;
214
214
  await utimes(appPath, now, now);
215
215
  }
216
- function configureLocalhostAts(appPlist) {
217
- // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/
218
- let ats = appPlist.NSAppTransportSecurity;
219
- if (ats == null) {
220
- ats = {};
221
- appPlist.NSAppTransportSecurity = ats;
222
- }
223
- ats.NSAllowsLocalNetworking = true;
224
- // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814
225
- ats.NSAllowsArbitraryLoads = true;
226
- let exceptionDomains = ats.NSExceptionDomains;
227
- if (exceptionDomains == null) {
228
- exceptionDomains = {};
229
- ats.NSExceptionDomains = exceptionDomains;
230
- }
231
- if (exceptionDomains.localhost == null) {
232
- const allowHttp = {
233
- NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,
234
- NSIncludesSubdomains: false,
235
- NSTemporaryExceptionAllowsInsecureHTTPLoads: true,
236
- NSTemporaryExceptionMinimumTLSVersion: "1.0",
237
- NSTemporaryExceptionRequiresForwardSecrecy: false,
238
- };
239
- exceptionDomains.localhost = allowHttp;
240
- exceptionDomains["127.0.0.1"] = allowHttp;
241
- }
242
- }
243
216
  //# sourceMappingURL=electronMac.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"electronMac.js","sourceRoot":"","sources":["../../../src/electron/mac/electronMac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAC1G,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,yBAAyB,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAgB,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAExF,SAAS,QAAQ,CAAC,QAAgB,EAAE,OAAe,EAAE,OAAe;IAClE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,cAA6B,EAAE,cAAsB,EAAE,OAAe,EAAE,MAAc;IACzG,OAAO,OAAO,CAAC,GAAG,CAChB,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QACnG,OAAO,QAAQ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AAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;IAC7B,MAAM,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAa;IAC1C,yEAAyE;IACzE,IAAI,GAAG,GAAG,QAAQ,CAAC,sBAAsB,CAAA;IACzC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,GAAG,GAAG,EAAE,CAAA;QACR,QAAQ,CAAC,sBAAsB,GAAG,GAAG,CAAA;IACvC,CAAC;IAED,GAAG,CAAC,uBAAuB,GAAG,IAAI,CAAA;IAClC,2FAA2F;IAC3F,GAAG,CAAC,sBAAsB,GAAG,IAAI,CAAA;IAEjC,IAAI,gBAAgB,GAAG,GAAG,CAAC,kBAAkB,CAAA;IAC7C,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;QAC7B,gBAAgB,GAAG,EAAE,CAAA;QACrB,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAA;IAC3C,CAAC;IAED,IAAI,gBAAgB,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;IAC3C,CAAC;AACH,CAAC","sourcesContent":["import { asArray, copyOrLinkFile, getPlatformIconFileName, InvalidConfigurationError } from \"builder-util\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as fs from \"fs\"\nimport { filterCFBundleIdentifier } from \"../../appInfo.js\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\nimport { MacPackager } from \"../../macPackager.js\"\nimport { normalizeExt } from \"../../platformPackager.js\"\nimport { savePlistFile, parsePlistFile, PlistObject, PlistValue } from \"../../util/mac/plist.js\"\nimport { createBrandingOpts } from \"../ElectronFramework.js\"\nimport { MacTargetHelper, PlatformType } from \"../../targets/mac/MacTargetHelper.js\"\nimport { assertSafeHelperName, getAvailableHelperSuffixes } from \"./electronMacUtils.js\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return Promise.all(\n helperSuffixes.map(suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n )\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, targetPlatform: PlatformType) {\n const appInfo = packager.appInfo\n // Electon uses the application name (CFBundleName) to resolve helper apps\n // https://github.com/electron/electron/blob/main/shell/app/electron_main_delegate_mac.mm\n // https://github.com/electron-userland/electron-builder/issues/6962\n const appFilename = appInfo.sanitizedProductName\n const electronBranding = createBrandingOpts(packager.config)\n // The branding name is the on-disk prefix of every helper bundle we read from the Electron dist,\n // so reject values that could escape the Frameworks directory.\n assertSafeHelperName(electronBranding.productName, \"electronBranding.productName\")\n\n const contentsPath = path.join(appOutDir, packager.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const safeParsePlistFile = async (filePath: string): Promise<PlistObject | null> => {\n if (!fs.existsSync(filePath)) {\n return null\n }\n return await parsePlistFile(filePath)\n }\n\n const appPlist = (await safeParsePlistFile(appPlistFilename))!\n if (appPlist == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n // Parse each helper plist; variants absent from the current Electron dist resolve to null.\n const helperPlist = await safeParsePlistFile(helperPlistFilename)\n const helperEHPlist = await safeParsePlistFile(helperEHPlistFilename)\n const helperNPPlist = await safeParsePlistFile(helperNPPlistFilename)\n const helperRendererPlist = await safeParsePlistFile(helperRendererPlistFilename)\n const helperPluginPlist = await safeParsePlistFile(helperPluginPlistFilename)\n const helperGPUPlist = await safeParsePlistFile(helperGPUPlistFilename)\n const helperLoginPlist = await safeParsePlistFile(helperLoginPlistFilename)\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n // `targetPlatform` is the authoritative 3-way flavor, so the cascaded config (incl. masDev overrides) is correct for mas-dev too.\n const cascadedOptions = packager.getPlatformConfig(targetPlatform).config\n const cfBundleIdentifier = filterCFBundleIdentifier(cascadedOptions?.appId || appInfo.macBundleIdentifier)\n const helperBundleIdentifier = filterCFBundleIdentifier(cascadedOptions?.helperBundleId || `${cfBundleIdentifier}.helper`)\n\n appPlist.CFBundleIdentifier = cfBundleIdentifier\n\n await packager.applyCommonInfo(appPlist, contentsPath, cascadedOptions)\n\n // required for electron-updater proxy. Both mas and mas-dev are sandboxed App Store flavors, so skip ATS for either.\n const isMasFlavor = MacTargetHelper.isMasTarget(targetPlatform)\n if (!isMasFlavor) {\n configureLocalhostAts(appPlist)\n }\n\n if (helperPlist != null) {\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n const documentTypes = await Promise.all(\n fileAssociations.map(async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n )\n\n // `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case\n appPlist.CFBundleDocumentTypes = [...((appPlist.CFBundleDocumentTypes as PlistValue[]) || []), ...documentTypes]\n }\n\n const toPlistObject = (asarIntegrity: AsarIntegrity): PlistObject => {\n const result: PlistObject = {}\n for (const [filePath, headerHash] of Object.entries(asarIntegrity)) {\n result[filePath] = {\n algorithm: headerHash.algorithm,\n hash: headerHash.hash,\n }\n }\n return result\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = toPlistObject(asarIntegrity)\n }\n\n if (helperEHPlist != null) {\n await savePlistFile(helperEHPlistFilename, helperEHPlist)\n }\n\n if (helperNPPlist != null) {\n await savePlistFile(helperNPPlistFilename, helperNPPlist)\n }\n\n if (helperRendererPlist != null) {\n await savePlistFile(helperRendererPlistFilename, helperRendererPlist)\n }\n\n if (helperPluginPlist != null) {\n await savePlistFile(helperPluginPlistFilename, helperPluginPlist)\n }\n\n if (helperGPUPlist != null) {\n await savePlistFile(helperGPUPlistFilename, helperGPUPlist)\n }\n\n if (helperLoginPlist != null) {\n await savePlistFile(helperLoginPlistFilename, helperLoginPlist)\n }\n\n await savePlistFile(appPlistFilename, appPlist)\n if (helperPlist != null) {\n await savePlistFile(helperPlistFilename, helperPlist)\n }\n\n await doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable as string)\n\n await moveHelpers(\n getAvailableHelperSuffixes({\n EH: helperEHPlist != null,\n NP: helperNPPlist != null,\n Renderer: helperRendererPlist != null,\n Plugin: helperPluginPlist != null,\n GPU: helperGPUPlist != null,\n }),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appInfo.productFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
1
+ {"version":3,"file":"electronMac.js","sourceRoot":"","sources":["../../../src/electron/mac/electronMac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAC1G,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,yBAAyB,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAgB,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,qBAA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CAAC,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QAClG,MAAM,QAAQ,CAAC,kBAAkB,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,WAAW,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,GAAG,WAAW,GAAG,MAAM,MAAM,CAAC,CAAC,CAAA;IAC7K,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC,eAAe,MAAM,CAAC,CAAA;IACtE,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAA;IACjD,mEAAmE;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;IAC7B,MAAM,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import { asArray, copyOrLinkFile, getPlatformIconFileName, InvalidConfigurationError } from \"builder-util\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as fs from \"fs\"\nimport { filterCFBundleIdentifier } from \"../../appInfo.js\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\nimport { MacPackager } from \"../../macPackager.js\"\nimport { normalizeExt } from \"../../platformPackager.js\"\nimport { savePlistFile, parsePlistFile, PlistObject, PlistValue } from \"../../util/mac/plist.js\"\nimport { createBrandingOpts } from \"../ElectronFramework.js\"\nimport { MacTargetHelper, PlatformType } from \"../../targets/mac/MacTargetHelper.js\"\nimport { assertSafeHelperName, configureLocalhostAts, getAvailableHelperSuffixes } from \"./electronMacUtils.js\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return Promise.all(\n helperSuffixes.map(suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n )\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, targetPlatform: PlatformType) {\n const appInfo = packager.appInfo\n // Electon uses the application name (CFBundleName) to resolve helper apps\n // https://github.com/electron/electron/blob/main/shell/app/electron_main_delegate_mac.mm\n // https://github.com/electron-userland/electron-builder/issues/6962\n const appFilename = appInfo.sanitizedProductName\n const electronBranding = createBrandingOpts(packager.config)\n // The branding name is the on-disk prefix of every helper bundle we read from the Electron dist,\n // so reject values that could escape the Frameworks directory.\n assertSafeHelperName(electronBranding.productName, \"electronBranding.productName\")\n\n const contentsPath = path.join(appOutDir, packager.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const safeParsePlistFile = async (filePath: string): Promise<PlistObject | null> => {\n if (!fs.existsSync(filePath)) {\n return null\n }\n return await parsePlistFile(filePath)\n }\n\n const appPlist = (await safeParsePlistFile(appPlistFilename))!\n if (appPlist == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n // Parse each helper plist; variants absent from the current Electron dist resolve to null.\n const helperPlist = await safeParsePlistFile(helperPlistFilename)\n const helperEHPlist = await safeParsePlistFile(helperEHPlistFilename)\n const helperNPPlist = await safeParsePlistFile(helperNPPlistFilename)\n const helperRendererPlist = await safeParsePlistFile(helperRendererPlistFilename)\n const helperPluginPlist = await safeParsePlistFile(helperPluginPlistFilename)\n const helperGPUPlist = await safeParsePlistFile(helperGPUPlistFilename)\n const helperLoginPlist = await safeParsePlistFile(helperLoginPlistFilename)\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n // `targetPlatform` is the authoritative 3-way flavor, so the cascaded config (incl. masDev overrides) is correct for mas-dev too.\n const cascadedOptions = packager.getPlatformConfig(targetPlatform).config\n const cfBundleIdentifier = filterCFBundleIdentifier(cascadedOptions?.appId || appInfo.macBundleIdentifier)\n const helperBundleIdentifier = filterCFBundleIdentifier(cascadedOptions?.helperBundleId || `${cfBundleIdentifier}.helper`)\n\n appPlist.CFBundleIdentifier = cfBundleIdentifier\n\n await packager.applyCommonInfo(appPlist, contentsPath, cascadedOptions)\n\n // required for electron-updater proxy. Both mas and mas-dev are sandboxed App Store flavors, so skip ATS for either.\n const isMasFlavor = MacTargetHelper.isMasTarget(targetPlatform)\n if (!isMasFlavor) {\n configureLocalhostAts(appPlist)\n }\n\n if (helperPlist != null) {\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n const documentTypes = await Promise.all(\n fileAssociations.map(async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n )\n\n // `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case\n appPlist.CFBundleDocumentTypes = [...((appPlist.CFBundleDocumentTypes as PlistValue[]) || []), ...documentTypes]\n }\n\n const toPlistObject = (asarIntegrity: AsarIntegrity): PlistObject => {\n const result: PlistObject = {}\n for (const [filePath, headerHash] of Object.entries(asarIntegrity)) {\n result[filePath] = {\n algorithm: headerHash.algorithm,\n hash: headerHash.hash,\n }\n }\n return result\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = toPlistObject(asarIntegrity)\n }\n\n if (helperEHPlist != null) {\n await savePlistFile(helperEHPlistFilename, helperEHPlist)\n }\n\n if (helperNPPlist != null) {\n await savePlistFile(helperNPPlistFilename, helperNPPlist)\n }\n\n if (helperRendererPlist != null) {\n await savePlistFile(helperRendererPlistFilename, helperRendererPlist)\n }\n\n if (helperPluginPlist != null) {\n await savePlistFile(helperPluginPlistFilename, helperPluginPlist)\n }\n\n if (helperGPUPlist != null) {\n await savePlistFile(helperGPUPlistFilename, helperGPUPlist)\n }\n\n if (helperLoginPlist != null) {\n await savePlistFile(helperLoginPlistFilename, helperLoginPlist)\n }\n\n await savePlistFile(appPlistFilename, appPlist)\n if (helperPlist != null) {\n await savePlistFile(helperPlistFilename, helperPlist)\n }\n\n await doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable as string)\n\n await moveHelpers(\n getAvailableHelperSuffixes({\n EH: helperEHPlist != null,\n NP: helperNPPlist != null,\n Renderer: helperRendererPlist != null,\n Plugin: helperPluginPlist != null,\n GPU: helperGPUPlist != null,\n }),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appInfo.productFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n"]}
@@ -21,4 +21,13 @@ export interface AvailableHelpers {
21
21
  * `" Helper"` bundle is always present; the remaining variants vary by Electron version.
22
22
  */
23
23
  export declare function getAvailableHelperSuffixes(present: AvailableHelpers): string[];
24
+ /**
25
+ * Adds the App Transport Security entries that electron-updater's local update proxy needs: local networking, and
26
+ * plain-HTTP exceptions for `localhost` and `127.0.0.1`.
27
+ *
28
+ * Electron's default `Info.plist` already enables `NSAllowsArbitraryLoads`, and `mac.extendInfo` is merged over it before this runs,
29
+ * so whatever value the app sets there is kept; the key is set to `true` only when it is missing (or `null`, which `extendInfo` cannot
30
+ * use to remove it).
31
+ */
32
+ export declare function configureLocalhostAts(appPlist: any): void;
24
33
  //# sourceMappingURL=electronMacUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"electronMacUtils.d.ts","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtE;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAkB9E"}
1
+ {"version":3,"file":"electronMacUtils.d.ts","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtE;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAkB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CA+BzD"}
@@ -39,4 +39,41 @@ export function getAvailableHelperSuffixes(present) {
39
39
  }
40
40
  return result;
41
41
  }
42
+ /**
43
+ * Adds the App Transport Security entries that electron-updater's local update proxy needs: local networking, and
44
+ * plain-HTTP exceptions for `localhost` and `127.0.0.1`.
45
+ *
46
+ * Electron's default `Info.plist` already enables `NSAllowsArbitraryLoads`, and `mac.extendInfo` is merged over it before this runs,
47
+ * so whatever value the app sets there is kept; the key is set to `true` only when it is missing (or `null`, which `extendInfo` cannot
48
+ * use to remove it).
49
+ */
50
+ export function configureLocalhostAts(appPlist) {
51
+ // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/
52
+ let ats = appPlist.NSAppTransportSecurity;
53
+ if (ats == null) {
54
+ ats = {};
55
+ appPlist.NSAppTransportSecurity = ats;
56
+ }
57
+ ats.NSAllowsLocalNetworking = true;
58
+ // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814
59
+ if (ats.NSAllowsArbitraryLoads == null) {
60
+ ats.NSAllowsArbitraryLoads = true;
61
+ }
62
+ let exceptionDomains = ats.NSExceptionDomains;
63
+ if (exceptionDomains == null) {
64
+ exceptionDomains = {};
65
+ ats.NSExceptionDomains = exceptionDomains;
66
+ }
67
+ if (exceptionDomains.localhost == null) {
68
+ const allowHttp = {
69
+ NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,
70
+ NSIncludesSubdomains: false,
71
+ NSTemporaryExceptionAllowsInsecureHTTPLoads: true,
72
+ NSTemporaryExceptionMinimumTLSVersion: "1.0",
73
+ NSTemporaryExceptionRequiresForwardSecrecy: false,
74
+ };
75
+ exceptionDomains.localhost = allowHttp;
76
+ exceptionDomains["127.0.0.1"] = allowHttp;
77
+ }
78
+ }
42
79
  //# sourceMappingURL=electronMacUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"electronMacUtils.js","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC9D,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,yBAAyB,CACjC,GAAG,KAAK,KAAK,IAAI,qEAAqE,SAAS,aAAa,KAAK,0CAA0C,CAC5J,CAAA;IACH,CAAC;AACH,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAyB;IAClE,MAAM,MAAM,GAAG,CAAC,SAAS,CAAC,CAAA;IAC1B,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/internal\"\n\n/**\n * At runtime Electron locates its helper apps relative to the main application name, resolving each\n * one as `${CFBundleName} Helper.app` (see `electron_main_delegate_mac.mm`). electron-builder uses\n * the product name verbatim for both `CFBundleName` and the on-disk helper/app bundle names, so the\n * name must be usable as a filename without modification.\n *\n * If the name would be altered by filename sanitization, the on-disk bundle (sanitized) and\n * `CFBundleName` (verbatim) would diverge and break helper discovery. Reject such names up front with\n * a clear error so the user can choose a valid name, rather than silently changing it for them.\n */\nexport function assertSafeHelperName(name: string, field: string): void {\n const sanitized = sanitizeFileName(name)\n if (sanitized !== name) {\n throw new InvalidConfigurationError(\n `${field} \"${name}\" is not a valid macOS app bundle name (it would be sanitized to \"${sanitized}\"). Set a ${field} that requires no filename sanitization.`\n )\n }\n}\n\nexport interface AvailableHelpers {\n EH?: boolean\n NP?: boolean\n Renderer?: boolean\n Plugin?: boolean\n GPU?: boolean\n}\n\n/**\n * Returns the helper bundle suffixes present in the current Electron distribution. The generic\n * `\" Helper\"` bundle is always present; the remaining variants vary by Electron version.\n */\nexport function getAvailableHelperSuffixes(present: AvailableHelpers): string[] {\n const result = [\" Helper\"]\n if (present.EH) {\n result.push(\" Helper EH\")\n }\n if (present.NP) {\n result.push(\" Helper NP\")\n }\n if (present.Renderer) {\n result.push(\" Helper (Renderer)\")\n }\n if (present.Plugin) {\n result.push(\" Helper (Plugin)\")\n }\n if (present.GPU) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n"]}
1
+ {"version":3,"file":"electronMacUtils.js","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC9D,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,yBAAyB,CACjC,GAAG,KAAK,KAAK,IAAI,qEAAqE,SAAS,aAAa,KAAK,0CAA0C,CAC5J,CAAA;IACH,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CAAC,kBAAkB,GAAG,gBAAgB,CAAA;IAC3C,CAAC;IAED,IAAI,gBAAgB,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;IAC3C,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/internal\"\n\n/**\n * At runtime Electron locates its helper apps relative to the main application name, resolving each\n * one as `${CFBundleName} Helper.app` (see `electron_main_delegate_mac.mm`). electron-builder uses\n * the product name verbatim for both `CFBundleName` and the on-disk helper/app bundle names, so the\n * name must be usable as a filename without modification.\n *\n * If the name would be altered by filename sanitization, the on-disk bundle (sanitized) and\n * `CFBundleName` (verbatim) would diverge and break helper discovery. Reject such names up front with\n * a clear error so the user can choose a valid name, rather than silently changing it for them.\n */\nexport function assertSafeHelperName(name: string, field: string): void {\n const sanitized = sanitizeFileName(name)\n if (sanitized !== name) {\n throw new InvalidConfigurationError(\n `${field} \"${name}\" is not a valid macOS app bundle name (it would be sanitized to \"${sanitized}\"). Set a ${field} that requires no filename sanitization.`\n )\n }\n}\n\nexport interface AvailableHelpers {\n EH?: boolean\n NP?: boolean\n Renderer?: boolean\n Plugin?: boolean\n GPU?: boolean\n}\n\n/**\n * Returns the helper bundle suffixes present in the current Electron distribution. The generic\n * `\" Helper\"` bundle is always present; the remaining variants vary by Electron version.\n */\nexport function getAvailableHelperSuffixes(present: AvailableHelpers): string[] {\n const result = [\" Helper\"]\n if (present.EH) {\n result.push(\" Helper EH\")\n }\n if (present.NP) {\n result.push(\" Helper NP\")\n }\n if (present.Renderer) {\n result.push(\" Helper (Renderer)\")\n }\n if (present.Plugin) {\n result.push(\" Helper (Plugin)\")\n }\n if (present.GPU) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n\n/**\n * Adds the App Transport Security entries that electron-updater's local update proxy needs: local networking, and\n * plain-HTTP exceptions for `localhost` and `127.0.0.1`.\n *\n * Electron's default `Info.plist` already enables `NSAllowsArbitraryLoads`, and `mac.extendInfo` is merged over it before this runs,\n * so whatever value the app sets there is kept; the key is set to `true` only when it is missing (or `null`, which `extendInfo` cannot\n * use to remove it).\n */\nexport function configureLocalhostAts(appPlist: any): void {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n if (ats.NSAllowsArbitraryLoads == null) {\n ats.NSAllowsArbitraryLoads = true\n }\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
@@ -6,36 +6,59 @@ import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOpt
6
6
  export declare const DEFAULT_EXCLUDED_NAMES: ReadonlyArray<string>;
7
7
  export declare const DEFAULT_EXCLUDED_EXTENSIONS: ReadonlyArray<string>;
8
8
  /**
9
- * Determines which default-excluded extensions and names a user has explicitly opted back in to via
10
- * their `files` patterns, so the corresponding defaults are not re-applied.
9
+ * The file extensions (without leading dot) excluded from the app files and the copied `node_modules`, from the
10
+ * `fileOptions.excludedExts` build option: the platform-level value (`mac.fileOptions.excludedExts`, ...) when it is set,
11
+ * otherwise the root one, otherwise `["default"]`. See `FilesBuildOptions.excludedExts`.
12
+ */
13
+ export declare function resolveExcludedExtensions(config: Pick<Configuration, "fileOptions">, platformOptions: PlatformSpecificBuildOptions | Nullish): Array<string>;
14
+ /**
15
+ * Determines which excluded extensions (`excludedExtensions`, see {@link resolveExcludedExtensions}) and default-excluded
16
+ * names a user has explicitly opted back in to via their `files` patterns: the extensions for the warning (the files a pattern
17
+ * names are let through by {@link FileMatcher.extensionReincludes}), the names to leave out of the name exclusion glob.
11
18
  *
12
- * A default is treated as opted back in only when a non-negated pattern references it concretely:
19
+ * An exclusion is treated as opted back in only when a non-negated pattern references it concretely:
13
20
  * an extension when a pattern's basename ends with `.<ext>` (e.g. `**\/*.obj`, `assets/*.{obj,gltf}`,
14
- * `**\/*.d.ts`); a name when any path segment equals it (e.g. `**\/.github/**`, `**\/yarn.lock`).
21
+ * `**\/*.d.ts`), only the longest such extension counting (`*.d.ts` names `d.ts`, not also a listed `ts`);
22
+ * a name when any path segment equals it (e.g. `**\/.github/**`, `**\/yarn.lock`).
15
23
  * Broad patterns such as `**\/*` reference nothing concrete and therefore opt nothing in.
16
24
  */
17
- export declare function collectExplicitReincludes(patterns: ReadonlyArray<string>): {
25
+ export declare function collectExplicitReincludes(patterns: ReadonlyArray<string>, excludedExtensions?: ReadonlyArray<string>): {
18
26
  extensions: Set<string>;
19
27
  names: Set<string>;
20
28
  };
21
29
  /**
22
- * Builds the trailing list of default ignore globs appended to the main app file matcher. Extensions
23
- * and names the user has explicitly re-included (see {@link collectExplicitReincludes}) are omitted,
24
- * so a `files` entry like `**\/*.obj` overrides the matching built-in exclusion.
30
+ * Builds the trailing list of default ignore globs appended to the main app file matcher: a glob that excludes every one of
31
+ * `excludedExtensions` (see {@link resolveExcludedExtensions}), then the default-excluded names except those a `files` entry
32
+ * re-includes (see {@link collectExplicitReincludes}) and the fixed ignores. The files a `files` entry names despite their
33
+ * excluded extension are let through by {@link FileMatcher.extensionReincludes}, not by these patterns.
25
34
  */
26
- export declare function getDefaultIgnoredPatterns(userPatterns: ReadonlyArray<string>, includePdb: boolean): Array<string>;
35
+ export declare function getDefaultIgnoredPatterns(userPatterns: ReadonlyArray<string>, excludedExtensions?: ReadonlyArray<string>): Array<string>;
36
+ /**
37
+ * Lets through the files a `files` pattern names despite their excluded extension (see getMainFileMatchers): the extension glob
38
+ * excludes every file with an excluded extension, and such a file is included only when a pattern that names its extension matches
39
+ * it and the matcher's other patterns (`node_modules` and the build resources and output directories, `files` negations) include it.
40
+ */
41
+ export interface ExtensionReincludes {
42
+ /** The pattern of the matcher that excludes the extensions. */
43
+ readonly glob: string;
44
+ readonly extensions: ReadonlyArray<string>;
45
+ /** Per excluded extension, the `files` patterns that name it (see {@link collectExtensionReincludes}). */
46
+ readonly namedBy: ReadonlyMap<string, ReadonlyArray<string>>;
47
+ }
27
48
  /**
28
49
  * Returns the default-excluded names/extensions that the given `files` patterns opt back in, formatted
29
50
  * for display (extensions as `*.<ext>`, names verbatim). Empty when nothing default-excluded is
30
51
  * re-included. Used to warn that files normally kept out of the package will now be included.
31
52
  */
32
- export declare function getReincludedDefaultExclusions(patterns: ReadonlyArray<string>): Array<string>;
53
+ export declare function getReincludedDefaultExclusions(patterns: ReadonlyArray<string>, excludedExtensions?: ReadonlyArray<string>): Array<string>;
33
54
  export declare class FileMatcher {
34
55
  readonly macroExpander: (pattern: string) => string;
35
56
  readonly from: string;
36
57
  readonly to: string;
37
58
  readonly patterns: Array<string>;
38
59
  excludePatterns: Array<Minimatch> | null;
60
+ /** The files a `files` pattern names despite their excluded extension, which the filter lets through the extension glob. */
61
+ extensionReincludes: ExtensionReincludes | null;
39
62
  readonly isSpecifiedAsEmptyArray: boolean;
40
63
  constructor(from: string, to: string, macroExpander: (pattern: string) => string, patterns?: Array<string> | string | null);
41
64
  normalizePattern(pattern: string): string;
@@ -43,7 +66,7 @@ export declare class FileMatcher {
43
66
  prependPattern(pattern: string): void;
44
67
  isEmpty(): boolean;
45
68
  containsOnlyIgnore(): boolean;
46
- computeParsedPatterns(result: Array<Minimatch>, fromDir?: string): void;
69
+ computeParsedPatterns(result: Array<Minimatch>, fromDir?: string, patterns?: ReadonlyArray<string>): void;
47
70
  createFilter(): Filter;
48
71
  toString(): string;
49
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fileMatcher.d.ts","sourceRoot":"","sources":["../src/fileMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EAElB,MAAM,EAOP,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAW,4BAA4B,EAAE,MAAM,2CAA2C,CAAA;AAUjG,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,MAAM,CAoCxD,CAAA;AAGD,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,MAAM,CAqB7D,CAAA;AAiED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAmB1H;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CA8BjH;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,C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