summaryrefslogtreecommitdiff
path: root/desktop/node_modules/@electron/universal/dist
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-10-24 17:43:37 +0200
committerRaindropsSys <raindrops@equestria.dev>2023-10-24 17:43:37 +0200
commitae187b6d75c8079da0be1dc288613bad8466fe61 (patch)
tree5ea0d34185a2270f29ffaa65e1f5258028d7d5d0 /desktop/node_modules/@electron/universal/dist
downloadmist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.gz
mist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.bz2
mist-ae187b6d75c8079da0be1dc288613bad8466fe61.zip
Initial commit
Diffstat (limited to 'desktop/node_modules/@electron/universal/dist')
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/asar-utils.d.ts16
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js172
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/debug.d.ts2
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/debug.js6
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/debug.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/file-utils.d.ts16
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/file-utils.js71
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/file-utils.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/index.d.ts37
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/index.js231
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/index.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/sha.d.ts1
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/sha.js19
-rw-r--r--desktop/node_modules/@electron/universal/dist/cjs/sha.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/asar-utils.d.ts16
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/asar-utils.js169
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/asar-utils.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/debug.d.ts2
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/debug.js3
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/debug.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/file-utils.d.ts16
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/file-utils.js68
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/file-utils.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/index.d.ts37
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/index.js228
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/index.js.map1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/sha.d.ts1
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/sha.js16
-rw-r--r--desktop/node_modules/@electron/universal/dist/esm/sha.js.map1
30 files changed, 1137 insertions, 0 deletions
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.d.ts b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.d.ts
new file mode 100644
index 0000000..530b52b
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.d.ts
@@ -0,0 +1,16 @@
+export declare enum AsarMode {
+ NO_ASAR = 0,
+ HAS_ASAR = 1
+}
+export declare type MergeASARsOptions = {
+ x64AsarPath: string;
+ arm64AsarPath: string;
+ outputAsarPath: string;
+ singleArchFiles?: string;
+};
+export declare const detectAsarMode: (appPath: string) => Promise<AsarMode>;
+export declare const generateAsarIntegrity: (asarPath: string) => {
+ algorithm: "SHA256";
+ hash: string;
+};
+export declare const mergeASARs: ({ x64AsarPath, arm64AsarPath, outputAsarPath, singleArchFiles, }: MergeASARsOptions) => Promise<void>;
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js
new file mode 100644
index 0000000..6752288
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js
@@ -0,0 +1,172 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mergeASARs = exports.generateAsarIntegrity = exports.detectAsarMode = exports.AsarMode = void 0;
+const asar = require("@electron/asar");
+const child_process_1 = require("child_process");
+const crypto = require("crypto");
+const fs = require("fs-extra");
+const path = require("path");
+const minimatch = require("minimatch");
+const os = require("os");
+const debug_1 = require("./debug");
+const LIPO = 'lipo';
+var AsarMode;
+(function (AsarMode) {
+ AsarMode[AsarMode["NO_ASAR"] = 0] = "NO_ASAR";
+ AsarMode[AsarMode["HAS_ASAR"] = 1] = "HAS_ASAR";
+})(AsarMode = exports.AsarMode || (exports.AsarMode = {}));
+// See: https://github.com/apple-opensource-mirror/llvmCore/blob/0c60489d96c87140db9a6a14c6e82b15f5e5d252/include/llvm/Object/MachOFormat.h#L108-L112
+const MACHO_MAGIC = new Set([
+ // 32-bit Mach-O
+ 0xfeedface,
+ 0xcefaedfe,
+ // 64-bit Mach-O
+ 0xfeedfacf,
+ 0xcffaedfe,
+]);
+const MACHO_UNIVERSAL_MAGIC = new Set([
+ // universal
+ 0xcafebabe,
+ 0xbebafeca,
+]);
+exports.detectAsarMode = async (appPath) => {
+ debug_1.d('checking asar mode of', appPath);
+ const asarPath = path.resolve(appPath, 'Contents', 'Resources', 'app.asar');
+ if (!(await fs.pathExists(asarPath))) {
+ debug_1.d('determined no asar');
+ return AsarMode.NO_ASAR;
+ }
+ debug_1.d('determined has asar');
+ return AsarMode.HAS_ASAR;
+};
+exports.generateAsarIntegrity = (asarPath) => {
+ return {
+ algorithm: 'SHA256',
+ hash: crypto
+ .createHash('SHA256')
+ .update(asar.getRawHeader(asarPath).headerString)
+ .digest('hex'),
+ };
+};
+function toRelativePath(file) {
+ return file.replace(/^\//, '');
+}
+function isDirectory(a, file) {
+ return Boolean('files' in asar.statFile(a, file));
+}
+function checkSingleArch(archive, file, allowList) {
+ if (allowList === undefined || !minimatch(file, allowList, { matchBase: true })) {
+ throw new Error(`Detected unique file "${file}" in "${archive}" not covered by ` +
+ `allowList rule: "${allowList}"`);
+ }
+}
+exports.mergeASARs = async ({ x64AsarPath, arm64AsarPath, outputAsarPath, singleArchFiles, }) => {
+ debug_1.d(`merging ${x64AsarPath} and ${arm64AsarPath}`);
+ const x64Files = new Set(asar.listPackage(x64AsarPath).map(toRelativePath));
+ const arm64Files = new Set(asar.listPackage(arm64AsarPath).map(toRelativePath));
+ //
+ // Build set of unpacked directories and files
+ //
+ const unpackedFiles = new Set();
+ function buildUnpacked(a, fileList) {
+ for (const file of fileList) {
+ const stat = asar.statFile(a, file);
+ if (!('unpacked' in stat) || !stat.unpacked) {
+ continue;
+ }
+ if ('files' in stat) {
+ continue;
+ }
+ unpackedFiles.add(file);
+ }
+ }
+ buildUnpacked(x64AsarPath, x64Files);
+ buildUnpacked(arm64AsarPath, arm64Files);
+ //
+ // Build list of files/directories unique to each asar
+ //
+ for (const file of x64Files) {
+ if (!arm64Files.has(file)) {
+ checkSingleArch(x64AsarPath, file, singleArchFiles);
+ }
+ }
+ const arm64Unique = [];
+ for (const file of arm64Files) {
+ if (!x64Files.has(file)) {
+ checkSingleArch(arm64AsarPath, file, singleArchFiles);
+ arm64Unique.push(file);
+ }
+ }
+ //
+ // Find common bindings with different content
+ //
+ const commonBindings = [];
+ for (const file of x64Files) {
+ if (!arm64Files.has(file)) {
+ continue;
+ }
+ // Skip directories
+ if (isDirectory(x64AsarPath, file)) {
+ continue;
+ }
+ const x64Content = asar.extractFile(x64AsarPath, file);
+ const arm64Content = asar.extractFile(arm64AsarPath, file);
+ if (x64Content.compare(arm64Content) === 0) {
+ continue;
+ }
+ if (MACHO_UNIVERSAL_MAGIC.has(x64Content.readUInt32LE(0)) &&
+ MACHO_UNIVERSAL_MAGIC.has(arm64Content.readUInt32LE(0))) {
+ continue;
+ }
+ if (!MACHO_MAGIC.has(x64Content.readUInt32LE(0))) {
+ throw new Error(`Can't reconcile two non-macho files ${file}`);
+ }
+ commonBindings.push(file);
+ }
+ //
+ // Extract both
+ //
+ const x64Dir = await fs.mkdtemp(path.join(os.tmpdir(), 'x64-'));
+ const arm64Dir = await fs.mkdtemp(path.join(os.tmpdir(), 'arm64-'));
+ try {
+ debug_1.d(`extracting ${x64AsarPath} to ${x64Dir}`);
+ asar.extractAll(x64AsarPath, x64Dir);
+ debug_1.d(`extracting ${arm64AsarPath} to ${arm64Dir}`);
+ asar.extractAll(arm64AsarPath, arm64Dir);
+ for (const file of arm64Unique) {
+ const source = path.resolve(arm64Dir, file);
+ const destination = path.resolve(x64Dir, file);
+ if (isDirectory(arm64AsarPath, file)) {
+ debug_1.d(`creating unique directory: ${file}`);
+ await fs.mkdirp(destination);
+ continue;
+ }
+ debug_1.d(`xopying unique file: ${file}`);
+ await fs.mkdirp(path.dirname(destination));
+ await fs.copy(source, destination);
+ }
+ for (const binding of commonBindings) {
+ const source = await fs.realpath(path.resolve(arm64Dir, binding));
+ const destination = await fs.realpath(path.resolve(x64Dir, binding));
+ debug_1.d(`merging binding: ${binding}`);
+ child_process_1.execFileSync(LIPO, [source, destination, '-create', '-output', destination]);
+ }
+ debug_1.d(`creating archive at ${outputAsarPath}`);
+ const resolvedUnpack = Array.from(unpackedFiles).map((file) => path.join(x64Dir, file));
+ let unpack;
+ if (resolvedUnpack.length > 1) {
+ unpack = `{${resolvedUnpack.join(',')}}`;
+ }
+ else if (resolvedUnpack.length === 1) {
+ unpack = resolvedUnpack[0];
+ }
+ await asar.createPackageWithOptions(x64Dir, outputAsarPath, {
+ unpack,
+ });
+ debug_1.d('done merging');
+ }
+ finally {
+ await Promise.all([fs.remove(x64Dir), fs.remove(arm64Dir)]);
+ }
+};
+//# sourceMappingURL=asar-utils.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js.map b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js.map
new file mode 100644
index 0000000..c6b89fd
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/asar-utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"asar-utils.js","sourceRoot":"","sources":["../../src/asar-utils.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,iDAA6C;AAC7C,iCAAiC;AACjC,+BAA+B;AAC/B,6BAA6B;AAC7B,uCAAuC;AACvC,yBAAyB;AACzB,mCAA4B;AAE5B,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,+CAAQ,CAAA;AACV,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAUD,qJAAqJ;AACrJ,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,gBAAgB;IAChB,UAAU;IACV,UAAU;IAEV,gBAAgB;IAChB,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,YAAY;IACZ,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,KAAK,EAAE,OAAe,EAAE,EAAE;IACtD,SAAC,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAE5E,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE;QACpC,SAAC,CAAC,oBAAoB,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,OAAO,CAAC;KACzB;IAED,SAAC,CAAC,qBAAqB,CAAC,CAAC;IACzB,OAAO,QAAQ,CAAC,QAAQ,CAAC;AAC3B,CAAC,CAAC;AAEW,QAAA,qBAAqB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxD,OAAO;QACL,SAA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ExF,IAAI,MAA0B,CAAC;QAC/B,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SAC1C;aAAM,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YACtC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SAC5B;QAED,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,EAAE,cAAc,EAAE;YAC1D,MAAM;SACP,CAAC,CAAC;QAEH,SAAC,CAAC,cAAc,CAAC,CAAC;KACnB;YAAS;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/debug.d.ts b/desktop/node_modules/@electron/universal/dist/cjs/debug.d.ts
new file mode 100644
index 0000000..ec24d3b
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/debug.d.ts
@@ -0,0 +1,2 @@
+import * as debug from 'debug';
+export declare const d: debug.Debugger;
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/debug.js b/desktop/node_modules/@electron/universal/dist/cjs/debug.js
new file mode 100644
index 0000000..f3fccb1
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/debug.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const debug = require("debug");
+exports.d = debug('electron-universal');
+//# sourceMappingURL=debug.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/debug.js.map b/desktop/node_modules/@electron/universal/dist/cjs/debug.js.map
new file mode 100644
index 0000000..8256675
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/debug.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,CAAC,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/file-utils.d.ts b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.d.ts
new file mode 100644
index 0000000..ff08b0e
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.d.ts
@@ -0,0 +1,16 @@
+export declare enum AppFileType {
+ MACHO = 0,
+ PLAIN = 1,
+ INFO_PLIST = 2,
+ SNAPSHOT = 3,
+ APP_CODE = 4
+}
+export declare type AppFile = {
+ relativePath: string;
+ type: AppFileType;
+};
+/**
+ *
+ * @param appPath Path to the application
+ */
+export declare const getAllAppFiles: (appPath: string) => Promise<AppFile[]>;
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js
new file mode 100644
index 0000000..bed089e
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js
@@ -0,0 +1,71 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getAllAppFiles = exports.AppFileType = void 0;
+const cross_spawn_promise_1 = require("@malept/cross-spawn-promise");
+const fs = require("fs-extra");
+const path = require("path");
+const MACHO_PREFIX = 'Mach-O ';
+var AppFileType;
+(function (AppFileType) {
+ AppFileType[AppFileType["MACHO"] = 0] = "MACHO";
+ AppFileType[AppFileType["PLAIN"] = 1] = "PLAIN";
+ AppFileType[AppFileType["INFO_PLIST"] = 2] = "INFO_PLIST";
+ AppFileType[AppFileType["SNAPSHOT"] = 3] = "SNAPSHOT";
+ AppFileType[AppFileType["APP_CODE"] = 4] = "APP_CODE";
+})(AppFileType = exports.AppFileType || (exports.AppFileType = {}));
+/**
+ *
+ * @param appPath Path to the application
+ */
+exports.getAllAppFiles = async (appPath) => {
+ const files = [];
+ const visited = new Set();
+ const traverse = async (p) => {
+ p = await fs.realpath(p);
+ if (visited.has(p))
+ return;
+ visited.add(p);
+ const info = await fs.stat(p);
+ if (info.isSymbolicLink())
+ return;
+ if (info.isFile()) {
+ let fileType = AppFileType.PLAIN;
+ var fileOutput = '';
+ try {
+ fileOutput = await cross_spawn_promise_1.spawn('file', ['--brief', '--no-pad', p]);
+ }
+ catch (e) {
+ if (e instanceof cross_spawn_promise_1.ExitCodeError) {
+ /* silently accept error codes from "file" */
+ }
+ else {
+ throw e;
+ }
+ }
+ if (p.includes('app.asar')) {
+ fileType = AppFileType.APP_CODE;
+ }
+ else if (fileOutput.startsWith(MACHO_PREFIX)) {
+ fileType = AppFileType.MACHO;
+ }
+ else if (p.endsWith('.bin')) {
+ fileType = AppFileType.SNAPSHOT;
+ }
+ else if (path.basename(p) === 'Info.plist') {
+ fileType = AppFileType.INFO_PLIST;
+ }
+ files.push({
+ relativePath: path.relative(appPath, p),
+ type: fileType,
+ });
+ }
+ if (info.isDirectory()) {
+ for (const child of await fs.readdir(p)) {
+ await traverse(path.resolve(p, child));
+ }
+ }
+ };
+ await traverse(appPath);
+ return files;
+};
+//# sourceMappingURL=file-utils.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js.map b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js.map
new file mode 100644
index 0000000..1ca0c18
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/file-utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../src/file-utils.ts"],"names":[],"mappings":";;;AAAA,qEAAmE;AACnE,+BAA+B;AAC/B,6BAA6B;AAE7B,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,+CAAK,CAAA;IACL,+CAAK,CAAA;IACL,yDAAU,CAAA;IACV,qDAAQ,CAAA;IACR,qDAAQ,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AAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;aACjC;iBAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE;gBAC5C,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC;aACnC;YAED,KAAK,CAAC,IAAI,CAAC;gBACT,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;gBACvC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;SACJ;QAED,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;YACtB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBACvC,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;aACxC;SACF;IACH,CAAC,CAAC;IACF,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/index.d.ts b/desktop/node_modules/@electron/universal/dist/cjs/index.d.ts
new file mode 100644
index 0000000..e60bb7d
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/index.d.ts
@@ -0,0 +1,37 @@
+export declare type MakeUniversalOpts = {
+ /**
+ * Absolute file system path to the x64 version of your application. E.g. /Foo/bar/MyApp_x64.app
+ */
+ x64AppPath: string;
+ /**
+ * Absolute file system path to the arm64 version of your application. E.g. /Foo/bar/MyApp_arm64.app
+ */
+ arm64AppPath: string;
+ /**
+ * Absolute file system path you want the universal app to be written to. E.g. /Foo/var/MyApp_universal.app
+ *
+ * If this file exists it will be overwritten ONLY if "force" is set to true
+ */
+ outAppPath: string;
+ /**
+ * Forcefully overwrite any existing files that are in the way of generating the universal application
+ */
+ force: boolean;
+ /**
+ * Merge x64 and arm64 ASARs into one.
+ */
+ mergeASARs?: boolean;
+ /**
+ * Minimatch pattern of paths that are allowed to be present in one of the ASAR files, but not in the other.
+ */
+ singleArchFiles?: string;
+ /**
+ * Minimatch pattern of binaries that are expected to be the same x64 binary in both of the ASAR files.
+ */
+ x64ArchFiles?: string;
+ /**
+ * Minimatch pattern of paths that should not receive an injected ElectronAsarIntegrity value
+ */
+ infoPlistsToIgnore?: string;
+};
+export declare const makeUniversalApp: (opts: MakeUniversalOpts) => Promise<void>;
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/index.js b/desktop/node_modules/@electron/universal/dist/cjs/index.js
new file mode 100644
index 0000000..0b62702
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/index.js
@@ -0,0 +1,231 @@
+"use strict";
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.makeUniversalApp = void 0;
+const cross_spawn_promise_1 = require("@malept/cross-spawn-promise");
+const asar = require("@electron/asar");
+const fs = require("fs-extra");
+const minimatch = require("minimatch");
+const os = require("os");
+const path = require("path");
+const plist = require("plist");
+const dircompare = require("dir-compare");
+const file_utils_1 = require("./file-utils");
+const asar_utils_1 = require("./asar-utils");
+const sha_1 = require("./sha");
+const debug_1 = require("./debug");
+const dupedFiles = (files) => files.filter((f) => f.type !== file_utils_1.AppFileType.SNAPSHOT && f.type !== file_utils_1.AppFileType.APP_CODE);
+exports.makeUniversalApp = async (opts) => {
+ debug_1.d('making a universal app with options', opts);
+ if (process.platform !== 'darwin')
+ throw new Error('@electron/universal is only supported on darwin platforms');
+ if (!opts.x64AppPath || !path.isAbsolute(opts.x64AppPath))
+ throw new Error('Expected opts.x64AppPath to be an absolute path but it was not');
+ if (!opts.arm64AppPath || !path.isAbsolute(opts.arm64AppPath))
+ throw new Error('Expected opts.arm64AppPath to be an absolute path but it was not');
+ if (!opts.outAppPath || !path.isAbsolute(opts.outAppPath))
+ throw new Error('Expected opts.outAppPath to be an absolute path but it was not');
+ if (await fs.pathExists(opts.outAppPath)) {
+ debug_1.d('output path exists already');
+ if (!opts.force) {
+ throw new Error(`The out path "${opts.outAppPath}" already exists and force is not set to true`);
+ }
+ else {
+ debug_1.d('overwriting existing application because force == true');
+ await fs.remove(opts.outAppPath);
+ }
+ }
+ const x64AsarMode = await asar_utils_1.detectAsarMode(opts.x64AppPath);
+ const arm64AsarMode = await asar_utils_1.detectAsarMode(opts.arm64AppPath);
+ debug_1.d('detected x64AsarMode =', x64AsarMode);
+ debug_1.d('detected arm64AsarMode =', arm64AsarMode);
+ if (x64AsarMode !== arm64AsarMode)
+ throw new Error('Both the x64 and arm64 versions of your application need to have been built with the same asar settings (enabled vs disabled)');
+ const tmpDir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-universal-'));
+ debug_1.d('building universal app in', tmpDir);
+ try {
+ debug_1.d('copying x64 app as starter template');
+ const tmpApp = path.resolve(tmpDir, 'Tmp.app');
+ await cross_spawn_promise_1.spawn('cp', ['-R', opts.x64AppPath, tmpApp]);
+ const uniqueToX64 = [];
+ const uniqueToArm64 = [];
+ const x64Files = await file_utils_1.getAllAppFiles(await fs.realpath(tmpApp));
+ const arm64Files = await file_utils_1.getAllAppFiles(await fs.realpath(opts.arm64AppPath));
+ for (const file of dupedFiles(x64Files)) {
+ if (!arm64Files.some((f) => f.relativePath === file.relativePath))
+ uniqueToX64.push(file.relativePath);
+ }
+ for (const file of dupedFiles(arm64Files)) {
+ if (!x64Files.some((f) => f.relativePath === file.relativePath))
+ uniqueToArm64.push(file.relativePath);
+ }
+ if (uniqueToX64.length !== 0 || uniqueToArm64.length !== 0) {
+ debug_1.d('some files were not in both builds, aborting');
+ console.error({
+ uniqueToX64,
+ uniqueToArm64,
+ });
+ throw new Error('While trying to merge mach-o files across your apps we found a mismatch, the number of mach-o files is not the same between the arm64 and x64 builds');
+ }
+ for (const file of x64Files.filter((f) => f.type === file_utils_1.AppFileType.PLAIN)) {
+ const x64Sha = await sha_1.sha(path.resolve(opts.x64AppPath, file.relativePath));
+ const arm64Sha = await sha_1.sha(path.resolve(opts.arm64AppPath, file.relativePath));
+ if (x64Sha !== arm64Sha) {
+ debug_1.d('SHA for file', file.relativePath, `does not match across builds ${x64Sha}!=${arm64Sha}`);
+ // The MainMenu.nib files generated by Xcode13 are deterministic in effect but not deterministic in generated sequence
+ if (path.basename(path.dirname(file.relativePath)) === 'MainMenu.nib') {
+ // The mismatch here is OK so we just move on to the next one
+ continue;
+ }
+ throw new Error(`Expected all non-binary files to have identical SHAs when creating a universal build but "${file.relativePath}" did not`);
+ }
+ }
+ for (const machOFile of x64Files.filter((f) => f.type === file_utils_1.AppFileType.MACHO)) {
+ const first = await fs.realpath(path.resolve(tmpApp, machOFile.relativePath));
+ const second = await fs.realpath(path.resolve(opts.arm64AppPath, machOFile.relativePath));
+ const x64Sha = await sha_1.sha(path.resolve(opts.x64AppPath, machOFile.relativePath));
+ const arm64Sha = await sha_1.sha(path.resolve(opts.arm64AppPath, machOFile.relativePath));
+ if (x64Sha === arm64Sha) {
+ if (opts.x64ArchFiles === undefined ||
+ !minimatch(machOFile.relativePath, opts.x64ArchFiles, { matchBase: true })) {
+ throw new Error(`Detected file "${machOFile.relativePath}" that's the same in both x64 and arm64 builds and not covered by the ` +
+ `x64ArchFiles rule: "${opts.x64ArchFiles}"`);
+ }
+ debug_1.d('SHA for Mach-O file', machOFile.relativePath, `matches across builds ${x64Sha}===${arm64Sha}, skipping lipo`);
+ continue;
+ }
+ debug_1.d('joining two MachO files with lipo', {
+ first,
+ second,
+ });
+ await cross_spawn_promise_1.spawn('lipo', [
+ first,
+ second,
+ '-create',
+ '-output',
+ await fs.realpath(path.resolve(tmpApp, machOFile.relativePath)),
+ ]);
+ }
+ /**
+ * If we don't have an ASAR we need to check if the two "app" folders are identical, if
+ * they are then we can just leave one there and call it a day. If the app folders for x64
+ * and arm64 are different though we need to rename each folder and create a new fake "app"
+ * entrypoint to dynamically load the correct app folder
+ */
+ if (x64AsarMode === asar_utils_1.AsarMode.NO_ASAR) {
+ debug_1.d('checking if the x64 and arm64 app folders are identical');
+ const comparison = await dircompare.compare(path.resolve(tmpApp, 'Contents', 'Resources', 'app'), path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app'), { compareSize: true, compareContent: true });
+ if (!comparison.same) {
+ debug_1.d('x64 and arm64 app folders are different, creating dynamic entry ASAR');
+ await fs.move(path.resolve(tmpApp, 'Contents', 'Resources', 'app'), path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64'));
+ await fs.copy(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app'), path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64'));
+ const entryAsar = path.resolve(tmpDir, 'entry-asar');
+ await fs.mkdir(entryAsar);
+ await fs.copy(path.resolve(__dirname, '..', '..', 'entry-asar', 'no-asar.js'), path.resolve(entryAsar, 'index.js'));
+ let pj = await fs.readJson(path.resolve(opts.x64AppPath, 'Contents', 'Resources', 'app', 'package.json'));
+ pj.main = 'index.js';
+ await fs.writeJson(path.resolve(entryAsar, 'package.json'), pj);
+ await asar.createPackage(entryAsar, path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ }
+ else {
+ debug_1.d('x64 and arm64 app folders are the same');
+ }
+ }
+ const generatedIntegrity = {};
+ let didSplitAsar = false;
+ /**
+ * If we have an ASAR we just need to check if the two "app.asar" files have the same hash,
+ * if they are, same as above, we can leave one there and call it a day. If they're different
+ * we have to make a dynamic entrypoint. There is an assumption made here that every file in
+ * app.asar.unpacked is a native node module. This assumption _may_ not be true so we should
+ * look at codifying that assumption as actual logic.
+ */
+ // FIXME: Codify the assumption that app.asar.unpacked only contains native modules
+ if (x64AsarMode === asar_utils_1.AsarMode.HAS_ASAR && opts.mergeASARs) {
+ debug_1.d('merging x64 and arm64 asars');
+ const output = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar');
+ await asar_utils_1.mergeASARs({
+ x64AsarPath: path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'),
+ arm64AsarPath: path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'),
+ outputAsarPath: output,
+ singleArchFiles: opts.singleArchFiles,
+ });
+ generatedIntegrity['Resources/app.asar'] = asar_utils_1.generateAsarIntegrity(output);
+ }
+ else if (x64AsarMode === asar_utils_1.AsarMode.HAS_ASAR) {
+ debug_1.d('checking if the x64 and arm64 asars are identical');
+ const x64AsarSha = await sha_1.sha(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ const arm64AsarSha = await sha_1.sha(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'));
+ if (x64AsarSha !== arm64AsarSha) {
+ didSplitAsar = true;
+ debug_1.d('x64 and arm64 asars are different');
+ const x64AsarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64.asar');
+ await fs.move(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'), x64AsarPath);
+ const x64Unpacked = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar.unpacked');
+ if (await fs.pathExists(x64Unpacked)) {
+ await fs.move(x64Unpacked, path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64.asar.unpacked'));
+ }
+ const arm64AsarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64.asar');
+ await fs.copy(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'), arm64AsarPath);
+ const arm64Unpacked = path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar.unpacked');
+ if (await fs.pathExists(arm64Unpacked)) {
+ await fs.copy(arm64Unpacked, path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64.asar.unpacked'));
+ }
+ const entryAsar = path.resolve(tmpDir, 'entry-asar');
+ await fs.mkdir(entryAsar);
+ await fs.copy(path.resolve(__dirname, '..', '..', 'entry-asar', 'has-asar.js'), path.resolve(entryAsar, 'index.js'));
+ let pj = JSON.parse((await asar.extractFile(path.resolve(opts.x64AppPath, 'Contents', 'Resources', 'app.asar'), 'package.json')).toString('utf8'));
+ pj.main = 'index.js';
+ await fs.writeJson(path.resolve(entryAsar, 'package.json'), pj);
+ const asarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar');
+ await asar.createPackage(entryAsar, asarPath);
+ generatedIntegrity['Resources/app.asar'] = asar_utils_1.generateAsarIntegrity(asarPath);
+ generatedIntegrity['Resources/app-x64.asar'] = asar_utils_1.generateAsarIntegrity(x64AsarPath);
+ generatedIntegrity['Resources/app-arm64.asar'] = asar_utils_1.generateAsarIntegrity(arm64AsarPath);
+ }
+ else {
+ debug_1.d('x64 and arm64 asars are the same');
+ generatedIntegrity['Resources/app.asar'] = asar_utils_1.generateAsarIntegrity(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ }
+ }
+ const plistFiles = x64Files.filter((f) => f.type === file_utils_1.AppFileType.INFO_PLIST);
+ for (const plistFile of plistFiles) {
+ const x64PlistPath = path.resolve(opts.x64AppPath, plistFile.relativePath);
+ const arm64PlistPath = path.resolve(opts.arm64AppPath, plistFile.relativePath);
+ const _a = plist.parse(await fs.readFile(x64PlistPath, 'utf8')), { ElectronAsarIntegrity: x64Integrity } = _a, x64Plist = __rest(_a, ["ElectronAsarIntegrity"]);
+ const _b = plist.parse(await fs.readFile(arm64PlistPath, 'utf8')), { ElectronAsarIntegrity: arm64Integrity } = _b, arm64Plist = __rest(_b, ["ElectronAsarIntegrity"]);
+ if (JSON.stringify(x64Plist) !== JSON.stringify(arm64Plist)) {
+ throw new Error(`Expected all Info.plist files to be identical when ignoring integrity when creating a universal build but "${plistFile.relativePath}" was not`);
+ }
+ const injectAsarIntegrity = !opts.infoPlistsToIgnore ||
+ minimatch(plistFile.relativePath, opts.infoPlistsToIgnore, { matchBase: true });
+ const mergedPlist = injectAsarIntegrity
+ ? Object.assign(Object.assign({}, x64Plist), { ElectronAsarIntegrity: generatedIntegrity }) : Object.assign({}, x64Plist);
+ await fs.writeFile(path.resolve(tmpApp, plistFile.relativePath), plist.build(mergedPlist));
+ }
+ for (const snapshotsFile of arm64Files.filter((f) => f.type === file_utils_1.AppFileType.SNAPSHOT)) {
+ debug_1.d('copying snapshot file', snapshotsFile.relativePath, 'to target application');
+ await fs.copy(path.resolve(opts.arm64AppPath, snapshotsFile.relativePath), path.resolve(tmpApp, snapshotsFile.relativePath));
+ }
+ debug_1.d('moving final universal app to target destination');
+ await fs.mkdirp(path.dirname(opts.outAppPath));
+ await cross_spawn_promise_1.spawn('mv', [tmpApp, opts.outAppPath]);
+ }
+ catch (err) {
+ throw err;
+ }
+ finally {
+ await fs.remove(tmpDir);
+ }
+};
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/index.js.map b/desktop/node_modules/@electron/universal/dist/cjs/index.js.map
new file mode 100644
index 0000000..0c3c65c
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qEAAoD;AACpD,uCAAuC;AAEvC,+BAA+B;AAC/B,uCAAuC;AACvC,yBAAyB;AACzB,6BAA6B;AAC7B,+BAA+B;AAC/B,0CAA0C;AAE1C,6CAAoE;AACpE,6CAA2F;AAC3F,+BAA4B;AAC5B,mCAA4B;AAuC5B,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAE,EAAE,CACtC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,wBAAW,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK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CAAC,CAAC;KAC9C;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,GAAG,CAAC;KACX;YAAS;QACR,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;KACzB;AACH,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/sha.d.ts b/desktop/node_modules/@electron/universal/dist/cjs/sha.d.ts
new file mode 100644
index 0000000..1c0daaa
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/sha.d.ts
@@ -0,0 +1 @@
+export declare const sha: (filePath: string) => Promise<any>;
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/sha.js b/desktop/node_modules/@electron/universal/dist/cjs/sha.js
new file mode 100644
index 0000000..801fe61
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/sha.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sha = void 0;
+const fs = require("fs-extra");
+const crypto = require("crypto");
+const debug_1 = require("./debug");
+exports.sha = async (filePath) => {
+ debug_1.d('hashing', filePath);
+ const hash = crypto.createHash('sha256');
+ hash.setEncoding('hex');
+ const fileStream = fs.createReadStream(filePath);
+ fileStream.pipe(hash);
+ await new Promise((resolve, reject) => {
+ fileStream.on('end', () => resolve());
+ fileStream.on('error', (err) => reject(err));
+ });
+ return hash.read();
+};
+//# sourceMappingURL=sha.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/cjs/sha.js.map b/desktop/node_modules/@electron/universal/dist/cjs/sha.js.map
new file mode 100644
index 0000000..3bfffd8
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/cjs/sha.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"sha.js","sourceRoot":"","sources":["../../src/sha.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAiC;AACjC,mCAA4B;AAEf,QAAA,GAAG,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;IAC5C,SAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACjD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACtC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/asar-utils.d.ts b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.d.ts
new file mode 100644
index 0000000..530b52b
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.d.ts
@@ -0,0 +1,16 @@
+export declare enum AsarMode {
+ NO_ASAR = 0,
+ HAS_ASAR = 1
+}
+export declare type MergeASARsOptions = {
+ x64AsarPath: string;
+ arm64AsarPath: string;
+ outputAsarPath: string;
+ singleArchFiles?: string;
+};
+export declare const detectAsarMode: (appPath: string) => Promise<AsarMode>;
+export declare const generateAsarIntegrity: (asarPath: string) => {
+ algorithm: "SHA256";
+ hash: string;
+};
+export declare const mergeASARs: ({ x64AsarPath, arm64AsarPath, outputAsarPath, singleArchFiles, }: MergeASARsOptions) => Promise<void>;
diff --git a/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js
new file mode 100644
index 0000000..efab848
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js
@@ -0,0 +1,169 @@
+import * as asar from '@electron/asar';
+import { execFileSync } from 'child_process';
+import * as crypto from 'crypto';
+import * as fs from 'fs-extra';
+import * as path from 'path';
+import * as minimatch from 'minimatch';
+import * as os from 'os';
+import { d } from './debug';
+const LIPO = 'lipo';
+export var AsarMode;
+(function (AsarMode) {
+ AsarMode[AsarMode["NO_ASAR"] = 0] = "NO_ASAR";
+ AsarMode[AsarMode["HAS_ASAR"] = 1] = "HAS_ASAR";
+})(AsarMode || (AsarMode = {}));
+// See: https://github.com/apple-opensource-mirror/llvmCore/blob/0c60489d96c87140db9a6a14c6e82b15f5e5d252/include/llvm/Object/MachOFormat.h#L108-L112
+const MACHO_MAGIC = new Set([
+ // 32-bit Mach-O
+ 0xfeedface,
+ 0xcefaedfe,
+ // 64-bit Mach-O
+ 0xfeedfacf,
+ 0xcffaedfe,
+]);
+const MACHO_UNIVERSAL_MAGIC = new Set([
+ // universal
+ 0xcafebabe,
+ 0xbebafeca,
+]);
+export const detectAsarMode = async (appPath) => {
+ d('checking asar mode of', appPath);
+ const asarPath = path.resolve(appPath, 'Contents', 'Resources', 'app.asar');
+ if (!(await fs.pathExists(asarPath))) {
+ d('determined no asar');
+ return AsarMode.NO_ASAR;
+ }
+ d('determined has asar');
+ return AsarMode.HAS_ASAR;
+};
+export const generateAsarIntegrity = (asarPath) => {
+ return {
+ algorithm: 'SHA256',
+ hash: crypto
+ .createHash('SHA256')
+ .update(asar.getRawHeader(asarPath).headerString)
+ .digest('hex'),
+ };
+};
+function toRelativePath(file) {
+ return file.replace(/^\//, '');
+}
+function isDirectory(a, file) {
+ return Boolean('files' in asar.statFile(a, file));
+}
+function checkSingleArch(archive, file, allowList) {
+ if (allowList === undefined || !minimatch(file, allowList, { matchBase: true })) {
+ throw new Error(`Detected unique file "${file}" in "${archive}" not covered by ` +
+ `allowList rule: "${allowList}"`);
+ }
+}
+export const mergeASARs = async ({ x64AsarPath, arm64AsarPath, outputAsarPath, singleArchFiles, }) => {
+ d(`merging ${x64AsarPath} and ${arm64AsarPath}`);
+ const x64Files = new Set(asar.listPackage(x64AsarPath).map(toRelativePath));
+ const arm64Files = new Set(asar.listPackage(arm64AsarPath).map(toRelativePath));
+ //
+ // Build set of unpacked directories and files
+ //
+ const unpackedFiles = new Set();
+ function buildUnpacked(a, fileList) {
+ for (const file of fileList) {
+ const stat = asar.statFile(a, file);
+ if (!('unpacked' in stat) || !stat.unpacked) {
+ continue;
+ }
+ if ('files' in stat) {
+ continue;
+ }
+ unpackedFiles.add(file);
+ }
+ }
+ buildUnpacked(x64AsarPath, x64Files);
+ buildUnpacked(arm64AsarPath, arm64Files);
+ //
+ // Build list of files/directories unique to each asar
+ //
+ for (const file of x64Files) {
+ if (!arm64Files.has(file)) {
+ checkSingleArch(x64AsarPath, file, singleArchFiles);
+ }
+ }
+ const arm64Unique = [];
+ for (const file of arm64Files) {
+ if (!x64Files.has(file)) {
+ checkSingleArch(arm64AsarPath, file, singleArchFiles);
+ arm64Unique.push(file);
+ }
+ }
+ //
+ // Find common bindings with different content
+ //
+ const commonBindings = [];
+ for (const file of x64Files) {
+ if (!arm64Files.has(file)) {
+ continue;
+ }
+ // Skip directories
+ if (isDirectory(x64AsarPath, file)) {
+ continue;
+ }
+ const x64Content = asar.extractFile(x64AsarPath, file);
+ const arm64Content = asar.extractFile(arm64AsarPath, file);
+ if (x64Content.compare(arm64Content) === 0) {
+ continue;
+ }
+ if (MACHO_UNIVERSAL_MAGIC.has(x64Content.readUInt32LE(0)) &&
+ MACHO_UNIVERSAL_MAGIC.has(arm64Content.readUInt32LE(0))) {
+ continue;
+ }
+ if (!MACHO_MAGIC.has(x64Content.readUInt32LE(0))) {
+ throw new Error(`Can't reconcile two non-macho files ${file}`);
+ }
+ commonBindings.push(file);
+ }
+ //
+ // Extract both
+ //
+ const x64Dir = await fs.mkdtemp(path.join(os.tmpdir(), 'x64-'));
+ const arm64Dir = await fs.mkdtemp(path.join(os.tmpdir(), 'arm64-'));
+ try {
+ d(`extracting ${x64AsarPath} to ${x64Dir}`);
+ asar.extractAll(x64AsarPath, x64Dir);
+ d(`extracting ${arm64AsarPath} to ${arm64Dir}`);
+ asar.extractAll(arm64AsarPath, arm64Dir);
+ for (const file of arm64Unique) {
+ const source = path.resolve(arm64Dir, file);
+ const destination = path.resolve(x64Dir, file);
+ if (isDirectory(arm64AsarPath, file)) {
+ d(`creating unique directory: ${file}`);
+ await fs.mkdirp(destination);
+ continue;
+ }
+ d(`xopying unique file: ${file}`);
+ await fs.mkdirp(path.dirname(destination));
+ await fs.copy(source, destination);
+ }
+ for (const binding of commonBindings) {
+ const source = await fs.realpath(path.resolve(arm64Dir, binding));
+ const destination = await fs.realpath(path.resolve(x64Dir, binding));
+ d(`merging binding: ${binding}`);
+ execFileSync(LIPO, [source, destination, '-create', '-output', destination]);
+ }
+ d(`creating archive at ${outputAsarPath}`);
+ const resolvedUnpack = Array.from(unpackedFiles).map((file) => path.join(x64Dir, file));
+ let unpack;
+ if (resolvedUnpack.length > 1) {
+ unpack = `{${resolvedUnpack.join(',')}}`;
+ }
+ else if (resolvedUnpack.length === 1) {
+ unpack = resolvedUnpack[0];
+ }
+ await asar.createPackageWithOptions(x64Dir, outputAsarPath, {
+ unpack,
+ });
+ d('done merging');
+ }
+ finally {
+ await Promise.all([fs.remove(x64Dir), fs.remove(arm64Dir)]);
+ }
+};
+//# sourceMappingURL=asar-utils.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js.map b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js.map
new file mode 100644
index 0000000..ca5d07d
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/asar-utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"asar-utils.js","sourceRoot":"","sources":["../../src/asar-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,g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I,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QAExF,IAAI,MAA0B,CAAC;QAC/B,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SAC1C;aAAM,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YACtC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SAC5B;QAED,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,EAAE,cAAc,EAAE;YAC1D,MAAM;SACP,CAAC,CAAC;QAEH,CAAC,CAAC,cAAc,CAAC,CAAC;KACnB;YAAS;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/debug.d.ts b/desktop/node_modules/@electron/universal/dist/esm/debug.d.ts
new file mode 100644
index 0000000..ec24d3b
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/debug.d.ts
@@ -0,0 +1,2 @@
+import * as debug from 'debug';
+export declare const d: debug.Debugger;
diff --git a/desktop/node_modules/@electron/universal/dist/esm/debug.js b/desktop/node_modules/@electron/universal/dist/esm/debug.js
new file mode 100644
index 0000000..449f78f
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/debug.js
@@ -0,0 +1,3 @@
+import * as debug from 'debug';
+export const d = debug('electron-universal');
+//# sourceMappingURL=debug.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/debug.js.map b/desktop/node_modules/@electron/universal/dist/esm/debug.js.map
new file mode 100644
index 0000000..7804bed
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/debug.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/file-utils.d.ts b/desktop/node_modules/@electron/universal/dist/esm/file-utils.d.ts
new file mode 100644
index 0000000..ff08b0e
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/file-utils.d.ts
@@ -0,0 +1,16 @@
+export declare enum AppFileType {
+ MACHO = 0,
+ PLAIN = 1,
+ INFO_PLIST = 2,
+ SNAPSHOT = 3,
+ APP_CODE = 4
+}
+export declare type AppFile = {
+ relativePath: string;
+ type: AppFileType;
+};
+/**
+ *
+ * @param appPath Path to the application
+ */
+export declare const getAllAppFiles: (appPath: string) => Promise<AppFile[]>;
diff --git a/desktop/node_modules/@electron/universal/dist/esm/file-utils.js b/desktop/node_modules/@electron/universal/dist/esm/file-utils.js
new file mode 100644
index 0000000..68eb4b8
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/file-utils.js
@@ -0,0 +1,68 @@
+import { spawn, ExitCodeError } from '@malept/cross-spawn-promise';
+import * as fs from 'fs-extra';
+import * as path from 'path';
+const MACHO_PREFIX = 'Mach-O ';
+export var AppFileType;
+(function (AppFileType) {
+ AppFileType[AppFileType["MACHO"] = 0] = "MACHO";
+ AppFileType[AppFileType["PLAIN"] = 1] = "PLAIN";
+ AppFileType[AppFileType["INFO_PLIST"] = 2] = "INFO_PLIST";
+ AppFileType[AppFileType["SNAPSHOT"] = 3] = "SNAPSHOT";
+ AppFileType[AppFileType["APP_CODE"] = 4] = "APP_CODE";
+})(AppFileType || (AppFileType = {}));
+/**
+ *
+ * @param appPath Path to the application
+ */
+export const getAllAppFiles = async (appPath) => {
+ const files = [];
+ const visited = new Set();
+ const traverse = async (p) => {
+ p = await fs.realpath(p);
+ if (visited.has(p))
+ return;
+ visited.add(p);
+ const info = await fs.stat(p);
+ if (info.isSymbolicLink())
+ return;
+ if (info.isFile()) {
+ let fileType = AppFileType.PLAIN;
+ var fileOutput = '';
+ try {
+ fileOutput = await spawn('file', ['--brief', '--no-pad', p]);
+ }
+ catch (e) {
+ if (e instanceof ExitCodeError) {
+ /* silently accept error codes from "file" */
+ }
+ else {
+ throw e;
+ }
+ }
+ if (p.includes('app.asar')) {
+ fileType = AppFileType.APP_CODE;
+ }
+ else if (fileOutput.startsWith(MACHO_PREFIX)) {
+ fileType = AppFileType.MACHO;
+ }
+ else if (p.endsWith('.bin')) {
+ fileType = AppFileType.SNAPSHOT;
+ }
+ else if (path.basename(p) === 'Info.plist') {
+ fileType = AppFileType.INFO_PLIST;
+ }
+ files.push({
+ relativePath: path.relative(appPath, p),
+ type: fileType,
+ });
+ }
+ if (info.isDirectory()) {
+ for (const child of await fs.readdir(p)) {
+ await traverse(path.resolve(p, child));
+ }
+ }
+ };
+ await traverse(appPath);
+ return files;
+};
+//# sourceMappingURL=file-utils.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/file-utils.js.map b/desktop/node_modules/@electron/universal/dist/esm/file-utils.js.map
new file mode 100644
index 0000000..7b095a5
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/file-utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../src/file-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,+CAAK,CAAA;IACL,+CAAK,CAA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,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC7B,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;aACjC;iBAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE;gBAC5C,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC;aACnC;YAED,KAAK,CAAC,IAAI,CAAC;gBACT,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;gBACvC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;SACJ;QAED,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;YACtB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBACvC,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;aACxC;SACF;IACH,CAAC,CAAC;IACF,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/index.d.ts b/desktop/node_modules/@electron/universal/dist/esm/index.d.ts
new file mode 100644
index 0000000..e60bb7d
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/index.d.ts
@@ -0,0 +1,37 @@
+export declare type MakeUniversalOpts = {
+ /**
+ * Absolute file system path to the x64 version of your application. E.g. /Foo/bar/MyApp_x64.app
+ */
+ x64AppPath: string;
+ /**
+ * Absolute file system path to the arm64 version of your application. E.g. /Foo/bar/MyApp_arm64.app
+ */
+ arm64AppPath: string;
+ /**
+ * Absolute file system path you want the universal app to be written to. E.g. /Foo/var/MyApp_universal.app
+ *
+ * If this file exists it will be overwritten ONLY if "force" is set to true
+ */
+ outAppPath: string;
+ /**
+ * Forcefully overwrite any existing files that are in the way of generating the universal application
+ */
+ force: boolean;
+ /**
+ * Merge x64 and arm64 ASARs into one.
+ */
+ mergeASARs?: boolean;
+ /**
+ * Minimatch pattern of paths that are allowed to be present in one of the ASAR files, but not in the other.
+ */
+ singleArchFiles?: string;
+ /**
+ * Minimatch pattern of binaries that are expected to be the same x64 binary in both of the ASAR files.
+ */
+ x64ArchFiles?: string;
+ /**
+ * Minimatch pattern of paths that should not receive an injected ElectronAsarIntegrity value
+ */
+ infoPlistsToIgnore?: string;
+};
+export declare const makeUniversalApp: (opts: MakeUniversalOpts) => Promise<void>;
diff --git a/desktop/node_modules/@electron/universal/dist/esm/index.js b/desktop/node_modules/@electron/universal/dist/esm/index.js
new file mode 100644
index 0000000..7074398
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/index.js
@@ -0,0 +1,228 @@
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+import { spawn } from '@malept/cross-spawn-promise';
+import * as asar from '@electron/asar';
+import * as fs from 'fs-extra';
+import * as minimatch from 'minimatch';
+import * as os from 'os';
+import * as path from 'path';
+import * as plist from 'plist';
+import * as dircompare from 'dir-compare';
+import { AppFileType, getAllAppFiles } from './file-utils';
+import { AsarMode, detectAsarMode, generateAsarIntegrity, mergeASARs } from './asar-utils';
+import { sha } from './sha';
+import { d } from './debug';
+const dupedFiles = (files) => files.filter((f) => f.type !== AppFileType.SNAPSHOT && f.type !== AppFileType.APP_CODE);
+export const makeUniversalApp = async (opts) => {
+ d('making a universal app with options', opts);
+ if (process.platform !== 'darwin')
+ throw new Error('@electron/universal is only supported on darwin platforms');
+ if (!opts.x64AppPath || !path.isAbsolute(opts.x64AppPath))
+ throw new Error('Expected opts.x64AppPath to be an absolute path but it was not');
+ if (!opts.arm64AppPath || !path.isAbsolute(opts.arm64AppPath))
+ throw new Error('Expected opts.arm64AppPath to be an absolute path but it was not');
+ if (!opts.outAppPath || !path.isAbsolute(opts.outAppPath))
+ throw new Error('Expected opts.outAppPath to be an absolute path but it was not');
+ if (await fs.pathExists(opts.outAppPath)) {
+ d('output path exists already');
+ if (!opts.force) {
+ throw new Error(`The out path "${opts.outAppPath}" already exists and force is not set to true`);
+ }
+ else {
+ d('overwriting existing application because force == true');
+ await fs.remove(opts.outAppPath);
+ }
+ }
+ const x64AsarMode = await detectAsarMode(opts.x64AppPath);
+ const arm64AsarMode = await detectAsarMode(opts.arm64AppPath);
+ d('detected x64AsarMode =', x64AsarMode);
+ d('detected arm64AsarMode =', arm64AsarMode);
+ if (x64AsarMode !== arm64AsarMode)
+ throw new Error('Both the x64 and arm64 versions of your application need to have been built with the same asar settings (enabled vs disabled)');
+ const tmpDir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-universal-'));
+ d('building universal app in', tmpDir);
+ try {
+ d('copying x64 app as starter template');
+ const tmpApp = path.resolve(tmpDir, 'Tmp.app');
+ await spawn('cp', ['-R', opts.x64AppPath, tmpApp]);
+ const uniqueToX64 = [];
+ const uniqueToArm64 = [];
+ const x64Files = await getAllAppFiles(await fs.realpath(tmpApp));
+ const arm64Files = await getAllAppFiles(await fs.realpath(opts.arm64AppPath));
+ for (const file of dupedFiles(x64Files)) {
+ if (!arm64Files.some((f) => f.relativePath === file.relativePath))
+ uniqueToX64.push(file.relativePath);
+ }
+ for (const file of dupedFiles(arm64Files)) {
+ if (!x64Files.some((f) => f.relativePath === file.relativePath))
+ uniqueToArm64.push(file.relativePath);
+ }
+ if (uniqueToX64.length !== 0 || uniqueToArm64.length !== 0) {
+ d('some files were not in both builds, aborting');
+ console.error({
+ uniqueToX64,
+ uniqueToArm64,
+ });
+ throw new Error('While trying to merge mach-o files across your apps we found a mismatch, the number of mach-o files is not the same between the arm64 and x64 builds');
+ }
+ for (const file of x64Files.filter((f) => f.type === AppFileType.PLAIN)) {
+ const x64Sha = await sha(path.resolve(opts.x64AppPath, file.relativePath));
+ const arm64Sha = await sha(path.resolve(opts.arm64AppPath, file.relativePath));
+ if (x64Sha !== arm64Sha) {
+ d('SHA for file', file.relativePath, `does not match across builds ${x64Sha}!=${arm64Sha}`);
+ // The MainMenu.nib files generated by Xcode13 are deterministic in effect but not deterministic in generated sequence
+ if (path.basename(path.dirname(file.relativePath)) === 'MainMenu.nib') {
+ // The mismatch here is OK so we just move on to the next one
+ continue;
+ }
+ throw new Error(`Expected all non-binary files to have identical SHAs when creating a universal build but "${file.relativePath}" did not`);
+ }
+ }
+ for (const machOFile of x64Files.filter((f) => f.type === AppFileType.MACHO)) {
+ const first = await fs.realpath(path.resolve(tmpApp, machOFile.relativePath));
+ const second = await fs.realpath(path.resolve(opts.arm64AppPath, machOFile.relativePath));
+ const x64Sha = await sha(path.resolve(opts.x64AppPath, machOFile.relativePath));
+ const arm64Sha = await sha(path.resolve(opts.arm64AppPath, machOFile.relativePath));
+ if (x64Sha === arm64Sha) {
+ if (opts.x64ArchFiles === undefined ||
+ !minimatch(machOFile.relativePath, opts.x64ArchFiles, { matchBase: true })) {
+ throw new Error(`Detected file "${machOFile.relativePath}" that's the same in both x64 and arm64 builds and not covered by the ` +
+ `x64ArchFiles rule: "${opts.x64ArchFiles}"`);
+ }
+ d('SHA for Mach-O file', machOFile.relativePath, `matches across builds ${x64Sha}===${arm64Sha}, skipping lipo`);
+ continue;
+ }
+ d('joining two MachO files with lipo', {
+ first,
+ second,
+ });
+ await spawn('lipo', [
+ first,
+ second,
+ '-create',
+ '-output',
+ await fs.realpath(path.resolve(tmpApp, machOFile.relativePath)),
+ ]);
+ }
+ /**
+ * If we don't have an ASAR we need to check if the two "app" folders are identical, if
+ * they are then we can just leave one there and call it a day. If the app folders for x64
+ * and arm64 are different though we need to rename each folder and create a new fake "app"
+ * entrypoint to dynamically load the correct app folder
+ */
+ if (x64AsarMode === AsarMode.NO_ASAR) {
+ d('checking if the x64 and arm64 app folders are identical');
+ const comparison = await dircompare.compare(path.resolve(tmpApp, 'Contents', 'Resources', 'app'), path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app'), { compareSize: true, compareContent: true });
+ if (!comparison.same) {
+ d('x64 and arm64 app folders are different, creating dynamic entry ASAR');
+ await fs.move(path.resolve(tmpApp, 'Contents', 'Resources', 'app'), path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64'));
+ await fs.copy(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app'), path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64'));
+ const entryAsar = path.resolve(tmpDir, 'entry-asar');
+ await fs.mkdir(entryAsar);
+ await fs.copy(path.resolve(__dirname, '..', '..', 'entry-asar', 'no-asar.js'), path.resolve(entryAsar, 'index.js'));
+ let pj = await fs.readJson(path.resolve(opts.x64AppPath, 'Contents', 'Resources', 'app', 'package.json'));
+ pj.main = 'index.js';
+ await fs.writeJson(path.resolve(entryAsar, 'package.json'), pj);
+ await asar.createPackage(entryAsar, path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ }
+ else {
+ d('x64 and arm64 app folders are the same');
+ }
+ }
+ const generatedIntegrity = {};
+ let didSplitAsar = false;
+ /**
+ * If we have an ASAR we just need to check if the two "app.asar" files have the same hash,
+ * if they are, same as above, we can leave one there and call it a day. If they're different
+ * we have to make a dynamic entrypoint. There is an assumption made here that every file in
+ * app.asar.unpacked is a native node module. This assumption _may_ not be true so we should
+ * look at codifying that assumption as actual logic.
+ */
+ // FIXME: Codify the assumption that app.asar.unpacked only contains native modules
+ if (x64AsarMode === AsarMode.HAS_ASAR && opts.mergeASARs) {
+ d('merging x64 and arm64 asars');
+ const output = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar');
+ await mergeASARs({
+ x64AsarPath: path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'),
+ arm64AsarPath: path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'),
+ outputAsarPath: output,
+ singleArchFiles: opts.singleArchFiles,
+ });
+ generatedIntegrity['Resources/app.asar'] = generateAsarIntegrity(output);
+ }
+ else if (x64AsarMode === AsarMode.HAS_ASAR) {
+ d('checking if the x64 and arm64 asars are identical');
+ const x64AsarSha = await sha(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ const arm64AsarSha = await sha(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'));
+ if (x64AsarSha !== arm64AsarSha) {
+ didSplitAsar = true;
+ d('x64 and arm64 asars are different');
+ const x64AsarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64.asar');
+ await fs.move(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'), x64AsarPath);
+ const x64Unpacked = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar.unpacked');
+ if (await fs.pathExists(x64Unpacked)) {
+ await fs.move(x64Unpacked, path.resolve(tmpApp, 'Contents', 'Resources', 'app-x64.asar.unpacked'));
+ }
+ const arm64AsarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64.asar');
+ await fs.copy(path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar'), arm64AsarPath);
+ const arm64Unpacked = path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app.asar.unpacked');
+ if (await fs.pathExists(arm64Unpacked)) {
+ await fs.copy(arm64Unpacked, path.resolve(tmpApp, 'Contents', 'Resources', 'app-arm64.asar.unpacked'));
+ }
+ const entryAsar = path.resolve(tmpDir, 'entry-asar');
+ await fs.mkdir(entryAsar);
+ await fs.copy(path.resolve(__dirname, '..', '..', 'entry-asar', 'has-asar.js'), path.resolve(entryAsar, 'index.js'));
+ let pj = JSON.parse((await asar.extractFile(path.resolve(opts.x64AppPath, 'Contents', 'Resources', 'app.asar'), 'package.json')).toString('utf8'));
+ pj.main = 'index.js';
+ await fs.writeJson(path.resolve(entryAsar, 'package.json'), pj);
+ const asarPath = path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar');
+ await asar.createPackage(entryAsar, asarPath);
+ generatedIntegrity['Resources/app.asar'] = generateAsarIntegrity(asarPath);
+ generatedIntegrity['Resources/app-x64.asar'] = generateAsarIntegrity(x64AsarPath);
+ generatedIntegrity['Resources/app-arm64.asar'] = generateAsarIntegrity(arm64AsarPath);
+ }
+ else {
+ d('x64 and arm64 asars are the same');
+ generatedIntegrity['Resources/app.asar'] = generateAsarIntegrity(path.resolve(tmpApp, 'Contents', 'Resources', 'app.asar'));
+ }
+ }
+ const plistFiles = x64Files.filter((f) => f.type === AppFileType.INFO_PLIST);
+ for (const plistFile of plistFiles) {
+ const x64PlistPath = path.resolve(opts.x64AppPath, plistFile.relativePath);
+ const arm64PlistPath = path.resolve(opts.arm64AppPath, plistFile.relativePath);
+ const _a = plist.parse(await fs.readFile(x64PlistPath, 'utf8')), { ElectronAsarIntegrity: x64Integrity } = _a, x64Plist = __rest(_a, ["ElectronAsarIntegrity"]);
+ const _b = plist.parse(await fs.readFile(arm64PlistPath, 'utf8')), { ElectronAsarIntegrity: arm64Integrity } = _b, arm64Plist = __rest(_b, ["ElectronAsarIntegrity"]);
+ if (JSON.stringify(x64Plist) !== JSON.stringify(arm64Plist)) {
+ throw new Error(`Expected all Info.plist files to be identical when ignoring integrity when creating a universal build but "${plistFile.relativePath}" was not`);
+ }
+ const injectAsarIntegrity = !opts.infoPlistsToIgnore ||
+ minimatch(plistFile.relativePath, opts.infoPlistsToIgnore, { matchBase: true });
+ const mergedPlist = injectAsarIntegrity
+ ? Object.assign(Object.assign({}, x64Plist), { ElectronAsarIntegrity: generatedIntegrity }) : Object.assign({}, x64Plist);
+ await fs.writeFile(path.resolve(tmpApp, plistFile.relativePath), plist.build(mergedPlist));
+ }
+ for (const snapshotsFile of arm64Files.filter((f) => f.type === AppFileType.SNAPSHOT)) {
+ d('copying snapshot file', snapshotsFile.relativePath, 'to target application');
+ await fs.copy(path.resolve(opts.arm64AppPath, snapshotsFile.relativePath), path.resolve(tmpApp, snapshotsFile.relativePath));
+ }
+ d('moving final universal app to target destination');
+ await fs.mkdirp(path.dirname(opts.outAppPath));
+ await spawn('mv', [tmpApp, opts.outAppPath]);
+ }
+ catch (err) {
+ throw err;
+ }
+ finally {
+ await fs.remove(tmpDir);
+ }
+};
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/index.js.map b/desktop/node_modules/@electron/universal/dist/esm/index.js.map
new file mode 100644
index 0000000..cfef7a3
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAW,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAuC5B,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAE,EAAE,CACtC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK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CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAC9C;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,GAAG,CAAC;KACX;YAAS;QACR,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;KACzB;AACH,CAAC,CAAC"} \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/sha.d.ts b/desktop/node_modules/@electron/universal/dist/esm/sha.d.ts
new file mode 100644
index 0000000..1c0daaa
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/sha.d.ts
@@ -0,0 +1 @@
+export declare const sha: (filePath: string) => Promise<any>;
diff --git a/desktop/node_modules/@electron/universal/dist/esm/sha.js b/desktop/node_modules/@electron/universal/dist/esm/sha.js
new file mode 100644
index 0000000..fbc7498
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/sha.js
@@ -0,0 +1,16 @@
+import * as fs from 'fs-extra';
+import * as crypto from 'crypto';
+import { d } from './debug';
+export const sha = async (filePath) => {
+ d('hashing', filePath);
+ const hash = crypto.createHash('sha256');
+ hash.setEncoding('hex');
+ const fileStream = fs.createReadStream(filePath);
+ fileStream.pipe(hash);
+ await new Promise((resolve, reject) => {
+ fileStream.on('end', () => resolve());
+ fileStream.on('error', (err) => reject(err));
+ });
+ return hash.read();
+};
+//# sourceMappingURL=sha.js.map \ No newline at end of file
diff --git a/desktop/node_modules/@electron/universal/dist/esm/sha.js.map b/desktop/node_modules/@electron/universal/dist/esm/sha.js.map
new file mode 100644
index 0000000..794d901
--- /dev/null
+++ b/desktop/node_modules/@electron/universal/dist/esm/sha.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"sha.js","sourceRoot":"","sources":["../../src/sha.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAE5B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;IAC5C,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACjD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACtC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC,CAAC"} \ No newline at end of file