@shockpkg/ria-packager
Version:
Package for creating Adobe AIR packages
1 lines • 45.2 kB
Source Map (JSON)
{"version":3,"file":"mac.mjs","names":["mkdir","readFile","utimes","writeFile","dirname","join","pathJoin","PathType","createArchiveByFileStatOrThrow","IconIcns","Plist","ValueString","ValueBoolean","ValueArray","ValueDict","pathRelativeBaseMatch","pathRelativeBase","PackagerBundle","asValue","v","toValueBoolean","toValueString","PackagerBundleMac","applicationIconModern","fileTypeIconModern","infoPlistFile","infoPlistData","pkgInfoFile","pkgInfoData","frameworkCleanOsFiles","preserveResourceMtime","plistDocumentTypeNameIsDescription","plistHighResolutionCapable","frameworkCleanHelpers","plistHasAppTransportSecurity","_extensionMapping","Map","constructor","path","hasInfoPlist","hasPkgInfo","appIcnsFile","appIcnsPath","appInfoPlistPath","appPkgInfoPath","appResourcesPath","getAppBinaryPath","_getFilename","getAppFrameworkPath","getSdkBinaryPath","getSdkFrameworkPath","getFrameworkExcludes","r","push","getPkgInfoData","TextEncoder","encode","_getFileMode","executable","_getPlistCFBundleExecutable","_getPlistCFBundleIdentifier","_getId","_getPlistCFBundleShortVersionString","_getVersionNumber","_getPlistCFBundleGetInfoString","copyright","_getCopyright","versionNumber","add","_getPlistNSHumanReadableCopyright","_getPlistCFBundleIconFile","icon","_getIcon","_uidIcon","_getPlistCFBundleLocalizations","langs","_applicationInfoSupportedLanguages","list","trim","split","length","_getPlistNSHighResolutionCapable","_applicationInfoRequestedDisplayResolution","_getPlistNSAppTransportSecurity","_getPlistCFBundleDocumentTypes","extensionMapping","fileTypes","_applicationInfoFileTypes","size","useDesc","ext","info","map","set","contentType","description","name","iconFile","get","_getPlistCFBundleAllowMixedLocalizations","_getPlistCFBundlePackageType","_getPlistCFBundleInfoDictionaryVersion","_getPlistLSMinimumSystemVersion","_getPlistLSRequiresCarbon","_open","clear","sdkPath","Error","appBinaryPath","appFrameworkPath","sdkBinaryPath","sdkFrameworkPath","frameworkExcludes","Set","s","toLowerCase","appBinaryPathFull","appFrameworkPathFull","extractedBinary","extractedFramework","sdk","nobrowse","read","entry","type","RESOURCE_FORK","volumePath","sdkBinaryPathRel","dest","extract","frameworkPathRel","has","_close","Promise","all","_writeApplicationIcon","_writeFileTypeIcons","_writePkgInfo","_writeInfoPlist","_writeResource","destination","data","options","mode","_getResourcePath","recursive","mtime","parts","_writeIconModern","_writeIconReference","mapping","fileIcons","_getFileTypes","write","writes","did","index","uid","done","_getFileTypeIconName","_getFileTypeIconPath","d","_generateInfoPlist","dom","fromXml","TextDecoder","decode","existing","value","TYPE","dict","val","key","wrap","k","t","Array","isArray","toXml","indentRoot","indentString","xml","paths","image16x16","image32x32","image48x48","image128x128","p","icns","readers","types","then","datas","f","addFromPng","image512x512","image1024x1024"],"sources":["../../../src/packager/bundle/mac.ts"],"sourcesContent":["import {mkdir, readFile, utimes, writeFile} from 'node:fs/promises';\nimport {dirname, join as pathJoin} from 'node:path';\n\nimport {\n\tPathType,\n\tcreateArchiveByFileStatOrThrow\n} from '@shockpkg/archive-files';\nimport {IconIcns} from '@shockpkg/icon-encoder';\nimport {\n\tPlist,\n\tValue,\n\tValueString,\n\tValueBoolean,\n\tValueArray,\n\tValueDict\n} from '@shockpkg/plist-dom';\n\nimport {pathRelativeBaseMatch, pathRelativeBase} from '../../util.ts';\nimport {IPackagerResourceOptions} from '../../packager.ts';\nimport {IIcon, PackagerBundle} from '../bundle.ts';\n\n// eslint-disable-next-line jsdoc/require-jsdoc\nconst asValue = (v: Value) => v;\n// eslint-disable-next-line jsdoc/require-jsdoc\nconst toValueBoolean = (v: boolean) => new ValueBoolean(v);\n// eslint-disable-next-line jsdoc/require-jsdoc\nconst toValueString = (v: string) => new ValueString(v);\n\n/**\n * PackagerBundleMac object.\n */\nexport class PackagerBundleMac extends PackagerBundle {\n\t/**\n\t * Create modern application icon file.\n\t * Enables higher resolutions icons and PNG compression.\n\t * Default false uses the legacy formats of the official packager.\n\t */\n\tpublic applicationIconModern = false;\n\n\t/**\n\t * Create modern document type icon file.\n\t * Enables higher resolutions icons and PNG compression.\n\t * Default false uses the legacy formats of the official packager.\n\t */\n\tpublic fileTypeIconModern = false;\n\n\t/**\n\t * Info.plist file.\n\t */\n\tpublic infoPlistFile: string | null = null;\n\n\t/**\n\t * Info.plist data.\n\t */\n\tpublic infoPlistData:\n\t\t| string\n\t\t| Readonly<Uint8Array>\n\t\t| (() => string | Readonly<Uint8Array>)\n\t\t| (() => Promise<string | Readonly<Uint8Array>>)\n\t\t| null = null;\n\n\t/**\n\t * PkgInfo file.\n\t */\n\tpublic pkgInfoFile: string | null = null;\n\n\t/**\n\t * PkgInfo data.\n\t */\n\tpublic pkgInfoData:\n\t\t| string\n\t\t| Readonly<Uint8Array>\n\t\t| (() => string | Readonly<Uint8Array>)\n\t\t| (() => Promise<string | Readonly<Uint8Array>>)\n\t\t| null = null;\n\n\t/**\n\t * Remove unnecessary OS files from older versions of the framework.\n\t * The official packages will include these if they are present in SDK.\n\t */\n\tpublic frameworkCleanOsFiles = false;\n\n\t/**\n\t * Optionally preserve resource mtime.\n\t * The official packager does not preserve resource mtimes.\n\t */\n\tpublic preserveResourceMtime = false;\n\n\t/**\n\t * Value of CFBundleDocumentTypes CFBundleTypeName is description, not name.\n\t * Tag value controlled by application descriptor.\n\t * Set to false to match the behavior of SDK versions before 3.2.0.2070.\n\t */\n\tpublic plistDocumentTypeNameIsDescription = true;\n\n\t/**\n\t * Add an NSHighResolutionCapable tag to the Info.plist file.\n\t * Tag value controlled by application descriptor.\n\t * Set to false to match the behavior of SDK versions before 3.6.0.6090.\n\t */\n\tpublic plistHighResolutionCapable = true;\n\n\t/**\n\t * Remove unnecessary helper files from framework.\n\t * Set to false to match the behavior of SDK versions before 25.0.0.134.\n\t */\n\tpublic frameworkCleanHelpers = true;\n\n\t/**\n\t * Add an NSAppTransportSecurity tag to the Info.plist file.\n\t * Tag value controlled by application descriptor.\n\t * Set to false to match the behavior of SDK versions before 27.0.0.128.\n\t */\n\tpublic plistHasAppTransportSecurity = true;\n\n\t/**\n\t * Extension mapping.\n\t */\n\tprotected _extensionMapping = new Map<string, string>();\n\n\t/**\n\t * PackagerBundleMac constructor.\n\t *\n\t * @param path Output path.\n\t */\n\tconstructor(path: string) {\n\t\tsuper(path);\n\t}\n\n\t/**\n\t * If Info.plist is specified.\n\t *\n\t * @returns Is specified.\n\t */\n\tpublic get hasInfoPlist() {\n\t\treturn !!(this.infoPlistData || this.infoPlistFile);\n\t}\n\n\t/**\n\t * If PkgInfo is specified.\n\t *\n\t * @returns Is specified.\n\t */\n\tpublic get hasPkgInfo() {\n\t\treturn !!(this.pkgInfoData || this.pkgInfoFile);\n\t}\n\n\t/**\n\t * Get app icns file.\n\t *\n\t * @returns File name.\n\t */\n\tpublic get appIcnsFile() {\n\t\treturn 'Icon.icns';\n\t}\n\n\t/**\n\t * Get app icns path.\n\t *\n\t * @returns File path.\n\t */\n\tpublic get appIcnsPath() {\n\t\treturn `Contents/Resources/${this.appIcnsFile}`;\n\t}\n\n\t/**\n\t * Get app Info.plist path.\n\t *\n\t * @returns File path.\n\t */\n\tpublic get appInfoPlistPath() {\n\t\treturn 'Contents/Info.plist';\n\t}\n\n\t/**\n\t * Get app PkgInfo path.\n\t *\n\t * @returns File path.\n\t */\n\tpublic get appPkgInfoPath() {\n\t\treturn 'Contents/PkgInfo';\n\t}\n\n\t/**\n\t * Get app resources path.\n\t *\n\t * @returns Resources path.\n\t */\n\tpublic get appResourcesPath() {\n\t\treturn 'Contents/Resources';\n\t}\n\n\t/**\n\t * Get app binary path.\n\t *\n\t * @returns Binary path.\n\t */\n\tpublic getAppBinaryPath() {\n\t\treturn `Contents/MacOS/${this._getFilename()}`;\n\t}\n\n\t/**\n\t * Get app framework path.\n\t *\n\t * @returns Framework path.\n\t */\n\tpublic getAppFrameworkPath() {\n\t\treturn 'Contents/Frameworks/Adobe AIR.framework';\n\t}\n\n\t/**\n\t * Get SDK binary path.\n\t *\n\t * @returns Binary path.\n\t */\n\tpublic getSdkBinaryPath() {\n\t\treturn 'lib/nai/lib/CaptiveAppEntry';\n\t}\n\n\t/**\n\t * Get SDK framework path.\n\t *\n\t * @returns Framework path.\n\t */\n\tpublic getSdkFrameworkPath() {\n\t\treturn 'runtimes/air-captive/mac/Adobe AIR.framework';\n\t}\n\n\t/**\n\t * Get framework files excluded.\n\t *\n\t * @returns Excluded files in framework.\n\t */\n\tpublic getFrameworkExcludes() {\n\t\tconst r: string[] = [];\n\t\tif (this.frameworkCleanHelpers) {\n\t\t\t// Some files used to create applications, not used after that.\n\t\t\tr.push(\n\t\t\t\t'Versions/1.0/Adobe AIR_64 Helper',\n\t\t\t\t'Versions/1.0/Resources/ExtendedAppEntryTemplate64'\n\t\t\t);\n\t\t}\n\t\tif (this.frameworkCleanOsFiles) {\n\t\t\t// Some empty junk likely leftover from an Apple ZIP file.\n\t\t\tr.push('Versions/1.0/Resources/__MACOSX');\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t * Get PkgInfo data if from data or file, else default.\n\t *\n\t * @returns PkgInfo data.\n\t */\n\tpublic async getPkgInfoData() {\n\t\tconst {pkgInfoData, pkgInfoFile} = this;\n\t\tif (typeof pkgInfoData === 'string') {\n\t\t\treturn new TextEncoder().encode(pkgInfoData);\n\t\t}\n\t\treturn (\n\t\t\tpkgInfoData ||\n\t\t\t(pkgInfoFile\n\t\t\t\t? readFile(pkgInfoFile)\n\t\t\t\t: new TextEncoder().encode('APPL????'))\n\t\t);\n\t}\n\n\t/**\n\t * Get file mode value.\n\t *\n\t * @param executable Is the entry executable.\n\t * @returns File mode.\n\t */\n\tprotected _getFileMode(executable: boolean) {\n\t\treturn executable ? 0b111100100 : 0b110100100;\n\t}\n\n\t/**\n\t * Get plist CFBundleExecutable value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleExecutable(): string | null {\n\t\treturn this._getFilename();\n\t}\n\n\t/**\n\t * Get plist CFBundleIdentifier value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleIdentifier(): string | null {\n\t\treturn this._getId();\n\t}\n\n\t/**\n\t * Get plist CFBundleShortVersionString value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleShortVersionString(): string | null {\n\t\treturn this._getVersionNumber();\n\t}\n\n\t/**\n\t * Get plist CFBundleGetInfoString value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleGetInfoString(): string | null {\n\t\t// Strange when no copyright but matches official packager.\n\t\tconst copyright = this._getCopyright();\n\t\tconst versionNumber = this._getVersionNumber();\n\t\tconst add = copyright ? ` ${copyright}` : '';\n\t\treturn `${versionNumber},${add}`;\n\t}\n\n\t/**\n\t * Get plist NSHumanReadableCopyright value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistNSHumanReadableCopyright(): string | null {\n\t\treturn this._getCopyright() || '';\n\t}\n\n\t/**\n\t * Get plist CFBundleIconFile value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleIconFile(): string | null {\n\t\tconst icon = this._getIcon();\n\t\treturn icon && this._uidIcon(icon) ? this.appIcnsFile : null;\n\t}\n\n\t/**\n\t * Get plist CFBundleLocalizations value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleLocalizations(): string[] | null {\n\t\tconst langs = this._applicationInfoSupportedLanguages;\n\t\tconst list = langs ? langs.trim().split(/\\s+/) : null;\n\t\treturn list?.length ? list : null;\n\t}\n\n\t/**\n\t * Get plist NSHighResolutionCapable value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistNSHighResolutionCapable(): boolean | null {\n\t\treturn this.plistHighResolutionCapable\n\t\t\t? this._applicationInfoRequestedDisplayResolution === 'high'\n\t\t\t: null;\n\t}\n\n\t/**\n\t * Get plist NSAppTransportSecurity value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistNSAppTransportSecurity(): Map<string, boolean> | null {\n\t\treturn this.plistHasAppTransportSecurity\n\t\t\t? new Map([['NSAllowsArbitraryLoads', true]])\n\t\t\t: null;\n\t}\n\n\t/**\n\t * Get plist CFBundleDocumentTypes value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleDocumentTypes():\n\t\t| Map<string, string | string[]>[]\n\t\t| null {\n\t\tconst extensionMapping = this._extensionMapping;\n\t\tconst fileTypes = this._applicationInfoFileTypes;\n\t\tif (!fileTypes?.size) {\n\t\t\treturn null;\n\t\t}\n\t\tconst useDesc = this.plistDocumentTypeNameIsDescription;\n\t\tconst list: Map<string, string | string[]>[] = [];\n\t\tfor (const [ext, info] of fileTypes) {\n\t\t\tconst map = new Map<string, string | string[]>();\n\t\t\tmap.set('CFBundleTypeExtensions', [ext]);\n\t\t\tmap.set('CFBundleTypeMIMETypes', [info.contentType]);\n\t\t\tmap.set(\n\t\t\t\t'CFBundleTypeName',\n\t\t\t\tuseDesc ? info.description || '' : info.name\n\t\t\t);\n\t\t\tmap.set('CFBundleTypeRole', 'Editor');\n\n\t\t\tconst iconFile = extensionMapping.get(ext);\n\t\t\tif (iconFile) {\n\t\t\t\tmap.set('CFBundleTypeIconFile', iconFile);\n\t\t\t}\n\t\t\tlist.push(map);\n\t\t}\n\t\treturn list;\n\t}\n\n\t/**\n\t * Get plist CFBundleAllowMixedLocalizations value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleAllowMixedLocalizations(): boolean | null {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Get plist CFBundlePackageType value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundlePackageType(): string | null {\n\t\treturn 'APPL';\n\t}\n\n\t/**\n\t * Get plist CFBundleInfoDictionaryVersion value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistCFBundleInfoDictionaryVersion(): string | null {\n\t\treturn '6.0';\n\t}\n\n\t/**\n\t * Get plist LSMinimumSystemVersion value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistLSMinimumSystemVersion(): string | null {\n\t\treturn '10.6';\n\t}\n\n\t/**\n\t * Get plist LSRequiresCarbon value.\n\t *\n\t * @returns The value or null if excluded.\n\t */\n\tprotected _getPlistLSRequiresCarbon(): boolean | null {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Open implementation.\n\t */\n\tprotected async _open() {\n\t\tthis._extensionMapping.clear();\n\n\t\tconst {sdkPath} = this;\n\t\tif (!sdkPath) {\n\t\t\tthrow new Error('SDK path not set');\n\t\t}\n\n\t\tconst appBinaryPath = this.getAppBinaryPath();\n\t\tconst appFrameworkPath = this.getAppFrameworkPath();\n\n\t\tconst sdkBinaryPath = this.getSdkBinaryPath();\n\t\tconst sdkFrameworkPath = this.getSdkFrameworkPath();\n\n\t\tconst frameworkExcludes = new Set(\n\t\t\tthis.getFrameworkExcludes().map(s => s.toLowerCase())\n\t\t);\n\n\t\tconst appBinaryPathFull = pathJoin(this.path, appBinaryPath);\n\t\tconst appFrameworkPathFull = pathJoin(this.path, appFrameworkPath);\n\n\t\tlet extractedBinary = false;\n\t\tlet extractedFramework = false;\n\n\t\t// Extract everything needed from the SDK.\n\t\tconst sdk = await createArchiveByFileStatOrThrow(sdkPath, {\n\t\t\tnobrowse: this.nobrowse\n\t\t});\n\t\tawait sdk.read(async entry => {\n\t\t\t// Ignore any resource forks.\n\t\t\tif (entry.type === PathType.RESOURCE_FORK) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst path = entry.volumePath;\n\n\t\t\t// Extract if the binary.\n\t\t\tconst sdkBinaryPathRel = pathRelativeBase(\n\t\t\t\tpath,\n\t\t\t\tsdkBinaryPath,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tif (sdkBinaryPathRel !== null) {\n\t\t\t\tconst dest = pathJoin(appBinaryPathFull, sdkBinaryPathRel);\n\t\t\t\tawait entry.extract(dest);\n\t\t\t\textractedBinary = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Extract if the framework.\n\t\t\tconst frameworkPathRel = pathRelativeBase(\n\t\t\t\tpath,\n\t\t\t\tsdkFrameworkPath,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tif (frameworkPathRel !== null) {\n\t\t\t\t// If this is an excluded path, skip over.\n\t\t\t\tif (frameworkExcludes.has(frameworkPathRel.toLowerCase())) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst dest = pathJoin(appFrameworkPathFull, frameworkPathRel);\n\t\t\t\tawait entry.extract(dest);\n\t\t\t\textractedFramework = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Optimization to avoid walking unrelated directories if possible.\n\t\t\treturn pathRelativeBaseMatch(sdkFrameworkPath, path, true) ||\n\t\t\t\tpathRelativeBaseMatch(sdkBinaryPath, path, true)\n\t\t\t\t? true\n\t\t\t\t: null;\n\t\t});\n\n\t\t// Check that required components were extracted.\n\t\tif (!extractedBinary) {\n\t\t\tthrow new Error(`Failed to locate binary in SDK: ${sdkBinaryPath}`);\n\t\t}\n\t\tif (!extractedFramework) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to locate framework in SDK: ${sdkFrameworkPath}`\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Close implementation.\n\t */\n\tprotected async _close() {\n\t\ttry {\n\t\t\tawait Promise.all([\n\t\t\t\tthis._writeApplicationIcon(),\n\t\t\t\tthis._writeFileTypeIcons(),\n\t\t\t\tthis._writePkgInfo()\n\t\t\t]);\n\t\t\tawait this._writeInfoPlist();\n\t\t} finally {\n\t\t\tthis._extensionMapping.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Write resource with data implementation.\n\t *\n\t * @param destination Packaged file relative destination.\n\t * @param data Resource data.\n\t * @param options Resource options.\n\t */\n\tprotected async _writeResource(\n\t\tdestination: string,\n\t\tdata: Readonly<Uint8Array>,\n\t\toptions: Readonly<IPackagerResourceOptions>\n\t) {\n\t\t// Write resource to file.\n\t\tconst mode = this._getFileMode(options.executable || false);\n\t\tconst dest = this._getResourcePath(destination);\n\t\tawait mkdir(dirname(dest), {recursive: true});\n\t\tawait writeFile(dest, data, {mode});\n\n\t\t// Optionally preserve mtime information.\n\t\tif (this.preserveResourceMtime) {\n\t\t\tconst {mtime} = options;\n\t\t\tif (mtime) {\n\t\t\t\tawait utimes(dest, mtime, mtime);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get path to a resource file.\n\t *\n\t * @param parts Path parts.\n\t * @returns Full path.\n\t */\n\tprotected _getResourcePath(...parts: string[]) {\n\t\treturn pathJoin(this.path, this.appResourcesPath, ...parts);\n\t}\n\n\t/**\n\t * Write the application icon if specified.\n\t */\n\tprotected async _writeApplicationIcon() {\n\t\tconst icon = this._getIcon();\n\t\tif (!icon || !this._uidIcon(icon)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst path = pathJoin(this.path, this.appIcnsPath);\n\n\t\t// Write either a modern or a reference icon.\n\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\tif (this.applicationIconModern) {\n\t\t\tawait this._writeIconModern(path, icon);\n\t\t} else {\n\t\t\tawait this._writeIconReference(path, icon);\n\t\t}\n\t}\n\n\t/**\n\t * Write file type icons, creating extension name mapping.\n\t * Avoids writting duplicate icons where the file/data is the same.\n\t */\n\tprotected async _writeFileTypeIcons() {\n\t\tconst mapping = this._extensionMapping;\n\t\tmapping.clear();\n\n\t\tconst fileIcons = this._getFileTypes();\n\t\tif (!fileIcons) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Write either a modern or a reference icon.\n\t\tconst write = this.fileTypeIconModern\n\t\t\t? async (path: string, icon: IIcon) =>\n\t\t\t\t\tthis._writeIconModern(path, icon)\n\t\t\t: async (path: string, icon: IIcon) =>\n\t\t\t\t\tthis._writeIconReference(path, icon);\n\n\t\tconst writes = [];\n\t\tconst did = new Map<string, string>();\n\t\tlet index = 0;\n\t\tfor (const [ext, {icon}] of fileIcons) {\n\t\t\tif (!icon) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Compute a unique identifier for the used icon set paths.\n\t\t\tconst uid = this._uidIcon(icon);\n\t\t\tif (!uid) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if file was already generated for this icon set.\n\t\t\tconst done = did.get(uid);\n\t\t\tif (done) {\n\t\t\t\tmapping.set(ext, done);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Compute name for this icon set and cache.\n\t\t\tconst name = this._getFileTypeIconName(index++);\n\t\t\tdid.set(uid, name);\n\t\t\tmapping.set(ext, name);\n\n\t\t\t// Get the path to write to.\n\t\t\tconst path = pathJoin(this.path, this._getFileTypeIconPath(name));\n\t\t\twrites.push(write(path, icon));\n\t\t}\n\t\tawait Promise.all(writes);\n\t}\n\n\t/**\n\t * Write out PkgInfo file.\n\t */\n\tprotected async _writePkgInfo() {\n\t\tconst data = await this.getPkgInfoData();\n\t\tconst d = typeof data === 'function' ? await data() : data;\n\t\tconst path = pathJoin(this.path, this.appPkgInfoPath);\n\t\tawait writeFile(path, d);\n\t}\n\n\t/**\n\t * Generate Info.plist XML string.\n\t *\n\t * @returns XML string.\n\t */\n\tprotected async _generateInfoPlist() {\n\t\tconst {infoPlistData, infoPlistFile} = this;\n\n\t\tconst dom = new Plist();\n\t\tif (typeof infoPlistData === 'function') {\n\t\t\tconst d = await infoPlistData();\n\t\t\tdom.fromXml(\n\t\t\t\ttypeof d === 'string' ? d : new TextDecoder().decode(d)\n\t\t\t);\n\t\t} else if (typeof infoPlistData === 'string') {\n\t\t\tdom.fromXml(infoPlistData);\n\t\t} else if (infoPlistData) {\n\t\t\tdom.fromXml(new TextDecoder().decode(infoPlistData));\n\t\t} else if (infoPlistFile) {\n\t\t\tdom.fromXml(await readFile(infoPlistFile, 'utf8'));\n\t\t}\n\n\t\tconst existing =\n\t\t\tdom.value && dom.value.type === ValueDict.TYPE\n\t\t\t\t? (dom.value as ValueDict)\n\t\t\t\t: null;\n\t\tconst dict = (dom.value = new ValueDict());\n\n\t\tconst done = new Set<string>();\n\n\t\t/**\n\t\t * A little helper to set values only once.\n\t\t *\n\t\t * @param key Key string.\n\t\t * @param value The value or null.\n\t\t * @param wrap Wrap value.\n\t\t */\n\t\tconst val = <T>(\n\t\t\tkey: string,\n\t\t\tvalue: T | null,\n\t\t\twrap: (v: T) => Value\n\t\t) => {\n\t\t\tif (done.has(key)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (value !== null) {\n\t\t\t\tdict.value.set(key, wrap(value));\n\t\t\t}\n\t\t\tdone.add(key);\n\t\t};\n\n\t\t// Set all the values in the same order as the official packager.\n\t\tval(\n\t\t\t'CFBundleAllowMixedLocalizations',\n\t\t\tthis._getPlistCFBundleAllowMixedLocalizations(),\n\t\t\ttoValueBoolean\n\t\t);\n\t\tval(\n\t\t\t'CFBundlePackageType',\n\t\t\tthis._getPlistCFBundlePackageType(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'CFBundleInfoDictionaryVersion',\n\t\t\tthis._getPlistCFBundleInfoDictionaryVersion(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'LSMinimumSystemVersion',\n\t\t\tthis._getPlistLSMinimumSystemVersion(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'LSRequiresCarbon',\n\t\t\tthis._getPlistLSRequiresCarbon(),\n\t\t\ttoValueBoolean\n\t\t);\n\t\tval(\n\t\t\t'CFBundleIdentifier',\n\t\t\tthis._getPlistCFBundleIdentifier(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'CFBundleGetInfoString',\n\t\t\tthis._getPlistCFBundleGetInfoString(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'CFBundleShortVersionString',\n\t\t\tthis._getPlistCFBundleShortVersionString(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'NSHumanReadableCopyright',\n\t\t\tthis._getPlistNSHumanReadableCopyright(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'CFBundleExecutable',\n\t\t\tthis._getPlistCFBundleExecutable(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'NSAppTransportSecurity',\n\t\t\tthis._getPlistNSAppTransportSecurity(),\n\t\t\tv => {\n\t\t\t\tconst r = new ValueDict();\n\t\t\t\tfor (const [k, d] of v) {\n\t\t\t\t\tr.set(k, new ValueBoolean(d));\n\t\t\t\t}\n\t\t\t\treturn r;\n\t\t\t}\n\t\t);\n\t\tval(\n\t\t\t'NSHighResolutionCapable',\n\t\t\tthis._getPlistNSHighResolutionCapable(),\n\t\t\ttoValueBoolean\n\t\t);\n\t\tval(\n\t\t\t'CFBundleIconFile',\n\t\t\tthis._getPlistCFBundleIconFile(),\n\t\t\ttoValueString\n\t\t);\n\t\tval(\n\t\t\t'CFBundleDocumentTypes',\n\t\t\tthis._getPlistCFBundleDocumentTypes(),\n\t\t\tv => {\n\t\t\t\tconst r = new ValueArray();\n\t\t\t\tfor (const map of v) {\n\t\t\t\t\tconst d = new ValueDict();\n\t\t\t\t\tfor (const [k, t] of map) {\n\t\t\t\t\t\td.set(\n\t\t\t\t\t\t\tk,\n\t\t\t\t\t\t\tArray.isArray(t)\n\t\t\t\t\t\t\t\t? new ValueArray(t.map(toValueString))\n\t\t\t\t\t\t\t\t: new ValueString(t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tr.push(d);\n\t\t\t\t}\n\t\t\t\treturn r;\n\t\t\t}\n\t\t);\n\t\tval(\n\t\t\t'CFBundleLocalizations',\n\t\t\tthis._getPlistCFBundleLocalizations(),\n\t\t\tv => new ValueArray(v.map(toValueString))\n\t\t);\n\n\t\t// If any existing values, copy the ones not already set.\n\t\tif (existing) {\n\t\t\tfor (const [key, value] of existing.value) {\n\t\t\t\tval(key, value, asValue);\n\t\t\t}\n\t\t}\n\n\t\treturn dom.toXml({\n\t\t\tindentRoot: true,\n\t\t\tindentString: ' '\n\t\t});\n\t}\n\n\t/**\n\t * Write out Info.plist file.\n\t */\n\tprotected async _writeInfoPlist() {\n\t\tconst xml = await this._generateInfoPlist();\n\t\tconst path = pathJoin(this.path, this.appInfoPlistPath);\n\t\tawait writeFile(path, xml);\n\t}\n\n\t/**\n\t * Calculate UID for icon, or null if none of required icons set.\n\t *\n\t * @param icon Icon info.\n\t * @returns UID string or null.\n\t */\n\tprotected _uidIcon(icon: Readonly<IIcon>) {\n\t\tconst paths = [\n\t\t\ticon.image16x16,\n\t\t\ticon.image32x32,\n\t\t\ticon.image48x48,\n\t\t\ticon.image128x128\n\t\t];\n\n\t\t// If none set, skip.\n\t\tlet has = false;\n\t\tfor (const p of paths) {\n\t\t\tif (p) {\n\t\t\t\thas = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Compute a unique identifier for the used icon set paths.\n\t\treturn has\n\t\t\t? paths.map(s => `${s ? s.length : 0}:${s || ''}`).join('|')\n\t\t\t: null;\n\t}\n\n\t/**\n\t * Write icon matching official format.\n\t *\n\t * @param path Icon path.\n\t * @param icon Icon info.\n\t */\n\tprotected async _writeIconReference(path: string, icon: Readonly<IIcon>) {\n\t\t// Add icons in the same order official packager would use.\n\t\tconst icns = new IconIcns();\n\t\tconst readers = [];\n\t\tfor (const [path, types] of [\n\t\t\t[icon.image16x16, ['is32', 's8mk']],\n\t\t\t[icon.image32x32, ['il32', 'l8mk']],\n\t\t\t[icon.image48x48, ['ih32', 'h8mk']],\n\t\t\t[icon.image128x128, ['it32', 't8mk']]\n\t\t] as [string | null, string[]][]) {\n\t\t\tif (path) {\n\t\t\t\treaders.push(async () =>\n\t\t\t\t\treadFile(this._getResourcePath(path)).then(\n\t\t\t\t\t\td => [d, types] as [Buffer, string[]]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst datas = await Promise.all(readers.map(async f => f()));\n\t\tfor (const [data, types] of datas) {\n\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\tawait icns.addFromPng(data, types);\n\t\t}\n\t\tawait writeFile(path, icns.encode());\n\t}\n\n\t/**\n\t * Write icon using modern format.\n\t *\n\t * @param path Icon path.\n\t * @param icon Icon info.\n\t * @returns Icon written.\n\t */\n\tprotected async _writeIconModern(path: string, icon: Readonly<IIcon>) {\n\t\t// Add icons in the same order iconutil would.\n\t\tconst icns = new IconIcns();\n\t\tconst readers = [];\n\t\tfor (const [path, type] of [\n\t\t\t// [icon.image64x64, 'ic12'],\n\t\t\t[icon.image128x128, 'ic07'],\n\t\t\t// [icon.image256x256, 'ic13'],\n\t\t\t// [icon.image256x256, 'ic08'],\n\t\t\t[icon.image16x16, 'ic04'],\n\t\t\t[icon.image512x512, 'ic14'],\n\t\t\t[icon.image512x512, 'ic09'],\n\t\t\t[icon.image32x32, 'ic05'],\n\t\t\t[icon.image1024x1024, 'ic10'],\n\t\t\t[icon.image32x32, 'ic11']\n\t\t] as [string | null, string][]) {\n\t\t\tif (path) {\n\t\t\t\treaders.push(async () =>\n\t\t\t\t\treadFile(this._getResourcePath(path)).then(\n\t\t\t\t\t\td => [d, type] as [Buffer, string]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst datas = await Promise.all(readers.map(async f => f()));\n\t\tfor (const [data, type] of datas) {\n\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\tawait icns.addFromPng(data, [type]);\n\t\t}\n\t\tawait writeFile(path, icns.encode());\n\t}\n\n\t/**\n\t * Get path for a file type icon file.\n\t *\n\t * @param name File name.\n\t * @returns File path.\n\t */\n\tprotected _getFileTypeIconPath(name: string) {\n\t\treturn pathJoin('Contents', 'Resources', name);\n\t}\n\n\t/**\n\t * Get name for a file type icon file.\n\t *\n\t * @param index Unique index.\n\t * @returns File name.\n\t */\n\tprotected _getFileTypeIconName(index: number) {\n\t\treturn `DocumentIcon${index}.icns`;\n\t}\n}\n"],"mappings":"AAAA,SAAQA,KAAK,EA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