Initial commit

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
dinlo
2026-05-31 18:44:04 +08:00
commit 436a9631fc
8616 changed files with 1389957 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
import { DmgOptions, Target } from "app-builder-lib";
import { MacPackager } from "app-builder-lib/out/macPackager";
import { Arch } from "builder-util";
export interface DmgBuildConfig {
title: string;
icon?: string | null;
"badge-icon"?: string | null;
background?: string | null;
"background-color"?: string | null;
"icon-size"?: number | null;
"text-size"?: number | null;
window?: {
position?: {
x?: number;
y?: number;
};
size?: {
width?: number;
height?: number;
};
};
format?: string;
size?: string | null;
shrink?: boolean;
filesystem?: string;
"compression-level"?: number | null;
license?: string | null;
contents?: Array<{
path: string;
x: number;
y: number;
name?: string;
type?: "file" | "link" | "position";
hide_extension?: boolean;
hidden?: boolean;
}>;
}
export declare class DmgTarget extends Target {
private readonly packager;
readonly outDir: string;
readonly options: DmgOptions;
isAsyncSupported: boolean;
constructor(packager: MacPackager, outDir: string);
build(appPath: string, arch: Arch): Promise<void>;
private signDmg;
computeVolumeName(arch: Arch, custom?: string | null): string;
computeDmgOptions(appPath: string): Promise<DmgOptions>;
}
+158
View File
@@ -0,0 +1,158 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DmgTarget = void 0;
const app_builder_lib_1 = require("app-builder-lib");
const macCodeSign_1 = require("app-builder-lib/out/codeSign/macCodeSign");
const differentialUpdateInfoBuilder_1 = require("app-builder-lib/out/targets/differentialUpdateInfoBuilder");
const builder_util_1 = require("builder-util");
const filename_1 = require("builder-util/out/filename");
const os_1 = require("os");
const path = require("path");
const dmgLicense_1 = require("./dmgLicense");
const dmgUtil_1 = require("./dmgUtil");
const hdiuil_1 = require("./hdiuil");
class DmgTarget extends app_builder_lib_1.Target {
constructor(packager, outDir) {
super("dmg");
this.packager = packager;
this.outDir = outDir;
this.options = this.packager.config.dmg || Object.create(null);
this.isAsyncSupported = false;
}
async build(appPath, arch) {
const packager = this.packager;
// tslint:disable-next-line:no-invalid-template-strings
const artifactName = packager.expandArtifactNamePattern(this.options, "dmg", arch, "${productName}-" + (packager.platformSpecificBuildOptions.bundleShortVersion || "${version}") + "-${arch}.${ext}", true, packager.platformSpecificBuildOptions.defaultArch);
const artifactPath = path.join(this.outDir, artifactName);
await packager.info.emitArtifactBuildStarted({
targetPresentableName: "DMG",
file: artifactPath,
arch,
});
const volumeName = (0, filename_1.sanitizeFileName)(this.computeVolumeName(arch, this.options.title));
const specification = await this.computeDmgOptions(appPath);
if (!(await (0, dmgUtil_1.customizeDmg)({ appPath, artifactPath, volumeName, specification, packager }))) {
return;
}
if (this.options.internetEnabled && parseInt((0, os_1.release)().split(".")[0], 10) < 19) {
await (0, hdiuil_1.hdiUtil)(addLogLevel(["internet-enable"]).concat(artifactPath));
}
const licenseData = await (0, dmgLicense_1.addLicenseToDmg)(packager, artifactPath);
if (packager.packagerOptions.effectiveOptionComputed != null) {
await packager.packagerOptions.effectiveOptionComputed({ licenseData });
}
if (this.options.sign === true) {
await this.signDmg(artifactPath);
}
const safeArtifactName = packager.computeSafeArtifactName(artifactName, "dmg");
const updateInfo = this.options.writeUpdateInfo === false ? null : await (0, differentialUpdateInfoBuilder_1.createBlockmap)(artifactPath, this, packager, safeArtifactName);
await packager.info.emitArtifactBuildCompleted({
file: artifactPath,
safeArtifactName,
target: this,
arch,
packager,
isWriteUpdateInfo: updateInfo != null,
updateInfo,
});
}
async signDmg(artifactPath) {
if (!(0, macCodeSign_1.isSignAllowed)(false)) {
return;
}
const packager = this.packager;
const qualifier = packager.platformSpecificBuildOptions.identity;
// explicitly disabled if set to null
if (qualifier === null) {
// macPackager already somehow handle this situation, so, here just return
return;
}
const keychainFile = (await packager.codeSigningInfo.value).keychainFile;
const certificateType = "Developer ID Application";
let identity = await (0, macCodeSign_1.findIdentity)(certificateType, qualifier, keychainFile);
if (identity == null) {
identity = await (0, macCodeSign_1.findIdentity)("Mac Developer", qualifier, keychainFile);
if (identity == null) {
return;
}
}
const args = ["--sign", identity.hash];
if (keychainFile != null) {
args.push("--keychain", keychainFile);
}
args.push(artifactPath);
await (0, builder_util_1.exec)("codesign", args);
}
computeVolumeName(arch, custom) {
const appInfo = this.packager.appInfo;
const shortVersion = this.packager.platformSpecificBuildOptions.bundleShortVersion || appInfo.version;
const archString = (0, builder_util_1.getArchSuffix)(arch, this.packager.platformSpecificBuildOptions.defaultArch);
if (custom == null) {
return `${appInfo.productFilename} ${shortVersion}${archString}`;
}
return custom
.replace(/\${arch}/g, archString)
.replace(/\${shortVersion}/g, shortVersion)
.replace(/\${version}/g, appInfo.version)
.replace(/\${name}/g, appInfo.name)
.replace(/\${productName}/g, appInfo.productName);
}
// public to test
async computeDmgOptions(appPath) {
const packager = this.packager;
const specification = { ...this.options };
if (specification.icon == null && specification.icon !== null) {
specification.icon = await packager.getIconPath();
}
if (specification.icon != null && (0, builder_util_1.isEmptyOrSpaces)(specification.icon)) {
throw new builder_util_1.InvalidConfigurationError("dmg.icon cannot be specified as empty string");
}
const background = specification.background;
if (specification.backgroundColor != null) {
if (background != null) {
throw new builder_util_1.InvalidConfigurationError("Both dmg.backgroundColor and dmg.background are specified — please set the only one");
}
}
else if (background == null) {
specification.background = await (0, dmgUtil_1.computeBackground)(packager);
}
else {
specification.background = await packager.getResource(background);
}
if (specification.format == null) {
if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {
specification.format = "UDZO";
}
else if (packager.compression === "store") {
specification.format = "UDRO";
}
else {
specification.format = packager.compression === "maximum" ? "UDBZ" : "UDZO";
}
}
if (specification.contents == null) {
specification.contents = [
{
x: 130,
y: 220,
path: appPath,
type: "file",
name: `${packager.appInfo.productFilename}.app`,
},
{
x: 410,
y: 220,
type: "link",
path: "/Applications",
},
];
}
return specification;
}
}
exports.DmgTarget = DmgTarget;
function addLogLevel(args, isVerbose = process.env.DEBUG_DMG === "true") {
args.push(isVerbose ? "-verbose" : "-quiet");
return args;
}
//# sourceMappingURL=dmg.js.map
+1
View File
File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
import { PlatformPackager } from "app-builder-lib";
type LicenseConfig = {
$schema: string;
body: any[];
labels: any[];
};
export declare function addLicenseToDmg(packager: PlatformPackager<any>, dmgPath: string): Promise<LicenseConfig | null>;
export {};
+47
View File
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addLicenseToDmg = addLicenseToDmg;
const license_1 = require("app-builder-lib/out/util/license");
const builder_util_1 = require("builder-util");
const dmg_license_1 = require("dmg-license");
const fs_extra_1 = require("fs-extra");
const js_yaml_1 = require("js-yaml");
const licenseButtons_1 = require("./licenseButtons");
async function addLicenseToDmg(packager, dmgPath) {
const licenseFiles = await (0, license_1.getLicenseFiles)(packager);
if (licenseFiles.length === 0) {
return null;
}
const licenseButtonFiles = await (0, licenseButtons_1.getLicenseButtonsFile)(packager);
packager.debugLogger.add("dmg.licenseFiles", licenseFiles);
packager.debugLogger.add("dmg.licenseButtons", licenseButtonFiles);
const jsonFile = {
$schema: "https://github.com/argv-minus-one/dmg-license/raw/master/schema.json",
// defaultLang: '',
body: [],
labels: [],
};
for (const file of licenseFiles) {
jsonFile.body.push({
file: file.file,
lang: file.langWithRegion.replace("_", "-"),
});
}
for (const button of licenseButtonFiles) {
const filepath = button.file;
const label = filepath.endsWith(".yml") ? (0, js_yaml_1.load)(await (0, fs_extra_1.readFile)(filepath, "utf-8")) : await (0, fs_extra_1.readJson)(filepath);
if (label.description) {
// to support original button file format
label.message = label.description;
delete label.description;
}
jsonFile.labels.push(Object.assign({
lang: button.langWithRegion.replace("_", "-"),
}, label));
}
await (0, dmg_license_1.dmgLicenseFromJSON)(dmgPath, jsonFile, {
onNonFatalError: builder_util_1.log.warn.bind(builder_util_1.log),
});
return jsonFile;
}
//# sourceMappingURL=dmgLicense.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"dmgLicense.js","sourceRoot":"","sources":["../src/dmgLicense.ts"],"names":[],"mappings":";;AAgBA,0CA+CC;AA9DD,8DAAkE;AAClE,+CAAkC;AAClC,6CAAgD;AAChD,uCAA6C;AAC7C,qCAA8B;AAC9B,qDAAwD;AAUjD,KAAK,UAAU,eAAe,CAAC,QAA+B,EAAE,OAAe;IACpF,MAAM,YAAY,GAAG,MAAM,IAAA,yBAAe,EAAC,QAAQ,CAAC,CAAA;IACpD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,kBAAkB,GAAG,MAAM,IAAA,sCAAqB,EAAC,QAAQ,CAAC,CAAA;IAChE,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAA;IAC1D,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAA;IAElE,MAAM,QAAQ,GAAkB;QAC9B,OAAO,EAAE,sEAAsE;QAC/E,mBAAmB;QACnB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,EAAE;KACX,CAAA;IAED,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,kBAAkB,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;QAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAA,cAAI,EAAC,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAA;QAC5G,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,yCAAyC;YACzC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CAAA;YACjC,OAAO,KAAK,CAAC,WAAW,CAAA;QAC1B,CAAC;QACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAClB,MAAM,CAAC,MAAM,CACX;YACE,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;SAC9C,EACD,KAAK,CACN,CACF,CAAA;IACH,CAAC;IAED,MAAM,IAAA,gCAAkB,EAAC,OAAO,EAAE,QAAQ,EAAE;QAC1C,eAAe,EAAE,kBAAG,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAG,CAAC;KACpC,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC","sourcesContent":["import { PlatformPackager } from \"app-builder-lib\"\nimport { getLicenseFiles } from \"app-builder-lib/out/util/license\"\nimport { log } from \"builder-util\"\nimport { dmgLicenseFromJSON } from \"dmg-license\"\nimport { readFile, readJson } from \"fs-extra\"\nimport { load } from \"js-yaml\"\nimport { getLicenseButtonsFile } from \"./licenseButtons\"\n\n// License Specifications\n// https://github.com/argv-minus-one/dmg-license/blob/HEAD/docs/License%20Specifications.md\ntype LicenseConfig = {\n $schema: string\n body: any[]\n labels: any[]\n}\n\nexport async function addLicenseToDmg(packager: PlatformPackager<any>, dmgPath: string): Promise<LicenseConfig | null> {\n const licenseFiles = await getLicenseFiles(packager)\n if (licenseFiles.length === 0) {\n return null\n }\n\n const licenseButtonFiles = await getLicenseButtonsFile(packager)\n packager.debugLogger.add(\"dmg.licenseFiles\", licenseFiles)\n packager.debugLogger.add(\"dmg.licenseButtons\", licenseButtonFiles)\n\n const jsonFile: LicenseConfig = {\n $schema: \"https://github.com/argv-minus-one/dmg-license/raw/master/schema.json\",\n // defaultLang: '',\n body: [],\n labels: [],\n }\n\n for (const file of licenseFiles) {\n jsonFile.body.push({\n file: file.file,\n lang: file.langWithRegion.replace(\"_\", \"-\"),\n })\n }\n\n for (const button of licenseButtonFiles) {\n const filepath = button.file\n const label = filepath.endsWith(\".yml\") ? load(await readFile(filepath, \"utf-8\")) : await readJson(filepath)\n if (label.description) {\n // to support original button file format\n label.message = label.description\n delete label.description\n }\n jsonFile.labels.push(\n Object.assign(\n {\n lang: button.langWithRegion.replace(\"_\", \"-\"),\n },\n label\n )\n )\n }\n\n await dmgLicenseFromJSON(dmgPath, jsonFile, {\n onNonFatalError: log.warn.bind(log),\n })\n\n return jsonFile\n}\n"]}
+20
View File
@@ -0,0 +1,20 @@
import { DmgOptions, MacPackager, PlatformPackager } from "app-builder-lib";
import { TmpDir } from "builder-util";
export { DmgTarget } from "./dmg";
export declare function getDmgTemplatePath(): string;
export declare function attachAndExecute(dmgPath: string, readWrite: boolean, forceDetach: boolean, task: (devicePath: string) => Promise<any>): Promise<any>;
export declare function detach(name: string, alwaysForce: boolean): Promise<string | null>;
export declare function computeBackground(packager: PlatformPackager<any>): Promise<string>;
type DmgBuilderConfig = {
appPath: string;
artifactPath: string;
volumeName: string;
specification: DmgOptions;
packager: MacPackager;
};
export declare function customizeDmg({ appPath, artifactPath, volumeName, specification, packager }: DmgBuilderConfig): Promise<boolean>;
export declare function transformBackgroundFileIfNeed(file: string, tmpDir: TmpDir): Promise<string>;
export declare function getImageSizeUsingSips(background: string): Promise<{
width: number;
height: number;
}>;
+235
View File
@@ -0,0 +1,235 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DmgTarget = void 0;
exports.getDmgTemplatePath = getDmgTemplatePath;
exports.attachAndExecute = attachAndExecute;
exports.detach = detach;
exports.computeBackground = computeBackground;
exports.serializeString = serializeString;
exports.customizeDmg = customizeDmg;
exports.transformBackgroundFileIfNeed = transformBackgroundFileIfNeed;
exports.getImageSizeUsingSips = getImageSizeUsingSips;
const binDownload_1 = require("app-builder-lib/out/binDownload");
const builder_util_1 = require("builder-util");
const fs_extra_1 = require("fs-extra");
const path = require("path");
const hdiuil_1 = require("./hdiuil");
var dmg_1 = require("./dmg");
Object.defineProperty(exports, "DmgTarget", { enumerable: true, get: function () { return dmg_1.DmgTarget; } });
const root = path.join(__dirname, "..");
function getDmgTemplatePath() {
return path.join(root, "templates");
}
async function getDmgVendorPath() {
var _a;
const customDmgbuildPath = (_a = process.env.CUSTOM_DMGBUILD_PATH) === null || _a === void 0 ? void 0 : _a.trim();
if (customDmgbuildPath) {
return path.resolve(customDmgbuildPath);
}
// https://github.com/electron-userland/electron-builder-binaries/releases/tag/dmg-builder%401.2.0
const releaseVersion = "75c8a6c";
const arch = process.arch === "arm64" ? "arm64" : "x86_64";
const config = {
"dmgbuild-bundle-arm64-75c8a6c.tar.gz": "a785f2a385c8c31996a089ef8e26361904b40c772d5ea65a36001212f1fc25e0",
"dmgbuild-bundle-x86_64-75c8a6c.tar.gz": "87b3bb72148b11451ee90ede79cc8d59305c9173b68b0f2b50a3bea51fc4a4e2",
};
const filename = `dmgbuild-bundle-${arch}-${releaseVersion}.tar.gz`;
const file = await (0, binDownload_1.downloadArtifact)({
releaseName: "dmg-builder@1.2.0",
filenameWithExt: filename,
checksums: config,
githubOrgRepo: "electron-userland/electron-builder-binaries",
});
return path.resolve(file, "dmgbuild");
}
async function attachAndExecute(dmgPath, readWrite, forceDetach, task) {
//noinspection SpellCheckingInspection
const args = ["attach", "-noverify", "-noautoopen"];
if (readWrite) {
args.push("-readwrite");
}
args.push(dmgPath);
const attachResult = await (0, hdiuil_1.hdiUtil)(args);
const deviceResult = attachResult == null ? null : /^(\/dev\/\w+)/.exec(attachResult);
const device = deviceResult == null || deviceResult.length !== 2 ? null : deviceResult[1];
if (device == null) {
throw new Error(`Cannot mount: ${attachResult}`);
}
const volumePath = await findMountPath(path.basename(device));
if (volumePath == null) {
throw new Error(`Cannot find volume mount path for device: ${device}`);
}
return await (0, builder_util_1.executeFinally)(task(volumePath), () => detach(device, forceDetach));
}
/**
* Find the mount path for a specific device from `hdiutil info`.
*/
async function findMountPath(devName, index = 1) {
const info = await (0, hdiuil_1.hdiUtil)(["info"]);
const lines = info.split("\n");
const regex = new RegExp(`^/dev/${devName}(s\\d+)?\\s+\\S+\\s+(/Volumes/.+)$`);
const matches = [];
for (const line of lines) {
const result = regex.exec(line);
if (result && result.length >= 3) {
matches.push(result[2]);
}
}
return matches.length >= index ? matches[index - 1] : null;
}
async function detach(name, alwaysForce) {
return (0, hdiuil_1.hdiUtil)(["detach", "-quiet", name]).catch(async (e) => {
if (hdiuil_1.hdiutilTransientExitCodes.has(e.code) || alwaysForce) {
// Delay then force unmount with verbose output
await new Promise(resolve => setTimeout(resolve, 3000));
return (0, hdiuil_1.hdiUtil)(["detach", "-force", name]);
}
throw e;
});
}
async function computeBackground(packager) {
const resourceList = await packager.resourceList;
if (resourceList.includes("background.tiff")) {
return path.join(packager.buildResourcesDir, "background.tiff");
}
else if (resourceList.includes("background.png")) {
return path.join(packager.buildResourcesDir, "background.png");
}
else {
return path.join(getDmgTemplatePath(), "background.tiff");
}
}
/** @internal */
function serializeString(data) {
return (' $"' +
data
.match(/.{1,32}/g)
.map(it => it.match(/.{1,4}/g).join(" "))
.join('"\n $"') +
'"');
}
async function customizeDmg({ appPath, artifactPath, volumeName, specification, packager }) {
var _a, _b, _c, _d, _e;
const isValidIconTextSize = !!specification.iconTextSize && specification.iconTextSize >= 10 && specification.iconTextSize <= 16;
const iconTextSize = isValidIconTextSize ? specification.iconTextSize : 12;
const volumePath = path.join("/Volumes", volumeName);
// https://github.com/electron-userland/electron-builder/issues/2115
const settings = {
title: path.basename(volumePath),
"icon-size": specification.iconSize,
"text-size": iconTextSize,
"compression-level": Number(process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || "9"),
// filesystem: specification.filesystem || "HFS+",
format: specification.format,
size: specification.size,
shrink: specification.shrink,
contents: ((_a = specification.contents) === null || _a === void 0 ? void 0 : _a.map(c => ({
path: c.path || appPath, // path is required, when ommitted, appPath is used (backward compatibility
x: c.x,
y: c.y,
name: c.name,
type: c.type === "dir" ? "file" : c.type, // appdmg expects "file" for directories
// hide_extension: c.hideExtension,
}))) || [],
};
if (specification.badgeIcon) {
let badgeIcon = await packager.getResource(specification.badgeIcon);
if (badgeIcon && badgeIcon.toLowerCase().endsWith(".icon")) {
badgeIcon = await packager.generateIcnsFromIcon(badgeIcon);
}
settings["badge-icon"] = badgeIcon;
}
else {
settings.icon = await packager.getResource(specification.icon);
}
if (specification.backgroundColor != null || specification.background == null) {
settings["background-color"] = specification.backgroundColor || "#ffffff";
const window = specification.window;
if (window != null) {
settings.window = {
position: {
x: (_b = window.x) !== null && _b !== void 0 ? _b : 100,
y: (_c = window.y) !== null && _c !== void 0 ? _c : 400,
},
size: {
width: (_d = window.width) !== null && _d !== void 0 ? _d : 540,
height: (_e = window.height) !== null && _e !== void 0 ? _e : 300,
},
};
}
}
else {
settings.background = specification.background == null ? null : await transformBackgroundFileIfNeed(specification.background, packager.info.tempDirManager);
}
if (!(0, builder_util_1.isEmptyOrSpaces)(settings.background)) {
const size = await getImageSizeUsingSips(settings.background);
settings.window = { position: { x: 400, y: Math.round((1440 - size.height) / 2) }, size, ...settings.window };
}
const settingsFile = await packager.getTempFile(".json");
await (0, fs_extra_1.writeFile)(settingsFile, JSON.stringify(settings, null, 2));
const dmgbuild = await getDmgVendorPath();
await (0, builder_util_1.exec)(dmgbuild, ["-s", settingsFile, path.basename(volumePath), artifactPath], {
env: {
...process.env,
PYTHONIOENCODING: "utf8",
},
});
// effectiveOptionComputed, when present, is purely for verifying result during test execution
return (packager.packagerOptions.effectiveOptionComputed == null ||
(await attachAndExecute(artifactPath, false, true, async (volumePath) => {
var _a;
return !(await packager.packagerOptions.effectiveOptionComputed({
volumePath,
specification: {
...specification,
// clean up `contents` for test snapshot verification since app path is absolute to a unique tmp dir
contents: (_a = specification.contents) === null || _a === void 0 ? void 0 : _a.map((c) => {
var _a;
return ({
...c,
path: path.extname((_a = c.path) !== null && _a !== void 0 ? _a : "") === ".app" ? path.relative(packager.projectDir, c.path) : c.path,
});
}),
},
packager,
}));
})));
}
async function transformBackgroundFileIfNeed(file, tmpDir) {
if (path.extname(file.toLowerCase()) === ".tiff") {
return file;
}
const retinaFile = file.replace(/\.([a-z]+)$/, "@2x.$1");
if (await (0, builder_util_1.exists)(retinaFile)) {
const tiffFile = await tmpDir.getTempFile({ suffix: ".tiff" });
await (0, builder_util_1.exec)("tiffutil", ["-cathidpicheck", file, retinaFile, "-out", tiffFile]);
return tiffFile;
}
return file;
}
async function getImageSizeUsingSips(background) {
const stdout = await (0, builder_util_1.exec)("sips", ["-g", "pixelHeight", "-g", "pixelWidth", background]);
let width = 0;
let height = 0;
const re = /([a-zA-Z]+):\s*(\d+)/;
const lines = stdout.split("\n");
for (const line of lines) {
const match = re.exec(line);
if (!match) {
continue;
}
const key = match[1];
const value = parseInt(match[2], 10);
if (isNaN(value)) {
throw new Error(`Failed to parse number from line: "${line}"`);
}
if (key === "pixelWidth") {
width = value;
}
else if (key === "pixelHeight") {
height = value;
}
}
return { width, height };
}
//# sourceMappingURL=dmgUtil.js.map
+1
View File
File diff suppressed because one or more lines are too long
+18
View File
@@ -0,0 +1,18 @@
/**
* Table of hdiutil error codes that are transient and can be retried.
* These codes are typically related to resource availability or temporary issues.
*
| Code | Meaning | Why Retry? |
| ------- | -------------------------------- | ---------------------------------------------------- |
| `1` | Generic error | Can occur from brief race conditions or temp issues. |
| `16` | **Resource busy** | Volume is in use — wait and retry often works. |
| `35` | **Operation timed out** | System delay or timeout — retry after a short delay. |
| `256` | Volume in use or unmount failure | Same as 16 — usually resolves after retry. |
| `49153` | Volume not mounted yet | Attach may be too fast — retry after delay. |
| `-5341` | Disk image too small | Retry *after fixing* with a larger `-size`. |
| `-5342` | Specified size too small | Same as above — retry if size is corrected. |
*
*/
export declare const hdiutilTransientExitCodes: Set<number>;
export declare function explainHdiutilError(errorCode: number): string;
export declare function hdiUtil(args: string[]): Promise<string | null>;
+62
View File
@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hdiutilTransientExitCodes = void 0;
exports.explainHdiutilError = explainHdiutilError;
exports.hdiUtil = hdiUtil;
const builder_util_1 = require("builder-util");
/**
* Table of hdiutil error codes that are transient and can be retried.
* These codes are typically related to resource availability or temporary issues.
*
| Code | Meaning | Why Retry? |
| ------- | -------------------------------- | ---------------------------------------------------- |
| `1` | Generic error | Can occur from brief race conditions or temp issues. |
| `16` | **Resource busy** | Volume is in use — wait and retry often works. |
| `35` | **Operation timed out** | System delay or timeout — retry after a short delay. |
| `256` | Volume in use or unmount failure | Same as 16 — usually resolves after retry. |
| `49153` | Volume not mounted yet | Attach may be too fast — retry after delay. |
| `-5341` | Disk image too small | Retry *after fixing* with a larger `-size`. |
| `-5342` | Specified size too small | Same as above — retry if size is corrected. |
*
*/
exports.hdiutilTransientExitCodes = new Set([1, 16, 35, 256, 49153]);
function explainHdiutilError(errorCode) {
var _a;
const code = errorCode.toString();
const messages = {
"0": "Success: The hdiutil command completed without error.",
"1": "Generic error: The operation failed, but the reason is not specific. Check command syntax or permissions.",
"2": "No such file or directory: Check if the specified path exists.",
"6": "Disk image to resize is not currently attached or not recognized as a valid block device by macOS.",
"8": "Exec format error: The file might not be a valid disk image.",
"16": "Resource busy: The volume is in use. Try closing files or processes and retry.",
"22": "Invalid argument: One or more arguments passed to hdiutil are incorrect.",
"35": "Operation timed out: The system was too slow or unresponsive. Try again.",
"36": "I/O error: There was a problem reading or writing to disk. Check disk health.",
"100": "Image-related error: The disk image may be corrupted or invalid.",
"256": "Volume is busy or could not be unmounted. Try again after closing files.",
"49153": "Volume not mounted yet: The image may not have been fully attached.",
"-5341": "Disk image too small: hdiutil could not fit the contents. Increase the image size.",
"-5342": "Specified size too small: Disk image creation failed due to insufficient size.",
};
return (_a = messages[code]) !== null && _a !== void 0 ? _a : `Unknown error (code ${code}): Refer to hdiutil documentation or run with -verbose for details by rerunning with env var DEBUG_DEMB=true.`;
}
const shouldRetry = (args) => (error) => {
var _a, _b, _c;
const code = (_a = error.code) !== null && _a !== void 0 ? _a : -1;
const stderr = ((_b = error.stderr) === null || _b === void 0 ? void 0 : _b.toString()) || "";
const stdout = ((_c = error.stdout) === null || _c === void 0 ? void 0 : _c.toString()) || "";
const output = `${stdout} ${stderr}`.trim();
const willRetry = exports.hdiutilTransientExitCodes.has(code.toString());
builder_util_1.log.warn({ willRetry, args, code, output }, `hdiutil error: ${explainHdiutilError(code)}`);
return willRetry;
};
async function hdiUtil(args) {
return (0, builder_util_1.retry)(() => (0, builder_util_1.exec)("hdiutil", args), {
retries: 5,
interval: 5000,
backoff: 2000,
shouldRetry: shouldRetry(args),
});
}
//# sourceMappingURL=hdiuil.js.map
+1
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -0,0 +1,9 @@
import { PlatformPackager } from "app-builder-lib";
export declare function getLicenseButtonsFile(packager: PlatformPackager<any>): Promise<Array<LicenseButtonsFile>>;
export interface LicenseButtonsFile {
file: string;
lang: string;
langWithRegion: string;
langName: string;
}
export declare function getLicenseButtons(licenseButtonFiles: Array<LicenseButtonsFile>, langWithRegion: string, id: number, name: string): Promise<string>;
+141
View File
@@ -0,0 +1,141 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLicenseButtonsFile = getLicenseButtonsFile;
exports.getLicenseButtons = getLicenseButtons;
const license_1 = require("app-builder-lib/out/util/license");
const builder_util_1 = require("builder-util");
const fs_extra_1 = require("fs-extra");
const iconv = require("iconv-lite");
const js_yaml_1 = require("js-yaml");
const dmgUtil_1 = require("./dmgUtil");
const licenseDefaultButtons_1 = require("./licenseDefaultButtons");
async function getLicenseButtonsFile(packager) {
return (0, license_1.getLicenseAssets)((await packager.resourceList).filter(it => {
const name = it.toLowerCase();
// noinspection SpellCheckingInspection
return name.startsWith("licensebuttons_") && (name.endsWith(".json") || name.endsWith(".yml"));
}), packager);
}
async function getLicenseButtons(licenseButtonFiles, langWithRegion, id, name) {
let data = (0, licenseDefaultButtons_1.getDefaultButtons)(langWithRegion, id, name);
for (const item of licenseButtonFiles) {
if (item.langWithRegion !== langWithRegion) {
continue;
}
try {
const fileData = (0, js_yaml_1.load)(await (0, fs_extra_1.readFile)(item.file, "utf-8"));
const buttonsStr = labelToHex(fileData.lang, item.lang, item.langWithRegion) +
labelToHex(fileData.agree, item.lang, item.langWithRegion) +
labelToHex(fileData.disagree, item.lang, item.langWithRegion) +
labelToHex(fileData.print, item.lang, item.langWithRegion) +
labelToHex(fileData.save, item.lang, item.langWithRegion) +
labelToHex(fileData.description, item.lang, item.langWithRegion);
data = `data 'STR#' (${id}, "${name}") {\n`;
data += (0, dmgUtil_1.serializeString)("0006" + buttonsStr);
data += `\n};`;
builder_util_1.log.debug({ lang: item.langName, data }, `overwriting license buttons`);
return data;
}
catch (e) {
builder_util_1.log.debug({ error: e }, "cannot overwrite license buttons");
return data;
}
}
return data;
}
function labelToHex(label, lang, langWithRegion) {
const lbl = hexEncode(label, lang, langWithRegion).toString().toUpperCase();
const len = numberToHex(lbl.length / 2);
return len + lbl;
}
function numberToHex(nb) {
return ("0" + nb.toString(16)).slice(-2);
}
function hexEncode(str, lang, langWithRegion) {
const macCodePages = getMacCodePage(lang, langWithRegion);
let result = "";
for (let i = 0; i < str.length; i++) {
try {
let hex = getMacHexCode(str, i, macCodePages);
if (hex === undefined) {
hex = "3F"; //?
}
result += hex;
}
catch (e) {
builder_util_1.log.debug({ error: e, char: str[i] }, "cannot convert");
result += "3F"; //?
}
}
return result;
}
function getMacCodePage(lang, langWithRegion) {
switch (lang) {
case "ja": //japanese
return ["euc-jp"]; //Apple Japanese
case "zh": //chinese
if (langWithRegion === "zh_CN") {
return ["gb2312"]; //Apple Simplified Chinese (GB 2312)
}
return ["big5"]; //Apple Traditional Chinese (Big5)
case "ko": //korean
return ["euc-kr"]; //Apple Korean
case "ar": //arabic
case "ur": //urdu
return ["macarabic"]; //Apple Arabic
case "he": //hebrew
return ["machebrew"]; //Apple Hebrew
case "el": //greek
case "elc": //greek
return ["macgreek"]; //Apple Greek
case "ru": //russian
case "be": //belarussian
case "sr": //serbian
case "bg": //bulgarian
case "uz": //uzbek
return ["maccyrillic"]; //Apple Macintosh Cyrillic
case "ro": //romanian
return ["macromania"]; //Apple Romanian
case "uk": //ukrainian
return ["macukraine"]; //Apple Ukrainian
case "th": //thai
return ["macthai"]; //Apple Thai
case "et": //estonian
case "lt": //lithuanian
case "lv": //latvian
case "pl": //polish
case "hu": //hungarian
case "cs": //czech
case "sk": //slovak
return ["maccenteuro"]; //Apple Macintosh Central Europe
case "is": //icelandic
case "fo": //faroese
return ["maciceland"]; //Apple Icelandic
case "tr": //turkish
return ["macturkish"]; //Apple Turkish
case "hr": //croatian
case "sl": //slovenian
return ["maccroatian"]; //Apple Croatian
default:
return ["macroman"]; //Apple Macintosh Roman
}
}
function getMacHexCode(str, i, macCodePages) {
const code = str.charCodeAt(i);
if (code < 128) {
return code.toString(16);
}
else if (code < 256) {
return iconv.encode(str[i], "macroman").toString("hex");
}
else {
for (let i = 0; i < macCodePages.length; i++) {
const result = iconv.encode(str[i], macCodePages[i]).toString("hex");
if (result !== undefined) {
return result;
}
}
}
return code;
}
//# sourceMappingURL=licenseButtons.js.map
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
export declare function getDefaultButtons(langWithRegion: string, id: number, name: string): string;
+260
View File
@@ -0,0 +1,260 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultButtons = getDefaultButtons;
function getDefaultButtons(langWithRegion, id, name) {
switch (langWithRegion) {
case "de_DE":
return `data 'STR#' (${id}, "${name}") {
$"0006 0744 6575 7473 6368 0B41 6B7A 6570"
$"7469 6572 656E 0841 626C 6568 6E65 6E07"
$"4472 7563 6B65 6E0A 5369 6368 6572 6E2E"
$"2E2E E74B 6C69 636B 656E 2053 6965 2069"
$"6E20 D241 6B7A 6570 7469 6572 656E D32C"
$"2077 656E 6E20 5369 6520 6D69 7420 6465"
$"6E20 4265 7374 696D 6D75 6E67 656E 2064"
$"6573 2053 6F66 7477 6172 652D 4C69 7A65"
$"6E7A 7665 7274 7261 6773 2065 696E 7665"
$"7273 7461 6E64 656E 2073 696E 642E 2046"
$"616C 6C73 206E 6963 6874 2C20 6269 7474"
$"6520 D241 626C 6568 6E65 6ED3 2061 6E6B"
$"6C69 636B 656E 2E20 5369 6520 6B9A 6E6E"
$"656E 2064 6965 2053 6F66 7477 6172 6520"
$"6E75 7220 696E 7374 616C 6C69 6572 656E"
$"2C20 7765 6E6E 2053 6965 20D2 416B 7A65"
$"7074 6965 7265 6ED3 2061 6E67 656B 6C69"
$"636B 7420 6861 6265 6E2E"
};`;
case "fr_FR":
return `data 'STR#' (${id}, "${name}") {
$"0006 0846 7261 6E8D 6169 7308 4163 6365"
$"7074 6572 0752 6566 7573 6572 0849 6D70"
$"7269 6D65 720E 456E 7265 6769 7374 7265"
$"722E 2E2E BA53 6920 766F 7573 2061 6363"
$"6570 7465 7A20 6C65 7320 7465 726D 6573"
$"2064 6520 6C61 2070 728E 7365 6E74 6520"
$"6C69 6365 6E63 652C 2063 6C69 7175 657A"
$"2073 7572 2022 4163 6365 7074 6572 2220"
$"6166 696E 2064 2769 6E73 7461 6C6C 6572"
$"206C 6520 6C6F 6769 6369 656C 2E20 5369"
$"2076 6F75 7320 6E27 9074 6573 2070 6173"
$"2064 2761 6363 6F72 6420 6176 6563 206C"
$"6573 2074 6572 6D65 7320 6465 206C 6120"
$"6C69 6365 6E63 652C 2063 6C69 7175 657A"
$"2073 7572 2022 5265 6675 7365 7222 2E"
};`;
case "fr_CA":
return `data 'STR#' (${id}, "${name}") {
$"0006 1146 7261 6E8D 6169 7320 6361 6E61"
$"6469 656E 0841 6363 6570 7465 7207 5265"
$"6675 7365 7208 496D 7072 696D 6572 0E45"
$"6E72 6567 6973 7472 6572 2E2E 2EBA 5369"
$"2076 6F75 7320 6163 6365 7074 657A 206C"
$"6573 2074 6572 6D65 7320 6465 206C 6120"
$"7072 8E73 656E 7465 206C 6963 656E 6365"
$"2C20 636C 6971 7565 7A20 7375 7220 2241"
$"6363 6570 7465 7222 2061 6669 6E20 6427"
$"696E 7374 616C 6C65 7220 6C65 206C 6F67"
$"6963 6965 6C2E 2053 6920 766F 7573 206E"
$"2790 7465 7320 7061 7320 6427 6163 636F"
$"7264 2061 7665 6320 6C65 7320 7465 726D"
$"6573 2064 6520 6C61 206C 6963 656E 6365"
$"2C20 636C 6971 7565 7A20 7375 7220 2252"
$"6566 7573 6572 222E"
};`;
case "es_ES":
return `data 'STR#' (${id}, "${name}") {
$"0006 0745 7370 6196 6F6C 0741 6365 7074"
$"6172 0A4E 6F20 6163 6570 7461 7208 496D"
$"7072 696D 6972 0A47 7561 7264 6172 2E2E"
$"2EC0 5369 2065 7374 8720 6465 2061 6375"
$"6572 646F 2063 6F6E 206C 6F73 2074 8E72"
$"6D69 6E6F 7320 6465 2065 7374 6120 6C69"
$"6365 6E63 6961 2C20 7075 6C73 6520 2241"
$"6365 7074 6172 2220 7061 7261 2069 6E73"
$"7461 6C61 7220 656C 2073 6F66 7477 6172"
$"652E 2045 6E20 656C 2073 7570 7565 7374"
$"6F20 6465 2071 7565 206E 6F20 6573 748E"
$"2064 6520 6163 7565 7264 6F20 636F 6E20"
$"6C6F 7320 748E 726D 696E 6F73 2064 6520"
$"6573 7461 206C 6963 656E 6369 612C 2070"
$"756C 7365 2022 4E6F 2061 6365 7074 6172"
$"2E22"
};`;
case "it_IT":
return `data 'STR#' (${id}, "${name}") {
$"0006 0849 7461 6C69 616E 6F07 4163 6365"
$"7474 6F07 5269 6669 7574 6F06 5374 616D"
$"7061 0B52 6567 6973 7472 612E 2E2E 7F53"
$"6520 6163 6365 7474 6920 6C65 2063 6F6E"
$"6469 7A69 6F6E 6920 6469 2071 7565 7374"
$"6120 6C69 6365 6E7A 612C 2066 6169 2063"
$"6C69 6320 7375 2022 4163 6365 7474 6F22"
$"2070 6572 2069 6E73 7461 6C6C 6172 6520"
$"696C 2073 6F66 7477 6172 652E 2041 6C74"
$"7269 6D65 6E74 6920 6661 6920 636C 6963"
$"2073 7520 2252 6966 6975 746F 222E"
};`;
case "ja_JP":
return `data 'STR#' (${id}, "${name}") {
$"0006 084A 6170 616E 6573 650A 93AF 88D3"
$"82B5 82DC 82B7 0C93 AF88 D382 B582 DC82"
$"B982 F108 88F3 8DFC 82B7 82E9 0795 DB91"
$"B62E 2E2E B496 7B83 5C83 7483 6783 4583"
$"4783 418E 6797 708B 9691 F88C 5F96 F182"
$"CC8F F08C 8F82 C993 AF88 D382 B382 EA82"
$"E98F EA8D 8782 C982 CD81 4183 5C83 7483"
$"6783 4583 4783 4182 F083 4383 9383 5883"
$"6781 5B83 8B82 B782 E982 BD82 DF82 C981"
$"7593 AF88 D382 B582 DC82 B781 7682 F089"
$"9F82 B582 C482 AD82 BE82 B382 A281 4281"
$"4093 AF88 D382 B382 EA82 C882 A28F EA8D"
$"8782 C982 CD81 4181 7593 AF88 D382 B582"
$"DC82 B982 F181 7682 F089 9F82 B582 C482"
$"AD82 BE82 B382 A281 42"
};`;
case "nl_NL":
return `data 'STR#' (${id}, "${name}") {
$"0006 0A4E 6564 6572 6C61 6E64 7302 4A61"
$"034E 6565 0550 7269 6E74 0942 6577 6161"
$"722E 2E2E A449 6E64 6965 6E20 7520 616B"
$"6B6F 6F72 6420 6761 6174 206D 6574 2064"
$"6520 766F 6F72 7761 6172 6465 6E20 7661"
$"6E20 6465 7A65 206C 6963 656E 7469 652C"
$"206B 756E 7420 7520 6F70 2027 4A61 2720"
$"6B6C 696B 6B65 6E20 6F6D 2064 6520 7072"
$"6F67 7261 6D6D 6174 7575 7220 7465 2069"
$"6E73 7461 6C6C 6572 656E 2E20 496E 6469"
$"656E 2075 206E 6965 7420 616B 6B6F 6F72"
$"6420 6761 6174 2C20 6B6C 696B 7420 7520"
$"6F70 2027 4E65 6527 2E"
};`;
case "sv_SE":
return `data 'STR#' (${id}, "${name}") {
$"0006 0653 7665 6E73 6B08 476F 646B 8A6E"
$"6E73 0641 7662 9A6A 7308 536B 7269 7620"
$"7574 0853 7061 7261 2E2E 2E93 4F6D 2044"
$"7520 676F 646B 8A6E 6E65 7220 6C69 6365"
$"6E73 7669 6C6C 6B6F 7265 6E20 6B6C 6963"
$"6B61 2070 8C20 2247 6F64 6B8A 6E6E 7322"
$"2066 9A72 2061 7474 2069 6E73 7461 6C6C"
$"6572 6120 7072 6F67 7261 6D70 726F 6475"
$"6B74 656E 2E20 4F6D 2044 7520 696E 7465"
$"2067 6F64 6B8A 6E6E 6572 206C 6963 656E"
$"7376 696C 6C6B 6F72 656E 2C20 6B6C 6963"
$"6B61 2070 8C20 2241 7662 9A6A 7322 2E"
};`;
case "br_FR":
return `data 'STR#' (${id}, "${name}") {
$"0006 1150 6F72 7475 6775 9073 2C20 4272"
$"6173 696C 0943 6F6E 636F 7264 6172 0944"
$"6973 636F 7264 6172 0849 6D70 7269 6D69"
$"7209 5361 6C76 6172 2E2E 2E8C 5365 2065"
$"7374 8720 6465 2061 636F 7264 6F20 636F"
$"6D20 6F73 2074 6572 6D6F 7320 6465 7374"
$"6120 6C69 6365 6E8D 612C 2070 7265 7373"
$"696F 6E65 2022 436F 6E63 6F72 6461 7222"
$"2070 6172 6120 696E 7374 616C 6172 206F"
$"2073 6F66 7477 6172 652E 2053 6520 6E8B"
$"6F20 6573 7487 2064 6520 6163 6F72 646F"
$"2C20 7072 6573 7369 6F6E 6520 2244 6973"
$"636F 7264 6172 222E"
};`;
case "zh_TW":
return `data 'STR#' (${id}, "${name}") {
$"0006 1354 7261 6469 7469 6F6E 616C 2043"
$"6869 6E65 7365 04A6 50B7 4E06 A4A3 A650"
$"B74E 04A6 43A6 4C06 C078 A673 A14B 50A6"
$"70AA 47B1 7AA6 50B7 4EA5 BBB3 5CA5 69C3"
$"D2B8 CCAA BAB1 F8B4 DAA1 41BD D0AB F6A1"
$"A7A6 50B7 4EA1 A8A5 48A6 77B8 CBB3 6EC5"
$"E9A1 43A6 70AA 47A4 A3A6 50B7 4EA1 41BD"
$"D0AB F6A1 A7A4 A3A6 50B7 4EA1 A8A1 43"
};`;
case "zh_CN":
return `data 'STR#' (${id}, "${name}") {
$"0006 1253 696D 706C 6966 6965 6420 4368"
$"696E 6573 6504 CDAC D2E2 06B2 BBCD ACD2"
$"E204 B4F2 D3A1 06B4 E6B4 A2A1 AD54 C8E7"
$"B9FB C4FA CDAC D2E2 B1BE D0ED BFC9 D0AD"
$"D2E9 B5C4 CCF5 BFEE A3AC C7EB B0B4 A1B0"
$"CDAC D2E2 A1B1 C0B4 B0B2 D7B0 B4CB C8ED"
$"BCFE A1A3 C8E7 B9FB C4FA B2BB CDAC D2E2"
$"A3AC C7EB B0B4 A1B0 B2BB CDAC D2E2 A1B1"
$"A1A3"
};`;
case "da_DK":
return `data 'STR#' (${id}, "${name}") {
$"0006 0544 616E 736B 0445 6E69 6705 5565"
$"6E69 6707 5564 736B 7269 760A 4172 6B69"
$"7665 722E 2E2E 9848 7669 7320 6475 2061"
$"6363 6570 7465 7265 7220 6265 7469 6E67"
$"656C 7365 726E 6520 6920 6C69 6365 6E73"
$"6166 7461 6C65 6E2C 2073 6B61 6C20 6475"
$"206B 6C69 6B6B 6520 708C 20D2 456E 6967"
$"D320 666F 7220 6174 2069 6E73 7461 6C6C"
$"6572 6520 736F 6674 7761 7265 6E2E 204B"
$"6C69 6B20 708C 20D2 5565 6E69 67D3 2066"
$"6F72 2061 7420 616E 6E75 6C6C 6572 6520"
$"696E 7374 616C 6C65 7269 6E67 656E 2E"
};`;
case "fi_FI":
return `data 'STR#' (${id}, "${name}") {
$"0006 0553 756F 6D69 0848 7976 8A6B 7379"
$"6E0A 456E 2068 7976 8A6B 7379 0754 756C"
$"6F73 7461 0954 616C 6C65 6E6E 61C9 6F48"
$"7976 8A6B 7379 206C 6973 656E 7373 6973"
$"6F70 696D 756B 7365 6E20 6568 646F 7420"
$"6F73 6F69 7474 616D 616C 6C61 20D5 4879"
$"768A 6B73 79D5 2E20 4A6F 7320 6574 2068"
$"7976 8A6B 7379 2073 6F70 696D 756B 7365"
$"6E20 6568 746F 6A61 2C20 6F73 6F69 7461"
$"20D5 456E 2068 7976 8A6B 7379 D52E"
};`;
case "ko_KR":
return `data 'STR#' (${id}, "${name}") {
$"0006 064B 6F72 6561 6E04 B5BF C0C7 09B5"
$"BFC0 C720 BEC8 C7D4 06C7 C1B8 B0C6 AE07"
$"C0FA C0E5 2E2E 2E7E BBE7 BFEB 20B0 E8BE"
$"E0BC ADC0 C720 B3BB BFEB BFA1 20B5 BFC0"
$"C7C7 CFB8 E92C 2022 B5BF C0C7 2220 B4DC"
$"C3DF B8A6 20B4 ADB7 AF20 BCD2 C7C1 C6AE"
$"BFFE BEEE B8A6 20BC B3C4 A1C7 CFBD CABD"
$"C3BF C02E 20B5 BFC0 C7C7 CFC1 F620 BECA"
$"B4C2 B4D9 B8E9 2C20 22B5 BFC0 C720 BEC8"
$"C7D4 2220 B4DC C3DF B8A6 20B4 A9B8 A3BD"
$"CABD C3BF C02E"
};`;
case "nb_NO":
return `data 'STR#' (${id}, "${name}") {
$"0006 054E 6F72 736B 0445 6E69 6709 496B"
$"6B65 2065 6E69 6708 536B 7269 7620 7574"
$"0A41 726B 6976 6572 2E2E 2EA3 4876 6973"
$"2044 6520 6572 2065 6E69 6720 6920 6265"
$"7374 656D 6D65 6C73 656E 6520 6920 6465"
$"6E6E 6520 6C69 7365 6E73 6176 7461 6C65"
$"6E2C 206B 6C69 6B6B 6572 2044 6520 708C"
$"2022 456E 6967 222D 6B6E 6170 7065 6E20"
$"666F 7220 8C20 696E 7374 616C 6C65 7265"
$"2070 726F 6772 616D 7661 7265 6E2E 2048"
$"7669 7320 4465 2069 6B6B 6520 6572 2065"
$"6E69 672C 206B 6C69 6B6B 6572 2044 6520"
$"708C 2022 496B 6B65 2065 6E69 6722 2E"
};`;
default:
// en_US
return `data 'STR#' (${id}, "${name}") {
$"0006 0745 6E67 6C69 7368 0541 6772 6565"
$"0844 6973 6167 7265 6505 5072 696E 7407"
$"5361 7665 2E2E 2E7A 4966 2079 6F75 2061"
$"6772 6565 2077 6974 6820 7468 6520 7465"
$"726D 7320 6F66 2074 6869 7320 6C69 6365"
$"6E73 652C 2070 7265 7373 20D2 4167 7265"
$"65D3 2074 6F20 696E 7374 616C 6C20 7468"
$"6520 736F 6674 7761 7265 2E20 4966 2079"
$"6F75 2064 6F20 6E6F 7420 6167 7265 652C"
$"2070 7265 7373 20D2 4469 7361 6772 6565"
$"D32E"
};`;
}
}
//# sourceMappingURL=licenseDefaultButtons.js.map
File diff suppressed because one or more lines are too long