peachsim 0.1.2438 → 0.1.2439
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8718 -5552
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-FGE4PYDJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-2EUHEBIJ.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-2NPABFPN.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-4ZFNH7TU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-5T4XBUJP.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-6VY6HTJC.mjs +18951 -0
- package/dist-lib/esm-chunks/chunk-7HANEMO4.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-C3WBGYP6.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-CVGDRROP.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-DADGQELM.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-DEGYKHN7.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-HIDNO3RP.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HSADZOVN.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-IWJUYJQO.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-JCKI3VZ6.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-KSQ5KM5Y.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-KVTIDLBK.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-MIQSRBVU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-YB27R6JG.mjs +115 -0
- package/dist-lib/esm-chunks/metro-layout-parser-MVUAXRUJ.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7856 -4707
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15658 -11404
- package/dist-lib/host/fetch-proxy-handler.cjs +3927 -342
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +663 -451
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21657 -17374
- package/dist-lib/swift-compile.cjs +1343 -1318
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +19 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
|
@@ -1,1343 +1,30 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (char === "\\") {
|
|
29
|
-
const next = text[index + 1];
|
|
30
|
-
if (next === void 0) break;
|
|
31
|
-
index++;
|
|
32
|
-
if (next === "n") out.push({ char: "\n", soft: false });
|
|
33
|
-
else if (next === "t") out.push({ char: " ", soft: false });
|
|
34
|
-
else if (next === "u") {
|
|
35
|
-
const hex = text.slice(index + 1, index + 5);
|
|
36
|
-
if (!/^[0-9a-fA-F]{4}$/.test(hex))
|
|
37
|
-
throw new Error(`${where} has an invalid unicode escape \\u${hex}`);
|
|
38
|
-
out.push({ char: String.fromCharCode(Number.parseInt(hex, 16)), soft: false });
|
|
39
|
-
index += 4;
|
|
40
|
-
} else out.push({ char: next, soft: false });
|
|
41
|
-
} else if (char === '"') quoted = !quoted;
|
|
42
|
-
else if (char === "'" && !quoted)
|
|
43
|
-
throw new Error(`${where} has an unescaped apostrophe`);
|
|
44
|
-
else if (!quoted && /\s/.test(char)) {
|
|
45
|
-
if (out.at(-1)?.soft !== true) out.push({ char: " ", soft: true });
|
|
46
|
-
} else out.push({ char, soft: false });
|
|
47
|
-
}
|
|
48
|
-
while (out[0]?.soft) out.shift();
|
|
49
|
-
while (out.at(-1)?.soft) out.pop();
|
|
50
|
-
return out.map((part) => part.char).join("");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// src/android-xml.ts
|
|
54
|
-
var ENTITIES = {
|
|
55
|
-
quot: '"',
|
|
56
|
-
apos: "'",
|
|
57
|
-
amp: "&",
|
|
58
|
-
lt: "<",
|
|
59
|
-
gt: ">"
|
|
60
|
-
};
|
|
61
|
-
var TAG = /<(\/?)([\w:.-]+)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
|
|
62
|
-
var ATTRIBUTE = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
63
|
-
function decodeXmlText(value, file) {
|
|
64
|
-
return value.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (_match, entity) => {
|
|
65
|
-
if (entity.startsWith("#x"))
|
|
66
|
-
return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
|
|
67
|
-
if (entity.startsWith("#"))
|
|
68
|
-
return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
|
|
69
|
-
const character = ENTITIES[entity];
|
|
70
|
-
if (character === void 0) throw new Error(`${file}: unknown entity &${entity};`);
|
|
71
|
-
return character;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function parseXml(text, file) {
|
|
75
|
-
const root = { name: "#document", attributes: {}, children: [], text: "" };
|
|
76
|
-
const stack = [root];
|
|
77
|
-
const body = text.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
|
|
78
|
-
let index = 0;
|
|
79
|
-
while (index < body.length) {
|
|
80
|
-
const open = body.indexOf("<", index);
|
|
81
|
-
const content = body.slice(index, open === -1 ? body.length : open);
|
|
82
|
-
const parent = stack.at(-1);
|
|
83
|
-
if (parent && content.trim()) parent.text += decodeXmlText(content, file);
|
|
84
|
-
if (open === -1) break;
|
|
85
|
-
TAG.lastIndex = open;
|
|
86
|
-
const match = TAG.exec(body);
|
|
87
|
-
if (!match)
|
|
88
|
-
throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
|
|
89
|
-
index = TAG.lastIndex;
|
|
90
|
-
const [, closing, name, rawAttributes, selfClosing] = match;
|
|
91
|
-
if (!name) continue;
|
|
92
|
-
if (closing) {
|
|
93
|
-
const element2 = stack.pop();
|
|
94
|
-
if (element2?.name !== name)
|
|
95
|
-
throw new Error(`${file}: </${name}> closes <${element2?.name}>`);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const attributes = {};
|
|
99
|
-
for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
|
|
100
|
-
if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
|
|
101
|
-
const element = { name, attributes, children: [], text: "" };
|
|
102
|
-
stack.at(-1)?.children.push(element);
|
|
103
|
-
if (!selfClosing) stack.push(element);
|
|
104
|
-
}
|
|
105
|
-
if (stack.length !== 1)
|
|
106
|
-
throw new Error(`${file}: <${stack.at(-1)?.name}> is never closed`);
|
|
107
|
-
return root;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// src/android-app-identity.ts
|
|
111
|
-
function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
|
|
112
|
-
const document = parseXml(source, file);
|
|
113
|
-
if (document.children.length !== 1) return null;
|
|
114
|
-
const manifest = document.children[0];
|
|
115
|
-
if (manifest.name !== "manifest") return null;
|
|
116
|
-
const androidPrefix = Object.entries(manifest.attributes).find(
|
|
117
|
-
([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/apk/res/android"
|
|
118
|
-
)?.[0].slice("xmlns:".length);
|
|
119
|
-
if (!androidPrefix) return null;
|
|
120
|
-
const attribute = `${androidPrefix}:`;
|
|
121
|
-
const bundleIdentifier = manifest.attributes.package;
|
|
122
|
-
const appVersion = manifest.attributes[`${attribute}versionName`];
|
|
123
|
-
const buildVersion = manifest.attributes[`${attribute}versionCode`];
|
|
124
|
-
const application = manifest.children.find((child) => child.name === "application");
|
|
125
|
-
if (!application || !bundleIdentifier || !appVersion || !buildVersion || !/^[1-9][0-9]*$/.test(buildVersion) || [bundleIdentifier, appVersion].some((value) => /\$\{|^[@?]/.test(value)))
|
|
126
|
-
return null;
|
|
127
|
-
const toolsPrefixes = Object.entries(manifest.attributes).filter(
|
|
128
|
-
([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/tools"
|
|
129
|
-
).map(([name]) => `${name.slice("xmlns:".length)}:`);
|
|
130
|
-
const androidManifestPermissions = [];
|
|
131
|
-
for (const element of manifest.children) {
|
|
132
|
-
if (!["uses-permission", "uses-permission-sdk-23", "uses-permission-sdk-m"].includes(
|
|
133
|
-
element.name
|
|
134
|
-
))
|
|
135
|
-
continue;
|
|
136
|
-
if (Object.keys(element.attributes).some(
|
|
137
|
-
(key) => toolsPrefixes.some((prefix) => key.startsWith(prefix))
|
|
138
|
-
))
|
|
139
|
-
return null;
|
|
140
|
-
const name = element.attributes[`${attribute}name`];
|
|
141
|
-
const max = element.attributes[`${attribute}maxSdkVersion`];
|
|
142
|
-
if (!name || /\$\{|^[@?]/.test(name) || element.attributes[`${attribute}requiredFeature`] !== void 0 || element.attributes[`${attribute}requiredNotFeature`] !== void 0 || max !== void 0 && !/^\d+$/.test(max))
|
|
143
|
-
return null;
|
|
144
|
-
androidManifestPermissions.push({
|
|
145
|
-
name,
|
|
146
|
-
minSdkVersion: element.name === "uses-permission" ? 1 : 23,
|
|
147
|
-
...max === void 0 ? {} : { maxSdkVersion: Number(max) }
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
let androidPhotoLibraryAddOnly;
|
|
151
|
-
for (const element of application.children) {
|
|
152
|
-
if (element.name !== "meta-data" || element.attributes[`${attribute}name`] !== "one.photoLibrary.addOnly")
|
|
153
|
-
continue;
|
|
154
|
-
if (/^(?:true|True|TRUE)$/.test(element.attributes[`${attribute}value`]?.trim() ?? ""))
|
|
155
|
-
androidPhotoLibraryAddOnly = true;
|
|
156
|
-
}
|
|
157
|
-
let label = application.attributes[`${attribute}label`];
|
|
158
|
-
let applicationName = null;
|
|
159
|
-
if (label && !/\$\{|^[@?]/.test(label)) applicationName = label;
|
|
160
|
-
else if (label?.startsWith("@string/")) {
|
|
161
|
-
const resourceDirectory = androidMergedResourceValuesDirectory(file);
|
|
162
|
-
const resourceFile = resourceDirectory ? `${resourceDirectory}/values/values.xml` : null;
|
|
163
|
-
const resources = resourceFile ? files[resourceFile] : void 0;
|
|
164
|
-
if (resources !== void 0 && resourceFile) {
|
|
165
|
-
const document2 = parseXml(resources, resourceFile);
|
|
166
|
-
const root = document2.children[0];
|
|
167
|
-
if (document2.children.length === 1 && root?.name === "resources") {
|
|
168
|
-
const qualified = Object.entries(files).filter(
|
|
169
|
-
([name]) => name.startsWith(`${resourceDirectory}/values-`) && name.endsWith(".xml")
|
|
170
|
-
).flatMap(([name, source2]) => parseXml(source2, name).children).flatMap((root2) => root2.children);
|
|
171
|
-
const visited = /* @__PURE__ */ new Set();
|
|
172
|
-
while (label?.startsWith("@string/") && !visited.has(label)) {
|
|
173
|
-
visited.add(label);
|
|
174
|
-
const name = label.slice("@string/".length);
|
|
175
|
-
if (qualified.some((element) => element.attributes.name === name)) break;
|
|
176
|
-
const matches = root.children.filter(
|
|
177
|
-
(element) => (element.name === "string" || element.name === "item" && element.attributes.type === "string") && element.attributes.name === name
|
|
178
|
-
);
|
|
179
|
-
const value = matches.length === 1 ? matches[0] : void 0;
|
|
180
|
-
if (!value || value.children.length) break;
|
|
181
|
-
label = value.text.trim();
|
|
182
|
-
if (/^[@?]/.test(label)) continue;
|
|
183
|
-
applicationName = compileAndroidStringValue(value.text, resourceFile) || null;
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
applicationName,
|
|
191
|
-
appVersion,
|
|
192
|
-
buildVersion,
|
|
193
|
-
bundleIdentifier,
|
|
194
|
-
platform: "android",
|
|
195
|
-
androidManifestPermissions,
|
|
196
|
-
...androidPhotoLibraryAddOnly === void 0 ? {} : { androidPhotoLibraryAddOnly }
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function androidMergedResourceValuesDirectory(manifestFile) {
|
|
200
|
-
const match = /^(.*\/build\/intermediates\/)merged_manifests\/([^/]+)\/[^/]+\/AndroidManifest\.xml$/.exec(
|
|
201
|
-
manifestFile
|
|
202
|
-
);
|
|
203
|
-
if (!match) return null;
|
|
204
|
-
const [, intermediates, variant] = match;
|
|
205
|
-
if (!variant) return null;
|
|
206
|
-
const taskVariant = variant[0].toUpperCase() + variant.slice(1);
|
|
207
|
-
return `${intermediates}incremental/${variant}/merge${taskVariant}Resources/merged.dir`;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// src/is-record.ts
|
|
211
|
-
function isRecord(value) {
|
|
212
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// src/assetCatalogContract.ts
|
|
216
|
-
function isSwiftImageVariants(value) {
|
|
217
|
-
return Array.isArray(value) && value.length > 0 && value.every(
|
|
218
|
-
(image) => typeof image === "object" && image !== null && typeof image.uri === "string" && typeof image.scale === "number" && Number.isFinite(image.scale) && image.scale > 0 && (image.renderingMode === void 0 || image.renderingMode === "template" || image.renderingMode === "original")
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// src/nativeAppIconContract.ts
|
|
223
|
-
function resolveNativeBundleIcons(icons, catalogNames, resolveReference) {
|
|
224
|
-
if (!isRecord(icons) && catalogNames.length === 0) return void 0;
|
|
225
|
-
const resolve = (value) => {
|
|
226
|
-
if (typeof value === "string") return resolveReference(value);
|
|
227
|
-
if (Array.isArray(value)) return value.map(resolve);
|
|
228
|
-
if (isRecord(value))
|
|
229
|
-
return Object.fromEntries(
|
|
230
|
-
Object.entries(value).map(([key, entry]) => [
|
|
231
|
-
resolveReference(key),
|
|
232
|
-
resolve(entry)
|
|
233
|
-
])
|
|
234
|
-
);
|
|
235
|
-
return value;
|
|
236
|
-
};
|
|
237
|
-
const dictionary = isRecord(icons) ? Object.fromEntries(
|
|
238
|
-
Object.entries(icons).map(([key, value]) => [key, resolve(value)])
|
|
239
|
-
) : {};
|
|
240
|
-
if (catalogNames.length === 0) return dictionary;
|
|
241
|
-
return {
|
|
242
|
-
...dictionary,
|
|
243
|
-
CFBundleAlternateIcons: {
|
|
244
|
-
...Object.fromEntries(
|
|
245
|
-
catalogNames.map((name) => [name, { CFBundleIconName: name }])
|
|
246
|
-
),
|
|
247
|
-
...isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
function isNativeAppIconArtwork(value) {
|
|
252
|
-
return isRecord(value) && (value.primary === void 0 || isSwiftImageVariants(value.primary)) && isRecord(value.alternates) && Object.values(value.alternates).every(isSwiftImageVariants);
|
|
253
|
-
}
|
|
254
|
-
function readNativeAppIconArtwork(value) {
|
|
255
|
-
if (value === void 0) return void 0;
|
|
256
|
-
if (!isNativeAppIconArtwork(value))
|
|
257
|
-
throw new Error("native app icon artwork is malformed");
|
|
258
|
-
return {
|
|
259
|
-
...value.primary ? { primary: value.primary.map((image) => ({ ...image })) } : {},
|
|
260
|
-
alternates: Object.fromEntries(
|
|
261
|
-
Object.entries(value.alternates).map(([name, images]) => [
|
|
262
|
-
name,
|
|
263
|
-
images.map((image) => ({ ...image }))
|
|
264
|
-
])
|
|
265
|
-
)
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, primaryName, alternateNames, resolveReference) {
|
|
269
|
-
const members = new Set(resources);
|
|
270
|
-
const dictionary = isRecord(icons) ? icons : {};
|
|
271
|
-
const alternates = Object.fromEntries(
|
|
272
|
-
Object.entries(
|
|
273
|
-
isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
|
|
274
|
-
).map(([name, declaration]) => [resolveReference(name), declaration])
|
|
275
|
-
);
|
|
276
|
-
const resolve = (declaration, defaultName) => {
|
|
277
|
-
const entry = isRecord(declaration) ? declaration : {};
|
|
278
|
-
const name = typeof entry.CFBundleIconName === "string" ? resolveReference(entry.CFBundleIconName) : resolveReference(defaultName);
|
|
279
|
-
const catalogs = resources.filter(
|
|
280
|
-
(file) => file.endsWith(`/${name}.appiconset/Contents.json`)
|
|
281
|
-
);
|
|
282
|
-
const populatedCatalogs = [];
|
|
283
|
-
for (const catalog of catalogs) {
|
|
284
|
-
const catalogCandidates = [];
|
|
285
|
-
const text = readText(catalog);
|
|
286
|
-
const contents = text === null ? null : JSON.parse(text);
|
|
287
|
-
if (isRecord(contents) && Array.isArray(contents.images)) {
|
|
288
|
-
for (const image of contents.images) {
|
|
289
|
-
if (!isRecord(image) || typeof image.filename !== "string" || /[/\\]/.test(image.filename) || !/\.(png|jpe?g|webp)$/i.test(image.filename) || image.appearances !== void 0 || !["iphone", "universal", "ios-marketing"].includes(String(image.idiom)))
|
|
290
|
-
continue;
|
|
291
|
-
const file = catalog.slice(0, -"Contents.json".length) + image.filename;
|
|
292
|
-
const scale = image.scale === "2x" ? 2 : image.scale === "3x" ? 3 : 1;
|
|
293
|
-
const size = typeof image.size === "string" ? parseFloat(image.size) : 1024;
|
|
294
|
-
if (members.has(file) && Number.isFinite(size) && size > 0)
|
|
295
|
-
catalogCandidates.push({ file, scale, size });
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (catalogCandidates.length > 0) populatedCatalogs.push(catalogCandidates);
|
|
299
|
-
}
|
|
300
|
-
if (populatedCatalogs.length > 1)
|
|
301
|
-
throw new Error(`native app icon catalog ${name} is ambiguous`);
|
|
302
|
-
const candidates = [];
|
|
303
|
-
if (populatedCatalogs.length === 1) {
|
|
304
|
-
candidates.push(...populatedCatalogs[0]);
|
|
305
|
-
const home = candidates.filter((image) => image.size === 60);
|
|
306
|
-
const chosen = home.length ? home : candidates.sort((a, b) => b.size * b.scale - a.size * a.scale).slice(0, 1);
|
|
307
|
-
return chosen.flatMap(({ file, scale }) => {
|
|
308
|
-
const uri = resourceUri(file);
|
|
309
|
-
return uri ? [{ uri, scale }] : [];
|
|
310
|
-
}).sort((a, b) => a.scale - b.scale);
|
|
311
|
-
}
|
|
312
|
-
const files = Array.isArray(entry.CFBundleIconFiles) ? entry.CFBundleIconFiles : [];
|
|
313
|
-
for (const iconFile of files) {
|
|
314
|
-
if (typeof iconFile !== "string" || /[/\\]/.test(iconFile)) continue;
|
|
315
|
-
const base = resolveReference(iconFile).replace(/\.(png|jpe?g|webp)$/i, "");
|
|
316
|
-
for (const file of resources) {
|
|
317
|
-
const match = /(?:^|\/)([^/]+?)(?:@([23])x)?\.(png|jpe?g|webp)$/i.exec(file);
|
|
318
|
-
if (!match || match[1] !== base) continue;
|
|
319
|
-
candidates.push({ file, scale: Number(match[2] ?? 1), size: 60 });
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return candidates.flatMap(({ file, scale }) => {
|
|
323
|
-
const uri = resourceUri(file);
|
|
324
|
-
return uri ? [{ uri, scale }] : [];
|
|
325
|
-
}).sort((a, b) => a.scale - b.scale);
|
|
326
|
-
};
|
|
327
|
-
const primary = resolve(dictionary.CFBundlePrimaryIcon, primaryName);
|
|
328
|
-
return {
|
|
329
|
-
...primary.length ? { primary } : {},
|
|
330
|
-
alternates: Object.fromEntries(
|
|
331
|
-
alternateNames.flatMap((name) => {
|
|
332
|
-
const images = resolve(alternates[name], name);
|
|
333
|
-
return images.length ? [[name, images]] : [];
|
|
334
|
-
})
|
|
335
|
-
)
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// src/openstep-plist.ts
|
|
340
|
-
var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
341
|
-
var str = (value) => typeof value === "string" ? value : void 0;
|
|
342
|
-
var list = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
343
|
-
function parseOpenStepPlist(text) {
|
|
344
|
-
let i = 0;
|
|
345
|
-
const fail = (message) => {
|
|
346
|
-
const line = text.slice(0, i).split("\n").length;
|
|
347
|
-
throw new Error(`project.pbxproj line ${line}: ${message}`);
|
|
348
|
-
};
|
|
349
|
-
const skip = () => {
|
|
350
|
-
for (; ; ) {
|
|
351
|
-
const ch = text[i];
|
|
352
|
-
if (ch === " " || ch === " " || ch === "\n" || ch === "\r") i++;
|
|
353
|
-
else if (ch === "/" && text[i + 1] === "*") {
|
|
354
|
-
const end = text.indexOf("*/", i + 2);
|
|
355
|
-
if (end < 0) fail("unterminated comment");
|
|
356
|
-
i = end + 2;
|
|
357
|
-
} else if (ch === "/" && text[i + 1] === "/") {
|
|
358
|
-
const end = text.indexOf("\n", i);
|
|
359
|
-
i = end < 0 ? text.length : end + 1;
|
|
360
|
-
} else return;
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
const quoted = () => {
|
|
364
|
-
i++;
|
|
365
|
-
let out = "";
|
|
366
|
-
for (; ; ) {
|
|
367
|
-
const ch = text[i++];
|
|
368
|
-
if (ch === void 0) fail("unterminated string");
|
|
369
|
-
if (ch === '"') return out;
|
|
370
|
-
if (ch !== "\\") {
|
|
371
|
-
out += ch;
|
|
372
|
-
continue;
|
|
373
|
-
}
|
|
374
|
-
const next = text[i++];
|
|
375
|
-
if (next === "n") out += "\n";
|
|
376
|
-
else if (next === "t") out += " ";
|
|
377
|
-
else if (next === "r") out += "\r";
|
|
378
|
-
else if (next === "U") {
|
|
379
|
-
out += String.fromCharCode(parseInt(text.slice(i, i + 4), 16));
|
|
380
|
-
i += 4;
|
|
381
|
-
} else out += next;
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
const value = () => {
|
|
385
|
-
skip();
|
|
386
|
-
const ch = text[i];
|
|
387
|
-
if (ch === "{") {
|
|
388
|
-
i++;
|
|
389
|
-
const dict = {};
|
|
390
|
-
for (; ; ) {
|
|
391
|
-
skip();
|
|
392
|
-
if (text[i] === "}") {
|
|
393
|
-
i++;
|
|
394
|
-
return dict;
|
|
395
|
-
}
|
|
396
|
-
const key = value();
|
|
397
|
-
if (typeof key !== "string") fail("dictionary key is not a string");
|
|
398
|
-
skip();
|
|
399
|
-
if (text[i++] !== "=") fail("expected =");
|
|
400
|
-
if (Object.hasOwn(dict, key)) fail(`duplicate key ${key}`);
|
|
401
|
-
dict[key] = value();
|
|
402
|
-
skip();
|
|
403
|
-
if (text[i++] !== ";") fail("expected ;");
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (ch === "(") {
|
|
407
|
-
i++;
|
|
408
|
-
const list2 = [];
|
|
409
|
-
for (; ; ) {
|
|
410
|
-
skip();
|
|
411
|
-
if (text[i] === ")") {
|
|
412
|
-
i++;
|
|
413
|
-
return list2;
|
|
414
|
-
}
|
|
415
|
-
list2.push(value());
|
|
416
|
-
skip();
|
|
417
|
-
if (text[i] === ",") i++;
|
|
418
|
-
else if (text[i] !== ")") fail("expected , or )");
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
if (ch === '"') return quoted();
|
|
422
|
-
const start = i;
|
|
423
|
-
while (i < text.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text[i])) i++;
|
|
424
|
-
if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
|
|
425
|
-
return text.slice(start, i);
|
|
426
|
-
};
|
|
427
|
-
if (text.startsWith("// !$*UTF8*$!")) i = text.indexOf("\n") + 1;
|
|
428
|
-
const root = value();
|
|
429
|
-
skip();
|
|
430
|
-
if (i !== text.length) fail("trailing content");
|
|
431
|
-
return root;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// src/xcode-target-members.ts
|
|
435
|
-
var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
|
|
436
|
-
var FOLDER_REFERENCE = /^(?:folder|wrapper\.scnassets)$/;
|
|
437
|
-
var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
|
|
438
|
-
var groupParents = /* @__PURE__ */ new WeakMap();
|
|
439
|
-
function groupParentsOf(objects) {
|
|
440
|
-
let parents = groupParents.get(objects);
|
|
441
|
-
if (parents) return parents;
|
|
442
|
-
parents = /* @__PURE__ */ new Map();
|
|
443
|
-
for (const [id, entry] of Object.entries(objects)) {
|
|
444
|
-
if (!isDict(entry)) continue;
|
|
445
|
-
if (entry.isa === "PBXGroup" || entry.isa === "PBXVariantGroup") {
|
|
446
|
-
for (const child of list(entry.children)) parents.set(child, id);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
groupParents.set(objects, parents);
|
|
450
|
-
return parents;
|
|
451
|
-
}
|
|
452
|
-
function xcodePathResolver(objects, projectDir, join, sourceTreeRoot) {
|
|
453
|
-
const parents = groupParentsOf(objects);
|
|
454
|
-
const paths = /* @__PURE__ */ new Map();
|
|
455
|
-
const resolve = (id) => {
|
|
456
|
-
if (paths.has(id)) return paths.get(id);
|
|
457
|
-
paths.set(id, null);
|
|
458
|
-
const entry = objects[id];
|
|
459
|
-
let result = null;
|
|
460
|
-
if (isDict(entry)) {
|
|
461
|
-
const own = str(entry.path) ?? "";
|
|
462
|
-
const tree = str(entry.sourceTree) ?? "<group>";
|
|
463
|
-
if (tree === "<absolute>") result = own;
|
|
464
|
-
else if (tree === "SOURCE_ROOT") result = join(projectDir, own);
|
|
465
|
-
else if (tree === "<group>") {
|
|
466
|
-
const parent = parents.get(id);
|
|
467
|
-
const base = parent ? resolve(parent) : projectDir;
|
|
468
|
-
if (base !== null) result = join(base, own);
|
|
469
|
-
} else {
|
|
470
|
-
const base = sourceTreeRoot?.(tree);
|
|
471
|
-
if (base) result = join(base, own);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
paths.set(id, result);
|
|
475
|
-
return result;
|
|
476
|
-
};
|
|
477
|
-
return resolve;
|
|
478
|
-
}
|
|
479
|
-
function xcodeBuildFileBuildsForIos(buildFile) {
|
|
480
|
-
const filters = [
|
|
481
|
-
...list(buildFile.platformFilters),
|
|
482
|
-
str(buildFile.platformFilter)
|
|
483
|
-
].filter((filter) => !!filter);
|
|
484
|
-
return !filters.length || filters.includes("ios");
|
|
485
|
-
}
|
|
486
|
-
function xcodeTargetMemberVisitor(objects) {
|
|
487
|
-
const synchronizedGroups = [];
|
|
488
|
-
for (const id of Object.keys(objects)) {
|
|
489
|
-
const group = objects[id];
|
|
490
|
-
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
491
|
-
synchronizedGroups.push({ id, group });
|
|
492
|
-
}
|
|
493
|
-
return (targetId, resolvePath, filesUnder, join, visit) => {
|
|
494
|
-
const target = objects[targetId];
|
|
495
|
-
if (!isDict(target)) return;
|
|
496
|
-
for (const phaseId of list(target.buildPhases)) {
|
|
497
|
-
const phase = objects[phaseId];
|
|
498
|
-
if (!isDict(phase)) continue;
|
|
499
|
-
if (phase.isa !== "PBXSourcesBuildPhase" && phase.isa !== "PBXResourcesBuildPhase")
|
|
500
|
-
continue;
|
|
501
|
-
for (const buildFileId of list(phase.files)) {
|
|
502
|
-
const buildFile = objects[buildFileId];
|
|
503
|
-
if (!isDict(buildFile) || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
504
|
-
const refId = str(buildFile.fileRef);
|
|
505
|
-
if (!refId) continue;
|
|
506
|
-
const entry = objects[refId];
|
|
507
|
-
const refs = isDict(entry) && entry.isa === "PBXVariantGroup" ? list(entry.children) : [refId];
|
|
508
|
-
for (const id of refs) {
|
|
509
|
-
const file = resolvePath(id);
|
|
510
|
-
if (file === null) continue;
|
|
511
|
-
if (phase.isa === "PBXSourcesBuildPhase") {
|
|
512
|
-
visit(file, "source");
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
const ref = objects[id];
|
|
516
|
-
const type = isDict(ref) ? str(ref.lastKnownFileType) ?? str(ref.explicitFileType) ?? "" : "";
|
|
517
|
-
const root = file.replace(/[\\/]+$/, "");
|
|
518
|
-
const folder = FOLDER_REFERENCE.test(type) ? root.split(/[\\/]/).pop() : void 0;
|
|
519
|
-
for (const inner of filesUnder(file))
|
|
520
|
-
visit(
|
|
521
|
-
inner,
|
|
522
|
-
"resource",
|
|
523
|
-
folder && `${folder}/${inner.slice(root.length + 1).replaceAll("\\", "/")}`
|
|
524
|
-
);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
const owned = new Set(list(target.fileSystemSynchronizedGroups));
|
|
529
|
-
for (const { id: groupId, group } of synchronizedGroups) {
|
|
530
|
-
const folder = resolvePath(groupId);
|
|
531
|
-
if (folder === null) continue;
|
|
532
|
-
const prefix = folder === "" ? "" : `${folder.replace(/\/$/, "")}/`;
|
|
533
|
-
const exceptions = /* @__PURE__ */ new Set();
|
|
534
|
-
for (const exceptionId of list(group.exceptions)) {
|
|
535
|
-
const exception = objects[exceptionId];
|
|
536
|
-
if (!isDict(exception) || exception.target !== targetId) continue;
|
|
537
|
-
for (const relative of list(exception.membershipExceptions))
|
|
538
|
-
exceptions.add(relative);
|
|
539
|
-
}
|
|
540
|
-
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative) => filesUnder(join(folder, relative)));
|
|
541
|
-
for (const file of members) {
|
|
542
|
-
const relative = file.slice(prefix.length);
|
|
543
|
-
const excepted = [...exceptions].some(
|
|
544
|
-
(exception) => relative === exception || relative.startsWith(`${exception}/`)
|
|
545
|
-
);
|
|
546
|
-
if (owned.has(groupId) === excepted || NEVER_MEMBER.test(relative)) continue;
|
|
547
|
-
if (file.endsWith(".swift")) {
|
|
548
|
-
if (!relative.split("/").some((segment) => BUNDLE_DIR.test(segment)))
|
|
549
|
-
visit(file, "source");
|
|
550
|
-
} else if (/\.(h|hh|hpp|hxx|pch)$/.test(file)) {
|
|
551
|
-
visit(
|
|
552
|
-
file,
|
|
553
|
-
relative.split("/").some((segment) => BUNDLE_DIR.test(segment)) ? "resource" : "header"
|
|
554
|
-
);
|
|
555
|
-
} else if (/\.(m|mm|c|cc|cpp|cxx|metal)$/.test(file)) {
|
|
556
|
-
visit(file, "source");
|
|
557
|
-
} else visit(file, "resource");
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// src/native-app-identity.ts
|
|
564
|
-
function readKeychainAccessGroups(dictionary, resolve) {
|
|
565
|
-
if (!isRecord(dictionary))
|
|
566
|
-
throw new Error("native app entitlements are not a dictionary");
|
|
567
|
-
const groups = dictionary["keychain-access-groups"];
|
|
568
|
-
if (groups === void 0) return void 0;
|
|
569
|
-
if (!Array.isArray(groups)) throw new Error("keychain-access-groups is not an array");
|
|
570
|
-
return groups.map((group) => {
|
|
571
|
-
if (typeof group !== "string")
|
|
572
|
-
throw new Error("keychain access group is not a string");
|
|
573
|
-
const value = resolve(group);
|
|
574
|
-
if (!value || /\$[({]/.test(value))
|
|
575
|
-
throw new Error("keychain access group has unresolved signing settings");
|
|
576
|
-
return value;
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
var NATIVE_APP_IDENTITY_PREFIX = "globalThis.__sootsimNativeAppIdentity=";
|
|
580
|
-
var METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
|
|
581
|
-
var APPLIED_NATIVE_ROOT_MODULE_KEY = "__sootsim_native_root_module";
|
|
582
|
-
var NATIVE_APP_IDENTITY_HEADER = "Peach-Native-App-Identity";
|
|
583
|
-
function nonEmptyString(value) {
|
|
584
|
-
return typeof value === "string" && value.length > 0 ? value : null;
|
|
585
|
-
}
|
|
586
|
-
function isNativeAppIdentity(value) {
|
|
587
|
-
if (!isRecord(value)) return false;
|
|
588
|
-
for (const key of ["statusBarHidden", "viewControllerBasedStatusBarAppearance"]) {
|
|
589
|
-
if (value[key] !== void 0 && typeof value[key] !== "boolean") return false;
|
|
590
|
-
}
|
|
591
|
-
if (value.sceneManifest !== void 0 && value.sceneManifest !== null && !isRecord(value.sceneManifest))
|
|
592
|
-
return false;
|
|
593
|
-
const oneUpdates = value.oneUpdates;
|
|
594
|
-
if (oneUpdates !== void 0 && (!isRecord(oneUpdates) || typeof oneUpdates.enabled !== "boolean" || oneUpdates.url !== null && typeof oneUpdates.url !== "string" || oneUpdates.runtimeVersion !== null && typeof oneUpdates.runtimeVersion !== "string" || oneUpdates.embeddedManifestJson !== null && typeof oneUpdates.embeddedManifestJson !== "string" || oneUpdates.enabled && (typeof oneUpdates.url !== "string" || oneUpdates.url.length === 0 || typeof oneUpdates.runtimeVersion !== "string" || oneUpdates.runtimeVersion.length === 0))) {
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
|
-
if (value.dtPlatformVersion !== void 0 && typeof value.dtPlatformVersion !== "string")
|
|
598
|
-
return false;
|
|
599
|
-
if (value.androidManifestPermissions !== void 0 && (!Array.isArray(value.androidManifestPermissions) || !value.androidManifestPermissions.every(
|
|
600
|
-
(permission) => isRecord(permission) && typeof permission.name === "string" && permission.name.length > 0 && Number.isInteger(permission.minSdkVersion) && typeof permission.minSdkVersion === "number" && permission.minSdkVersion > 0 && (permission.maxSdkVersion === void 0 || typeof permission.maxSdkVersion === "number" && Number.isInteger(permission.maxSdkVersion) && permission.maxSdkVersion >= 0)
|
|
601
|
-
)))
|
|
602
|
-
return false;
|
|
603
|
-
if (value.androidPhotoLibraryAddOnly !== void 0 && value.androidPhotoLibraryAddOnly !== true)
|
|
604
|
-
return false;
|
|
605
|
-
if (value.googleSignIn !== void 0 && !isRecord(value.googleSignIn)) return false;
|
|
606
|
-
if (value.bundleIcons !== void 0 && !isRecord(value.bundleIcons)) return false;
|
|
607
|
-
const descriptions = value.permissionUsageDescriptions;
|
|
608
|
-
if (value.reanimatedStaticFeatureFlags !== void 0 && (!isRecord(value.reanimatedStaticFeatureFlags) || !Object.values(value.reanimatedStaticFeatureFlags).every(
|
|
609
|
-
(flag) => typeof flag === "boolean"
|
|
610
|
-
)))
|
|
611
|
-
return false;
|
|
612
|
-
if (descriptions !== void 0 && !isRecord(descriptions)) return false;
|
|
613
|
-
if (value.infoPlistStrings !== void 0 && (!isRecord(value.infoPlistStrings) || !Object.values(value.infoPlistStrings).every((entry) => typeof entry === "string")))
|
|
614
|
-
return false;
|
|
615
|
-
if (value.infoPlistBooleans !== void 0 && (!isRecord(value.infoPlistBooleans) || !Object.values(value.infoPlistBooleans).every(
|
|
616
|
-
(entry) => typeof entry === "boolean"
|
|
617
|
-
)))
|
|
618
|
-
return false;
|
|
619
|
-
if (value.urlQuerySchemes !== void 0 && !Array.isArray(value.urlQuerySchemes))
|
|
620
|
-
return false;
|
|
621
|
-
if (value.appIntentIdentifiers !== void 0 && (!Array.isArray(value.appIntentIdentifiers) || !value.appIntentIdentifiers.every((identifier) => typeof identifier === "string")))
|
|
622
|
-
return false;
|
|
623
|
-
if (value.backgroundTaskIdentifiers !== void 0 && (!Array.isArray(value.backgroundTaskIdentifiers) || !value.backgroundTaskIdentifiers.every(
|
|
624
|
-
(identifier) => typeof identifier === "string"
|
|
625
|
-
)))
|
|
626
|
-
return false;
|
|
627
|
-
if (value.backgroundModes !== void 0 && (!Array.isArray(value.backgroundModes) || !value.backgroundModes.every((mode) => typeof mode === "string")))
|
|
628
|
-
return false;
|
|
629
|
-
if (value.keychainAccessGroups !== void 0 && (!Array.isArray(value.keychainAccessGroups) || !value.keychainAccessGroups.every(
|
|
630
|
-
(group) => typeof group === "string" && group.length > 0 && !/\$[({]/.test(group)
|
|
631
|
-
)))
|
|
632
|
-
return false;
|
|
633
|
-
if (value.shareIntoAppGroupId !== void 0 && typeof value.shareIntoAppGroupId !== "string")
|
|
634
|
-
return false;
|
|
635
|
-
if (value.rtcAppGroupIdentifier !== void 0 && typeof value.rtcAppGroupIdentifier !== "string")
|
|
636
|
-
return false;
|
|
637
|
-
if (value.screenShareExtensionBundleId !== void 0 && typeof value.screenShareExtensionBundleId !== "string")
|
|
638
|
-
return false;
|
|
639
|
-
if (value.applicationDisplayName !== void 0 && typeof value.applicationDisplayName !== "string")
|
|
640
|
-
return false;
|
|
641
|
-
if (value.rootModuleName !== void 0 && typeof value.rootModuleName !== "string")
|
|
642
|
-
return false;
|
|
643
|
-
if (value.rootViewBackgroundColor !== void 0 && (typeof value.rootViewBackgroundColor !== "number" || !Number.isInteger(value.rootViewBackgroundColor)))
|
|
644
|
-
return false;
|
|
645
|
-
if (value.designRequiresCompatibility !== void 0 && value.designRequiresCompatibility !== true)
|
|
646
|
-
return false;
|
|
647
|
-
for (const orientations of [
|
|
648
|
-
value.supportedInterfaceOrientations,
|
|
649
|
-
value.ipadSupportedInterfaceOrientations
|
|
650
|
-
]) {
|
|
651
|
-
if (orientations !== void 0 && (!Array.isArray(orientations) || !orientations.every((orientation) => typeof orientation === "string")))
|
|
652
|
-
return false;
|
|
653
|
-
}
|
|
654
|
-
if (value.defaultScreenOrientationMask !== void 0 && typeof value.defaultScreenOrientationMask !== "string")
|
|
655
|
-
return false;
|
|
656
|
-
if (value.appIconArtwork !== void 0 && !isNativeAppIconArtwork(value.appIconArtwork))
|
|
657
|
-
return false;
|
|
658
|
-
const platform = value.platform;
|
|
659
|
-
if (value.alternateIconNames !== void 0 && (!Array.isArray(value.alternateIconNames) || !value.alternateIconNames.every((name) => typeof name === "string")))
|
|
660
|
-
return false;
|
|
661
|
-
if (platform !== "ios" && platform !== "android") return false;
|
|
662
|
-
const applicationName = value.applicationName;
|
|
663
|
-
if (applicationName !== null && nonEmptyString(applicationName) === null) return false;
|
|
664
|
-
if (value.bundleName !== void 0 && nonEmptyString(value.bundleName) === null)
|
|
665
|
-
return false;
|
|
666
|
-
if (nonEmptyString(value.appVersion) === null) return false;
|
|
667
|
-
if (nonEmptyString(value.bundleIdentifier) === null) return false;
|
|
668
|
-
const buildVersion = nonEmptyString(value.buildVersion);
|
|
669
|
-
if (buildVersion === null) return false;
|
|
670
|
-
if (platform === "android" && !/^[1-9][0-9]*$/.test(buildVersion)) return false;
|
|
671
|
-
return true;
|
|
672
|
-
}
|
|
673
|
-
function readNativeAppIdentity(value) {
|
|
674
|
-
if (value === void 0 || value === null) return null;
|
|
675
|
-
if (!isNativeAppIdentity(value)) {
|
|
676
|
-
throw new Error("native app identity is malformed");
|
|
677
|
-
}
|
|
678
|
-
return {
|
|
679
|
-
applicationName: value.applicationName,
|
|
680
|
-
...value.applicationDisplayName === void 0 ? {} : { applicationDisplayName: value.applicationDisplayName },
|
|
681
|
-
...value.rootModuleName === void 0 ? {} : { rootModuleName: value.rootModuleName },
|
|
682
|
-
...value.rootViewBackgroundColor === void 0 ? {} : { rootViewBackgroundColor: value.rootViewBackgroundColor },
|
|
683
|
-
...value.designRequiresCompatibility === void 0 ? {} : { designRequiresCompatibility: value.designRequiresCompatibility },
|
|
684
|
-
...value.statusBarHidden === void 0 ? {} : { statusBarHidden: value.statusBarHidden },
|
|
685
|
-
...value.viewControllerBasedStatusBarAppearance === void 0 ? {} : {
|
|
686
|
-
viewControllerBasedStatusBarAppearance: value.viewControllerBasedStatusBarAppearance
|
|
687
|
-
},
|
|
688
|
-
...value.sceneManifest === void 0 ? {} : { sceneManifest: value.sceneManifest },
|
|
689
|
-
...value.dtPlatformVersion === void 0 ? {} : { dtPlatformVersion: value.dtPlatformVersion },
|
|
690
|
-
...value.bundleName === void 0 ? {} : { bundleName: value.bundleName },
|
|
691
|
-
appVersion: value.appVersion,
|
|
692
|
-
buildVersion: value.buildVersion,
|
|
693
|
-
bundleIdentifier: value.bundleIdentifier,
|
|
694
|
-
platform: value.platform,
|
|
695
|
-
...value.reanimatedStaticFeatureFlags === void 0 ? {} : { reanimatedStaticFeatureFlags: { ...value.reanimatedStaticFeatureFlags } },
|
|
696
|
-
...value.appIconArtwork === void 0 ? {} : { appIconArtwork: readNativeAppIconArtwork(value.appIconArtwork) },
|
|
697
|
-
...value.alternateIconNames === void 0 ? {} : { alternateIconNames: [...value.alternateIconNames] },
|
|
698
|
-
...value.bundleIcons === void 0 ? {} : { bundleIcons: structuredClone(value.bundleIcons) },
|
|
699
|
-
...value.androidManifestPermissions === void 0 ? {} : {
|
|
700
|
-
androidManifestPermissions: value.androidManifestPermissions.map(
|
|
701
|
-
(permission) => ({ ...permission })
|
|
702
|
-
)
|
|
703
|
-
},
|
|
704
|
-
...value.androidPhotoLibraryAddOnly === void 0 ? {} : { androidPhotoLibraryAddOnly: value.androidPhotoLibraryAddOnly },
|
|
705
|
-
...value.googleSignIn === void 0 ? {} : { googleSignIn: structuredClone(value.googleSignIn) },
|
|
706
|
-
...value.permissionUsageDescriptions === void 0 ? {} : {
|
|
707
|
-
permissionUsageDescriptions: { ...value.permissionUsageDescriptions }
|
|
708
|
-
},
|
|
709
|
-
...value.infoPlistStrings === void 0 ? {} : { infoPlistStrings: { ...value.infoPlistStrings } },
|
|
710
|
-
...value.infoPlistBooleans === void 0 ? {} : { infoPlistBooleans: { ...value.infoPlistBooleans } },
|
|
711
|
-
...value.appIntentIdentifiers === void 0 ? {} : { appIntentIdentifiers: [...value.appIntentIdentifiers] },
|
|
712
|
-
...value.backgroundTaskIdentifiers === void 0 ? {} : { backgroundTaskIdentifiers: [...value.backgroundTaskIdentifiers] },
|
|
713
|
-
...value.supportedInterfaceOrientations === void 0 ? {} : {
|
|
714
|
-
supportedInterfaceOrientations: [...value.supportedInterfaceOrientations]
|
|
715
|
-
},
|
|
716
|
-
...value.ipadSupportedInterfaceOrientations === void 0 ? {} : {
|
|
717
|
-
ipadSupportedInterfaceOrientations: [
|
|
718
|
-
...value.ipadSupportedInterfaceOrientations
|
|
719
|
-
]
|
|
720
|
-
},
|
|
721
|
-
...value.defaultScreenOrientationMask === void 0 ? {} : { defaultScreenOrientationMask: value.defaultScreenOrientationMask },
|
|
722
|
-
...value.backgroundModes === void 0 ? {} : { backgroundModes: [...value.backgroundModes] },
|
|
723
|
-
...value.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: [...value.keychainAccessGroups] },
|
|
724
|
-
...value.shareIntoAppGroupId === void 0 ? {} : { shareIntoAppGroupId: value.shareIntoAppGroupId },
|
|
725
|
-
...value.rtcAppGroupIdentifier === void 0 ? {} : { rtcAppGroupIdentifier: value.rtcAppGroupIdentifier },
|
|
726
|
-
...value.screenShareExtensionBundleId === void 0 ? {} : { screenShareExtensionBundleId: value.screenShareExtensionBundleId },
|
|
727
|
-
...value.urlQuerySchemes === void 0 ? {} : { urlQuerySchemes: [...value.urlQuerySchemes] },
|
|
728
|
-
...value.oneUpdates === void 0 ? {} : {
|
|
729
|
-
oneUpdates: {
|
|
730
|
-
enabled: value.oneUpdates.enabled,
|
|
731
|
-
url: value.oneUpdates.url,
|
|
732
|
-
runtimeVersion: value.oneUpdates.runtimeVersion,
|
|
733
|
-
embeddedManifestJson: value.oneUpdates.embeddedManifestJson
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
function createNativeAppIdentityHeader(identity) {
|
|
739
|
-
return encodeURIComponent(JSON.stringify(readNativeAppIdentity(identity)));
|
|
740
|
-
}
|
|
741
|
-
function equalIdentityValues(left, right) {
|
|
742
|
-
if (left === right) return true;
|
|
743
|
-
if (Array.isArray(left) && Array.isArray(right)) {
|
|
744
|
-
return left.length === right.length && left.every((value, index) => equalIdentityValues(value, right[index]));
|
|
745
|
-
}
|
|
746
|
-
if (!isRecord(left) || !isRecord(right)) return false;
|
|
747
|
-
const keys = Object.keys(left);
|
|
748
|
-
return keys.length === Object.keys(right).length && keys.every(
|
|
749
|
-
(key) => Object.hasOwn(right, key) && equalIdentityValues(left[key], right[key])
|
|
750
|
-
);
|
|
751
|
-
}
|
|
752
|
-
function readNativeAppIdentityHeader(header) {
|
|
753
|
-
let value;
|
|
754
|
-
try {
|
|
755
|
-
value = JSON.parse(decodeURIComponent(header));
|
|
756
|
-
} catch {
|
|
757
|
-
throw new Error("native app identity response header is malformed");
|
|
758
|
-
}
|
|
759
|
-
const identity = readNativeAppIdentity(value);
|
|
760
|
-
if (!identity) throw new Error("native app identity response header is malformed");
|
|
761
|
-
return identity;
|
|
762
|
-
}
|
|
763
|
-
function readNativeAppIdentityFromBundle(source, header) {
|
|
764
|
-
const footer = readNativeAppIdentityFooter(source);
|
|
765
|
-
if (header === null) return readNativeAppIdentity(footer);
|
|
766
|
-
const identity = readNativeAppIdentityHeader(header);
|
|
767
|
-
const footerIdentity = footer ? readNativeAppIdentity(footer) : null;
|
|
768
|
-
const headerBase = { ...identity, oneUpdates: void 0 };
|
|
769
|
-
const footerBase = footerIdentity && { ...footerIdentity, oneUpdates: void 0 };
|
|
770
|
-
if (footerIdentity && !equalIdentityValues(headerBase, footerBase)) {
|
|
771
|
-
throw new Error("native app identity response header conflicts with bundle footer");
|
|
772
|
-
}
|
|
773
|
-
return identity;
|
|
774
|
-
}
|
|
775
|
-
function applyNativeAppIdentity(identity) {
|
|
776
|
-
const globals = globalThis;
|
|
777
|
-
if (identity) globals.__sootsim_native_app_identity = identity;
|
|
778
|
-
else delete globals.__sootsim_native_app_identity;
|
|
779
|
-
}
|
|
780
|
-
function applyNativeRootModuleName(name) {
|
|
781
|
-
if (name) Reflect.set(globalThis, APPLIED_NATIVE_ROOT_MODULE_KEY, name);
|
|
782
|
-
else Reflect.deleteProperty(globalThis, APPLIED_NATIVE_ROOT_MODULE_KEY);
|
|
783
|
-
}
|
|
784
|
-
function getNativeRootModuleName() {
|
|
785
|
-
const applied = Reflect.get(globalThis, APPLIED_NATIVE_ROOT_MODULE_KEY);
|
|
786
|
-
return getAppliedNativeAppIdentity()?.rootModuleName ?? (typeof applied === "string" ? applied : void 0);
|
|
787
|
-
}
|
|
788
|
-
function getAppliedNativeAppIdentity() {
|
|
789
|
-
return globalThis.__sootsim_native_app_identity ?? null;
|
|
790
|
-
}
|
|
791
|
-
function createNativeAppIdentityFooter(identity) {
|
|
792
|
-
const footerIdentity = { ...identity };
|
|
793
|
-
delete footerIdentity.oneUpdates;
|
|
794
|
-
const payload = JSON.stringify(footerIdentity).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/<\//g, "<\\/");
|
|
795
|
-
return `
|
|
796
|
-
${NATIVE_APP_IDENTITY_PREFIX}${payload};`;
|
|
797
|
-
}
|
|
798
|
-
function nativeAppIdentityFooterStart(source) {
|
|
799
|
-
return findBundleFooter(source, NATIVE_APP_IDENTITY_PREFIX);
|
|
800
|
-
}
|
|
801
|
-
function readNativeAppIdentityFooter(source) {
|
|
802
|
-
const start = nativeAppIdentityFooterStart(source);
|
|
803
|
-
if (start < 0) return null;
|
|
804
|
-
const lineEnd = source.indexOf("\n", start + 1);
|
|
805
|
-
const line = source.slice(start + 1, lineEnd < 0 ? void 0 : lineEnd);
|
|
806
|
-
if (!line.endsWith(";")) {
|
|
807
|
-
throw new Error("native app identity footer is truncated");
|
|
808
|
-
}
|
|
809
|
-
let parsed;
|
|
810
|
-
try {
|
|
811
|
-
parsed = JSON.parse(line.slice(NATIVE_APP_IDENTITY_PREFIX.length, -1));
|
|
812
|
-
} catch {
|
|
813
|
-
throw new Error("native app identity footer is not valid JSON");
|
|
814
|
-
}
|
|
815
|
-
if (!isNativeAppIdentity(parsed)) {
|
|
816
|
-
throw new Error("native app identity footer is malformed");
|
|
817
|
-
}
|
|
818
|
-
if (parsed.oneUpdates !== void 0) {
|
|
819
|
-
throw new Error("native app identity footer cannot contain one updates receipt");
|
|
820
|
-
}
|
|
821
|
-
return parsed;
|
|
822
|
-
}
|
|
823
|
-
function detachNativeAppIdentityFooter(source) {
|
|
824
|
-
const start = nativeAppIdentityFooterStart(source);
|
|
825
|
-
if (start < 0) return { source, identity: null };
|
|
826
|
-
const identity = readNativeAppIdentityFooter(source);
|
|
827
|
-
const lineEnd = source.indexOf("\n", start + 1);
|
|
828
|
-
const end = lineEnd < 0 ? source.length : lineEnd;
|
|
829
|
-
return { source: source.slice(0, start) + source.slice(end), identity };
|
|
830
|
-
}
|
|
831
|
-
function insertNativeAppIdentityFooter(source, identity) {
|
|
832
|
-
const existing = nativeAppIdentityFooterStart(source);
|
|
833
|
-
const existingEnd = existing < 0 ? -1 : source.includes("\n", existing + 1) ? source.indexOf("\n", existing + 1) : -1;
|
|
834
|
-
const withoutExisting = existing < 0 ? source : source.slice(0, existing) + source.slice(existingEnd < 0 ? source.length : existingEnd);
|
|
835
|
-
const moduleFooter = findBundleFooter(withoutExisting, METRO_MODULE_PATHS_PREFIX);
|
|
836
|
-
const footer = createNativeAppIdentityFooter(identity);
|
|
837
|
-
if (moduleFooter < 0) return withoutExisting + footer;
|
|
838
|
-
return withoutExisting.slice(0, moduleFooter) + footer + withoutExisting.slice(moduleFooter);
|
|
839
|
-
}
|
|
840
|
-
function readGoogleSignInConfiguration(plist, resources) {
|
|
841
|
-
const clientIds = {};
|
|
842
|
-
for (const [file, value] of Object.entries(resources)) {
|
|
843
|
-
if (isRecord(value) && typeof value.CLIENT_ID === "string")
|
|
844
|
-
clientIds[file.split("/").pop()?.replace(/\.plist$/, "") ?? file] = value.CLIENT_ID;
|
|
845
|
-
}
|
|
846
|
-
const urlSchemes = [];
|
|
847
|
-
for (const entry of Array.isArray(plist.CFBundleURLTypes) ? plist.CFBundleURLTypes : []) {
|
|
848
|
-
if (!isRecord(entry) || !Array.isArray(entry.CFBundleURLSchemes)) continue;
|
|
849
|
-
for (const scheme of entry.CFBundleURLSchemes)
|
|
850
|
-
if (typeof scheme === "string") urlSchemes.push(scheme);
|
|
851
|
-
}
|
|
852
|
-
return {
|
|
853
|
-
clientId: plist.GIDClientID,
|
|
854
|
-
serverClientId: plist.GIDServerClientID,
|
|
855
|
-
hostedDomain: plist.GIDHostedDomain,
|
|
856
|
-
openIDRealm: plist.GIDOpenIDRealm,
|
|
857
|
-
urlSchemes,
|
|
858
|
-
clientIds
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
function plistString(plist, key) {
|
|
862
|
-
const match = plist.match(new RegExp(`<key>${key}</key>\\s*<string>([^<]*)</string>`));
|
|
863
|
-
return match ? match[1].trim() : null;
|
|
864
|
-
}
|
|
865
|
-
function resolvePlistStrings(value, settings) {
|
|
866
|
-
const resolve = (item) => typeof item === "string" ? resolveBuildSetting(item, settings) ?? item : Array.isArray(item) ? item.map(resolve) : isRecord(item) ? resolvePlistStrings(item, settings) : item;
|
|
867
|
-
return Object.fromEntries(
|
|
868
|
-
Object.entries(value).map(([key, item]) => [key, resolve(item)])
|
|
869
|
-
);
|
|
870
|
-
}
|
|
871
|
-
function resolveBuildSetting(value, settings, depth = 0) {
|
|
872
|
-
if (depth > 8) return null;
|
|
873
|
-
let unresolved = false;
|
|
874
|
-
const resolved = value.replace(/\$\(([^()]+)\)/g, (_match, reference) => {
|
|
875
|
-
const separator = reference.indexOf(":");
|
|
876
|
-
if (separator >= 0) {
|
|
877
|
-
unresolved = true;
|
|
878
|
-
return "";
|
|
879
|
-
}
|
|
880
|
-
const replacement = settings[reference];
|
|
881
|
-
if (replacement === void 0) {
|
|
882
|
-
unresolved = true;
|
|
883
|
-
return "";
|
|
884
|
-
}
|
|
885
|
-
return replacement;
|
|
886
|
-
});
|
|
887
|
-
if (unresolved) return null;
|
|
888
|
-
if (resolved.includes("$(")) return resolveBuildSetting(resolved, settings, depth + 1);
|
|
889
|
-
return resolved;
|
|
890
|
-
}
|
|
891
|
-
function resolvedIdentityField(value) {
|
|
892
|
-
const trimmed = value?.trim() ?? "";
|
|
893
|
-
if (!trimmed || trimmed.includes("$(")) return null;
|
|
894
|
-
return trimmed;
|
|
895
|
-
}
|
|
896
|
-
function identityFieldFrom(settings, raw, fallbackSetting) {
|
|
897
|
-
if (raw !== null) return resolvedIdentityField(resolveBuildSetting(raw, settings));
|
|
898
|
-
return resolvedIdentityField(nonEmptyString(fallbackSetting ?? null));
|
|
899
|
-
}
|
|
900
|
-
function readBuildSettingsBlock(source, start) {
|
|
901
|
-
let depth = 0;
|
|
902
|
-
for (let index = start; index < source.length; index++) {
|
|
903
|
-
const character = source[index];
|
|
904
|
-
if (character === "{") depth++;
|
|
905
|
-
else if (character === "}") {
|
|
906
|
-
depth--;
|
|
907
|
-
if (depth === 0) return source.slice(start, index + 1);
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
return source.slice(start);
|
|
911
|
-
}
|
|
912
|
-
function parseBuildSettings(block) {
|
|
913
|
-
const settings = {};
|
|
914
|
-
const matchPattern = /([A-Za-z0-9_]+) = ("(?:[^"\\]|\\.)*"|[^;{}]*);/g;
|
|
915
|
-
let match;
|
|
916
|
-
while ((match = matchPattern.exec(block)) !== null) {
|
|
917
|
-
const raw = match[2].trim();
|
|
918
|
-
settings[match[1]] = raw.startsWith('"') ? raw.slice(1, -1) : raw.trim();
|
|
919
|
-
}
|
|
920
|
-
return settings;
|
|
921
|
-
}
|
|
922
|
-
function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
923
|
-
const configurationPattern = /\/\* (Release|Debug) \*\/ = \{/g;
|
|
924
|
-
const candidates = [];
|
|
925
|
-
let match;
|
|
926
|
-
while ((match = configurationPattern.exec(pbxproj)) !== null) {
|
|
927
|
-
const blockStart = pbxproj.indexOf("{", match.index);
|
|
928
|
-
if (blockStart < 0) continue;
|
|
929
|
-
const block = readBuildSettingsBlock(pbxproj, blockStart);
|
|
930
|
-
const buildSettingsStart = block.indexOf("buildSettings = {");
|
|
931
|
-
if (buildSettingsStart < 0) continue;
|
|
932
|
-
const settings = parseBuildSettings(
|
|
933
|
-
readBuildSettingsBlock(block, block.indexOf("{", buildSettingsStart))
|
|
934
|
-
);
|
|
935
|
-
candidates.push({ name: match[1], settings });
|
|
936
|
-
}
|
|
937
|
-
const plistMatch = (settings) => {
|
|
938
|
-
const plist = settings.INFOPLIST_FILE;
|
|
939
|
-
if (!plist) return false;
|
|
940
|
-
const normalized = plist.replace(/^"|"$/g, "");
|
|
941
|
-
return normalized === infoPlistRelativePath || infoPlistRelativePath.endsWith(`/${normalized}`) || normalized.endsWith(`/${infoPlistRelativePath}`);
|
|
942
|
-
};
|
|
943
|
-
const named = (settings) => resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings) === targetName;
|
|
944
|
-
return candidates.find(
|
|
945
|
-
(candidate) => candidate.name === "Release" && plistMatch(candidate.settings)
|
|
946
|
-
)?.settings ?? candidates.find(
|
|
947
|
-
(candidate) => candidate.name === "Release" && named(candidate.settings)
|
|
948
|
-
)?.settings ?? null;
|
|
949
|
-
}
|
|
950
|
-
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
951
|
-
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
952
|
-
const pbxprojPath = Object.keys(files).find(
|
|
953
|
-
(path) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path)
|
|
954
|
-
) ?? Object.keys(files).find(
|
|
955
|
-
(path) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path)
|
|
956
|
-
) ?? Object.keys(files).find((path) => /(?:^|\/)project\.pbxproj$/.test(path));
|
|
957
|
-
if (!pbxprojPath) return null;
|
|
958
|
-
const pbxproj = files[pbxprojPath];
|
|
959
|
-
let objects = {};
|
|
960
|
-
try {
|
|
961
|
-
const parsed = parseOpenStepPlist(pbxproj);
|
|
962
|
-
if (isRecord(parsed)) {
|
|
963
|
-
objects = isRecord(parsed.objects) ? parsed.objects : parsed;
|
|
964
|
-
}
|
|
965
|
-
} catch {
|
|
966
|
-
}
|
|
967
|
-
const targets = [];
|
|
968
|
-
for (const [id, obj] of Object.entries(objects)) {
|
|
969
|
-
if (isRecord(obj) && obj.isa === "PBXNativeTarget" && typeof obj.name === "string") {
|
|
970
|
-
targets.push({
|
|
971
|
-
id,
|
|
972
|
-
name: obj.name,
|
|
973
|
-
productType: typeof obj.productType === "string" ? obj.productType : void 0,
|
|
974
|
-
buildConfigurationList: typeof obj.buildConfigurationList === "string" ? obj.buildConfigurationList : void 0
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
const applicationTargetNames = new Set(
|
|
979
|
-
targets.filter((t) => t.productType === "com.apple.product-type.application").map((t) => t.name)
|
|
980
|
-
);
|
|
981
|
-
if (applicationTargetNames.size === 0) {
|
|
982
|
-
for (const match of pbxproj.matchAll(
|
|
983
|
-
/isa = PBXNativeTarget;[^}]*?name = "?([^";]+)"?;[^}]*?productType = "com\.apple\.product-type\.application";/g
|
|
984
|
-
)) {
|
|
985
|
-
applicationTargetNames.add(match[1]);
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
let targetName = null;
|
|
989
|
-
if (iosTarget) {
|
|
990
|
-
if (applicationTargetNames.has(iosTarget)) {
|
|
991
|
-
targetName = iosTarget;
|
|
992
|
-
} else {
|
|
993
|
-
return null;
|
|
994
|
-
}
|
|
995
|
-
} else if (applicationTargetNames.size === 1) {
|
|
996
|
-
targetName = [...applicationTargetNames][0];
|
|
997
|
-
} else if (applicationTargetNames.size > 1) {
|
|
998
|
-
const delegateTargets = Object.keys(files).filter((path) => !path.includes("/Pods/")).map((path) => path.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
999
|
-
(name) => typeof name === "string" && applicationTargetNames.has(name)
|
|
1000
|
-
);
|
|
1001
|
-
if (delegateTargets.length === 1) {
|
|
1002
|
-
targetName = delegateTargets[0];
|
|
1003
|
-
} else {
|
|
1004
|
-
return null;
|
|
1005
|
-
}
|
|
1006
|
-
} else {
|
|
1007
|
-
return null;
|
|
1008
|
-
}
|
|
1009
|
-
const selectedTarget = targets.find((t) => t.name === targetName);
|
|
1010
|
-
const settings = {
|
|
1011
|
-
TARGET_NAME: targetName,
|
|
1012
|
-
PRODUCT_NAME: targetName
|
|
1013
|
-
};
|
|
1014
|
-
for (const obj of Object.values(objects)) {
|
|
1015
|
-
if (isRecord(obj) && obj.isa === "PBXProject" && typeof obj.buildConfigurationList === "string") {
|
|
1016
|
-
const listObj = objects[obj.buildConfigurationList];
|
|
1017
|
-
if (isRecord(listObj) && Array.isArray(listObj.buildConfigurations)) {
|
|
1018
|
-
for (const configId of listObj.buildConfigurations) {
|
|
1019
|
-
if (typeof configId === "string") {
|
|
1020
|
-
const configObj = objects[configId];
|
|
1021
|
-
if (isRecord(configObj) && configObj.name === "Release" && isRecord(configObj.buildSettings)) {
|
|
1022
|
-
for (const [k, v] of Object.entries(configObj.buildSettings)) {
|
|
1023
|
-
if (typeof v === "string") settings[k] = v;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
if (selectedTarget?.buildConfigurationList) {
|
|
1032
|
-
const listObj = objects[selectedTarget.buildConfigurationList];
|
|
1033
|
-
if (isRecord(listObj) && Array.isArray(listObj.buildConfigurations)) {
|
|
1034
|
-
for (const configId of listObj.buildConfigurations) {
|
|
1035
|
-
if (typeof configId === "string") {
|
|
1036
|
-
const configObj = objects[configId];
|
|
1037
|
-
if (isRecord(configObj) && configObj.name === "Release" && isRecord(configObj.buildSettings)) {
|
|
1038
|
-
for (const [k, v] of Object.entries(configObj.buildSettings)) {
|
|
1039
|
-
if (typeof v === "string") settings[k] = v;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
} else {
|
|
1046
|
-
const legacy = appTargetReleaseSettings(
|
|
1047
|
-
pbxproj,
|
|
1048
|
-
targetName,
|
|
1049
|
-
`${targetName}/Info.plist`
|
|
1050
|
-
);
|
|
1051
|
-
if (legacy) Object.assign(settings, legacy);
|
|
1052
|
-
}
|
|
1053
|
-
let plist;
|
|
1054
|
-
const infoPlistPath = settings.INFOPLIST_FILE;
|
|
1055
|
-
if (infoPlistPath) {
|
|
1056
|
-
const normalized = infoPlistPath.replace(/^"|"$/g, "");
|
|
1057
|
-
plist = files[`ios/${normalized}`] ?? files[normalized] ?? Object.entries(files).find(([k]) => k.endsWith(`/${normalized}`))?.[1];
|
|
1058
|
-
}
|
|
1059
|
-
if (!plist) {
|
|
1060
|
-
plist = files[`ios/${targetName}/Info.plist`] ?? files[`${targetName}/Info.plist`] ?? Object.entries(files).find(([k]) => k.endsWith(`/${targetName}/Info.plist`))?.[1];
|
|
1061
|
-
}
|
|
1062
|
-
if (!plist) return null;
|
|
1063
|
-
const bundleIdentifier = identityFieldFrom(
|
|
1064
|
-
settings,
|
|
1065
|
-
plistString(plist, "CFBundleIdentifier"),
|
|
1066
|
-
settings.PRODUCT_BUNDLE_IDENTIFIER
|
|
1067
|
-
);
|
|
1068
|
-
if (!bundleIdentifier) return null;
|
|
1069
|
-
const appVersion = identityFieldFrom(
|
|
1070
|
-
settings,
|
|
1071
|
-
plistString(plist, "CFBundleShortVersionString"),
|
|
1072
|
-
settings.MARKETING_VERSION
|
|
1073
|
-
);
|
|
1074
|
-
const buildVersion = identityFieldFrom(
|
|
1075
|
-
settings,
|
|
1076
|
-
plistString(plist, "CFBundleVersion"),
|
|
1077
|
-
settings.CURRENT_PROJECT_VERSION
|
|
1078
|
-
);
|
|
1079
|
-
if (!appVersion || !buildVersion) return null;
|
|
1080
|
-
const bundleName = identityFieldFrom(
|
|
1081
|
-
settings,
|
|
1082
|
-
plistString(plist, "CFBundleName"),
|
|
1083
|
-
settings.PRODUCT_NAME
|
|
1084
|
-
) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(targetName);
|
|
1085
|
-
if (!bundleName) return null;
|
|
1086
|
-
const applicationName = identityFieldFrom(settings, plistString(plist, "CFBundleDisplayName"), void 0) ?? bundleName;
|
|
1087
|
-
const dictionary = parseInfoPlist(plist);
|
|
1088
|
-
if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
|
|
1089
|
-
let keychainAccessGroups;
|
|
1090
|
-
if (settings.CODE_SIGN_ENTITLEMENTS) {
|
|
1091
|
-
const entitlementPath = resolveBuildSetting(settings.CODE_SIGN_ENTITLEMENTS, settings);
|
|
1092
|
-
if (!entitlementPath)
|
|
1093
|
-
throw new Error("CODE_SIGN_ENTITLEMENTS has unresolved build settings");
|
|
1094
|
-
const source = files[`ios/${entitlementPath}`] ?? files[entitlementPath];
|
|
1095
|
-
if (source === void 0)
|
|
1096
|
-
throw new Error(`missing selected entitlement input ${entitlementPath}`);
|
|
1097
|
-
keychainAccessGroups = readKeychainAccessGroups(
|
|
1098
|
-
parseInfoPlist(source),
|
|
1099
|
-
(value) => resolveBuildSetting(value, settings)
|
|
1100
|
-
);
|
|
1101
|
-
}
|
|
1102
|
-
const declaredDisplayName = dictionary.CFBundleDisplayName;
|
|
1103
|
-
const applicationDisplayName = typeof declaredDisplayName === "string" ? resolveBuildSetting(declaredDisplayName, settings) : void 0;
|
|
1104
|
-
if (applicationDisplayName === null)
|
|
1105
|
-
throw new Error("native app Info.plist CFBundleDisplayName is unresolved");
|
|
1106
|
-
const declaredBackgroundColor = dictionary.RCTRootViewBackgroundColor;
|
|
1107
|
-
const rootViewBackgroundColor = typeof declaredBackgroundColor === "number" && Number.isInteger(declaredBackgroundColor) ? declaredBackgroundColor : void 0;
|
|
1108
|
-
const designRequiresCompatibility = dictionary.UIDesignRequiresCompatibility === true;
|
|
1109
|
-
const declaredPlatformVersion = dictionary.DTPlatformVersion;
|
|
1110
|
-
const dtPlatformVersion = typeof declaredPlatformVersion === "string" ? resolveBuildSetting(declaredPlatformVersion, settings) : void 0;
|
|
1111
|
-
if (dtPlatformVersion === null)
|
|
1112
|
-
throw new Error("native app Info.plist DTPlatformVersion is unresolved");
|
|
1113
|
-
const icons = dictionary.CFBundleIcons;
|
|
1114
|
-
const alternates = isRecord(icons) ? icons.CFBundleAlternateIcons : void 0;
|
|
1115
|
-
const alternateIconNames = /* @__PURE__ */ new Set();
|
|
1116
|
-
for (const name of isRecord(alternates) ? Object.keys(alternates) : []) {
|
|
1117
|
-
const resolved = resolveBuildSetting(name, settings);
|
|
1118
|
-
if (resolved === null) throw new Error("native alternate icon name is unresolved");
|
|
1119
|
-
alternateIconNames.add(resolved);
|
|
1120
|
-
}
|
|
1121
|
-
const alternateSetting = resolveBuildSetting(
|
|
1122
|
-
settings.ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES ?? "",
|
|
1123
|
-
settings
|
|
1124
|
-
);
|
|
1125
|
-
if (alternateSetting === null)
|
|
1126
|
-
throw new Error("native alternate icon setting is unresolved");
|
|
1127
|
-
const catalogAlternateNames = [];
|
|
1128
|
-
for (const match of alternateSetting.replace(/\\"/g, '"').matchAll(/"([^"]*)"|([^\s(),]+)/g)) {
|
|
1129
|
-
const name = match[1] ?? match[2];
|
|
1130
|
-
alternateIconNames.add(name);
|
|
1131
|
-
catalogAlternateNames.push(name);
|
|
1132
|
-
}
|
|
1133
|
-
const intentIds = dictionary.OneAppIntentIdentifiers;
|
|
1134
|
-
const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((value) => typeof value === "string") ? intentIds.map((value) => resolveBuildSetting(value, settings)) : [];
|
|
1135
|
-
const backgroundIds = dictionary.BGTaskSchedulerPermittedIdentifiers;
|
|
1136
|
-
const backgroundTaskIdentifiers = Array.isArray(backgroundIds) && backgroundIds.every((value) => typeof value === "string") ? backgroundIds.map((value) => resolveBuildSetting(value, settings)) : [];
|
|
1137
|
-
const declaredModes = dictionary.UIBackgroundModes;
|
|
1138
|
-
const backgroundModes = Array.isArray(declaredModes) && declaredModes.every((value) => typeof value === "string") ? declaredModes.map((value) => resolveBuildSetting(value, settings)) : [];
|
|
1139
|
-
const screenOrientationLists = [
|
|
1140
|
-
"UISupportedInterfaceOrientations",
|
|
1141
|
-
"UISupportedInterfaceOrientations~ipad"
|
|
1142
|
-
].map((key) => {
|
|
1143
|
-
const list2 = dictionary[key];
|
|
1144
|
-
if (!Array.isArray(list2) || !list2.every((value) => typeof value === "string"))
|
|
1145
|
-
return [];
|
|
1146
|
-
return list2.map((value) => {
|
|
1147
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1148
|
-
if (resolved === null) throw new Error(`native app Info.plist ${key} is unresolved`);
|
|
1149
|
-
return resolved;
|
|
1150
|
-
});
|
|
1151
|
-
});
|
|
1152
|
-
const [supportedInterfaceOrientations, ipadSupportedInterfaceOrientations] = screenOrientationLists;
|
|
1153
|
-
const declaredDefaultOrientationMask = dictionary.EXDefaultScreenOrientationMask;
|
|
1154
|
-
const defaultScreenOrientationMask = typeof declaredDefaultOrientationMask === "string" ? resolveBuildSetting(declaredDefaultOrientationMask, settings) : void 0;
|
|
1155
|
-
if (defaultScreenOrientationMask === null)
|
|
1156
|
-
throw new Error("native app Info.plist EXDefaultScreenOrientationMask is unresolved");
|
|
1157
|
-
const declaredShareGroup = dictionary.ExpoShareIntoAppGroupId;
|
|
1158
|
-
const shareIntoAppGroupId = typeof declaredShareGroup === "string" ? resolveBuildSetting(declaredShareGroup, settings) : void 0;
|
|
1159
|
-
if (shareIntoAppGroupId === null)
|
|
1160
|
-
throw new Error("native app Info.plist ExpoShareIntoAppGroupId is unresolved");
|
|
1161
|
-
const declaredRtcGroup = dictionary.RTCAppGroupIdentifier;
|
|
1162
|
-
const rtcAppGroupIdentifier = typeof declaredRtcGroup === "string" ? resolveBuildSetting(declaredRtcGroup, settings) : void 0;
|
|
1163
|
-
if (rtcAppGroupIdentifier === null)
|
|
1164
|
-
throw new Error("native app Info.plist RTCAppGroupIdentifier is unresolved");
|
|
1165
|
-
const declaredScreenShareExtension = dictionary.ScreenShareExtensionBundleId;
|
|
1166
|
-
const screenShareExtensionBundleId = typeof declaredScreenShareExtension === "string" ? resolveBuildSetting(declaredScreenShareExtension, settings) : void 0;
|
|
1167
|
-
if (screenShareExtensionBundleId === null)
|
|
1168
|
-
throw new Error("native app Info.plist ScreenShareExtensionBundleId is unresolved");
|
|
1169
|
-
const querySchemes = dictionary.LSApplicationQueriesSchemes;
|
|
1170
|
-
if (querySchemes !== void 0 && !Array.isArray(querySchemes)) {
|
|
1171
|
-
throw new Error("native app Info.plist LSApplicationQueriesSchemes is not an array");
|
|
1172
|
-
}
|
|
1173
|
-
const urlQuerySchemes = (querySchemes ?? []).map((value) => {
|
|
1174
|
-
if (typeof value !== "string") return value;
|
|
1175
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1176
|
-
if (resolved === null)
|
|
1177
|
-
throw new Error("native app Info.plist LSApplicationQueriesSchemes is unresolved");
|
|
1178
|
-
return resolved;
|
|
1179
|
-
});
|
|
1180
|
-
const permissionUsageDescriptions = {};
|
|
1181
|
-
for (const [key, value] of Object.entries(dictionary)) {
|
|
1182
|
-
if (!/^NS.*UsageDescription$/.test(key) && key !== "NSLocationTemporaryUsageDescriptionDictionary")
|
|
1183
|
-
continue;
|
|
1184
|
-
if (typeof value !== "string") {
|
|
1185
|
-
permissionUsageDescriptions[key] = value;
|
|
1186
|
-
continue;
|
|
1187
|
-
}
|
|
1188
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1189
|
-
if (resolved === null) throw new Error(`native app Info.plist ${key} is unresolved`);
|
|
1190
|
-
permissionUsageDescriptions[key] = resolved;
|
|
1191
|
-
}
|
|
1192
|
-
const infoPlistStrings = {};
|
|
1193
|
-
const infoPlistBooleans = {};
|
|
1194
|
-
for (const [key, value] of Object.entries(dictionary)) {
|
|
1195
|
-
if (typeof value === "boolean") infoPlistBooleans[key] = value;
|
|
1196
|
-
if (typeof value !== "string") continue;
|
|
1197
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1198
|
-
if (resolved !== null) infoPlistStrings[key] = resolved;
|
|
1199
|
-
}
|
|
1200
|
-
if (settings.GENERATE_INFOPLIST_FILE === "YES") {
|
|
1201
|
-
for (const [setting, value] of Object.entries(settings)) {
|
|
1202
|
-
if (!/^INFOPLIST_KEY_NS.*UsageDescription$/.test(setting)) continue;
|
|
1203
|
-
const key = setting.slice("INFOPLIST_KEY_".length);
|
|
1204
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1205
|
-
if (resolved === null)
|
|
1206
|
-
throw new Error(`native app build setting ${setting} is unresolved`);
|
|
1207
|
-
permissionUsageDescriptions[key] = resolved;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
const resources = /* @__PURE__ */ new Set();
|
|
1211
|
-
if (resourceUri) {
|
|
1212
|
-
if (!selectedTarget)
|
|
1213
|
-
throw new Error("native app icon target membership is unresolved");
|
|
1214
|
-
const join = (base, own) => {
|
|
1215
|
-
const segments = [];
|
|
1216
|
-
for (const segment of `${base}/${own}`.split("/")) {
|
|
1217
|
-
if (segment === "" || segment === ".") continue;
|
|
1218
|
-
if (segment === ".." && segments.length > 0 && segments.at(-1) !== "..")
|
|
1219
|
-
segments.pop();
|
|
1220
|
-
else segments.push(segment);
|
|
1221
|
-
}
|
|
1222
|
-
return `${base.startsWith("/") ? "/" : ""}${segments.join("/")}`;
|
|
1223
|
-
};
|
|
1224
|
-
const project = Object.values(objects).find(
|
|
1225
|
-
(object) => isRecord(object) && object.isa === "PBXProject"
|
|
1226
|
-
);
|
|
1227
|
-
const projectDir = join(
|
|
1228
|
-
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
1229
|
-
isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
|
|
1230
|
-
);
|
|
1231
|
-
const paths = Object.keys(files);
|
|
1232
|
-
xcodeTargetMemberVisitor(objects)(
|
|
1233
|
-
selectedTarget.id,
|
|
1234
|
-
xcodePathResolver(objects, projectDir, join),
|
|
1235
|
-
(file) => {
|
|
1236
|
-
if (Object.hasOwn(files, file)) return [file];
|
|
1237
|
-
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
1238
|
-
return paths.filter(
|
|
1239
|
-
(path) => path.startsWith(prefix) && !/(?:^|\/)\./.test(path.slice(prefix.length))
|
|
1240
|
-
);
|
|
1241
|
-
},
|
|
1242
|
-
join,
|
|
1243
|
-
(file, kind) => {
|
|
1244
|
-
if (kind === "resource") resources.add(file);
|
|
1245
|
-
}
|
|
1246
|
-
);
|
|
1247
|
-
}
|
|
1248
|
-
const rootModuleName = readRootModuleName(
|
|
1249
|
-
Object.entries(files).filter(
|
|
1250
|
-
([path]) => !path.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path) || path.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
1251
|
-
).map(([, source]) => source)
|
|
1252
|
-
);
|
|
1253
|
-
return {
|
|
1254
|
-
applicationName,
|
|
1255
|
-
...applicationDisplayName === void 0 ? {} : { applicationDisplayName },
|
|
1256
|
-
...rootModuleName === void 0 ? {} : { rootModuleName },
|
|
1257
|
-
...rootViewBackgroundColor === void 0 ? {} : { rootViewBackgroundColor },
|
|
1258
|
-
...designRequiresCompatibility ? { designRequiresCompatibility } : {},
|
|
1259
|
-
...typeof dictionary.UIStatusBarHidden === "boolean" ? { statusBarHidden: dictionary.UIStatusBarHidden } : {},
|
|
1260
|
-
...typeof dictionary.UIViewControllerBasedStatusBarAppearance === "boolean" ? {
|
|
1261
|
-
viewControllerBasedStatusBarAppearance: dictionary.UIViewControllerBasedStatusBarAppearance
|
|
1262
|
-
} : {},
|
|
1263
|
-
sceneManifest: isRecord(dictionary.UIApplicationSceneManifest) ? resolvePlistStrings(dictionary.UIApplicationSceneManifest, settings) : null,
|
|
1264
|
-
...dtPlatformVersion === void 0 ? {} : { dtPlatformVersion },
|
|
1265
|
-
bundleName,
|
|
1266
|
-
appVersion,
|
|
1267
|
-
buildVersion,
|
|
1268
|
-
bundleIdentifier,
|
|
1269
|
-
platform: "ios",
|
|
1270
|
-
googleSignIn: readGoogleSignInConfiguration(
|
|
1271
|
-
dictionary,
|
|
1272
|
-
Object.fromEntries(
|
|
1273
|
-
[...resources].filter((file) => file.endsWith(".plist") && files[file]).map((file) => [file, parseInfoPlist(files[file])])
|
|
1274
|
-
)
|
|
1275
|
-
),
|
|
1276
|
-
supportedInterfaceOrientations,
|
|
1277
|
-
ipadSupportedInterfaceOrientations,
|
|
1278
|
-
...defaultScreenOrientationMask === void 0 ? {} : { defaultScreenOrientationMask },
|
|
1279
|
-
alternateIconNames: [...alternateIconNames],
|
|
1280
|
-
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => {
|
|
1281
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1282
|
-
if (resolved === null) throw new Error("native bundle icon reference is unresolved");
|
|
1283
|
-
return resolved;
|
|
1284
|
-
}),
|
|
1285
|
-
...resourceUri ? {
|
|
1286
|
-
appIconArtwork: resolveNativeAppIconArtwork(
|
|
1287
|
-
[...resources],
|
|
1288
|
-
(file) => files[file] ?? null,
|
|
1289
|
-
resourceUri,
|
|
1290
|
-
icons,
|
|
1291
|
-
settings.ASSETCATALOG_COMPILER_APPICON_NAME ?? "",
|
|
1292
|
-
[...alternateIconNames],
|
|
1293
|
-
(value) => {
|
|
1294
|
-
const resolved = resolveBuildSetting(value, settings);
|
|
1295
|
-
if (resolved === null)
|
|
1296
|
-
throw new Error("native app icon reference is unresolved");
|
|
1297
|
-
return resolved;
|
|
1298
|
-
}
|
|
1299
|
-
)
|
|
1300
|
-
} : {},
|
|
1301
|
-
permissionUsageDescriptions,
|
|
1302
|
-
infoPlistStrings,
|
|
1303
|
-
infoPlistBooleans,
|
|
1304
|
-
urlQuerySchemes,
|
|
1305
|
-
...keychainAccessGroups === void 0 ? {} : { keychainAccessGroups },
|
|
1306
|
-
...shareIntoAppGroupId === void 0 ? {} : { shareIntoAppGroupId },
|
|
1307
|
-
...rtcAppGroupIdentifier === void 0 ? {} : { rtcAppGroupIdentifier },
|
|
1308
|
-
...screenShareExtensionBundleId === void 0 ? {} : { screenShareExtensionBundleId },
|
|
1309
|
-
backgroundTaskIdentifiers: backgroundTaskIdentifiers.every((value) => value !== null) ? backgroundTaskIdentifiers : [],
|
|
1310
|
-
backgroundModes: backgroundModes.every((value) => value !== null) ? backgroundModes : [],
|
|
1311
|
-
appIntentIdentifiers: appIntentIdentifiers.every((value) => value !== null) ? appIntentIdentifiers : []
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
var ROOT_MODULE_NAME_RE = /(?:\bm|M)oduleName\s*[:=]\s*@?"([^"\\]+)"/g;
|
|
1315
|
-
function readRootModuleName(sources) {
|
|
1316
|
-
const names = /* @__PURE__ */ new Set();
|
|
1317
|
-
for (const source of sources) {
|
|
1318
|
-
for (const match of source.matchAll(ROOT_MODULE_NAME_RE)) names.add(match[1]);
|
|
1319
|
-
}
|
|
1320
|
-
return names.size === 1 ? [...names][0] : void 0;
|
|
1321
|
-
}
|
|
1322
|
-
function canExtractNativeAppIdentity(platform) {
|
|
1323
|
-
return platform === "ios" || platform === "android";
|
|
1324
|
-
}
|
|
1325
|
-
function selectNativeAppIdentityReader(platform, readers) {
|
|
1326
|
-
return canExtractNativeAppIdentity(platform) ? readers[platform] : null;
|
|
1327
|
-
}
|
|
1328
|
-
function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosTarget, resourceUri, androidMergedManifest) {
|
|
1329
|
-
if (platform === "android") {
|
|
1330
|
-
const candidates = androidMergedManifest ? [androidMergedManifest] : Object.keys(files).filter(
|
|
1331
|
-
(file) => /^android\/[^/]+\/build\/intermediates\/merged_manifests\/.+\/AndroidManifest\.xml$/.test(
|
|
1332
|
-
file
|
|
1333
|
-
)
|
|
1334
|
-
);
|
|
1335
|
-
if (candidates.length !== 1) return null;
|
|
1336
|
-
const source = files[candidates[0]];
|
|
1337
|
-
return source === void 0 ? null : nativeAppIdentityFromAndroidManifest(source, candidates[0], files);
|
|
1338
|
-
}
|
|
1339
|
-
return platform === "ios" ? nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) : null;
|
|
1340
|
-
}
|
|
1
|
+
/*! peach v0.1.2439 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
NATIVE_APP_IDENTITY_HEADER,
|
|
4
|
+
applyNativeAppIdentity,
|
|
5
|
+
applyNativeRootModuleName,
|
|
6
|
+
canExtractNativeAppIdentity,
|
|
7
|
+
createNativeAppIdentityFooter,
|
|
8
|
+
createNativeAppIdentityHeader,
|
|
9
|
+
detachNativeAppIdentityFooter,
|
|
10
|
+
extractNativeAppIdentityFromFiles,
|
|
11
|
+
getAppliedNativeAppIdentity,
|
|
12
|
+
getNativeRootModuleName,
|
|
13
|
+
insertNativeAppIdentityFooter,
|
|
14
|
+
isNativeAppIdentity,
|
|
15
|
+
readGoogleSignInConfiguration,
|
|
16
|
+
readKeychainAccessGroups,
|
|
17
|
+
readNativeAppIdentity,
|
|
18
|
+
readNativeAppIdentityFooter,
|
|
19
|
+
readNativeAppIdentityFromBundle,
|
|
20
|
+
readNativeAppIdentityHeader,
|
|
21
|
+
readRootModuleName,
|
|
22
|
+
selectNativeAppIdentityReader
|
|
23
|
+
} from "./esm-chunks/chunk-5T4XBUJP.mjs";
|
|
24
|
+
import "./esm-chunks/chunk-DEGYKHN7.mjs";
|
|
25
|
+
import "./esm-chunks/chunk-CVGDRROP.mjs";
|
|
26
|
+
import "./esm-chunks/chunk-JCKI3VZ6.mjs";
|
|
27
|
+
import "./esm-chunks/chunk-IWJUYJQO.mjs";
|
|
1341
28
|
export {
|
|
1342
29
|
NATIVE_APP_IDENTITY_HEADER,
|
|
1343
30
|
applyNativeAppIdentity,
|