vxrn 2.0.0-beta.60.1 → 2.0.0-beta.65.1
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/dist/exports/prebuildWithoutExpo.mjs +43 -61
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +56 -94
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/package.json +11 -11
- package/src/exports/prebuildWithoutExpo.test.ts +75 -9
- package/src/exports/prebuildWithoutExpo.ts +68 -140
- package/types/exports/prebuildWithoutExpo.d.ts +6 -34
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
|
@@ -2,17 +2,12 @@ import { execFileSync } from "node:child_process";
|
|
|
2
2
|
import module from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { validateNativeApp } from "@vxrn/utils/nativeAppManifest";
|
|
5
6
|
import FSExtra from "fs-extra";
|
|
6
7
|
import sharp from "sharp";
|
|
7
8
|
|
|
8
9
|
const nativeProjectPatches = module.createRequire(import.meta.url)("../../native-project-patches.cjs");
|
|
9
|
-
const
|
|
10
|
-
const SCHEME = /^[a-z][a-z0-9+.-]*$/i;
|
|
11
|
-
const VERSION = /^\d+\.\d+\.\d+/;
|
|
12
|
-
const BUILD_NUMBER = /^[A-Za-z0-9.]+$/;
|
|
13
|
-
const REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\.[A-Za-z][A-Za-z0-9-]*)+$/;
|
|
14
|
-
const DEPLOYMENT_TARGET = /^\d+\.\d+$/;
|
|
15
|
-
const HEX_COLOR = /^#[\da-f]{6}$/i;
|
|
10
|
+
const validatePrebuildApp = validateNativeApp;
|
|
16
11
|
const ANDROID_DENSITIES = {
|
|
17
12
|
mdpi: 1,
|
|
18
13
|
hdpi: 1.5,
|
|
@@ -50,6 +45,9 @@ function patchIosBundlePhase(project) {
|
|
|
50
45
|
}
|
|
51
46
|
return patchedProject;
|
|
52
47
|
}
|
|
48
|
+
function escapeXml(value) {
|
|
49
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
50
|
+
}
|
|
53
51
|
const SCENE_DELEGATE_FILE_REF_ID = "1A2B3C4D5E6F7A8B9C0D1E2F";
|
|
54
52
|
const SCENE_DELEGATE_BUILD_FILE_ID = "2B3C4D5E6F7A8B9C0D1E2F1A";
|
|
55
53
|
function renderSceneDelegateSwift(appName) {
|
|
@@ -219,52 +217,6 @@ function generateSceneDelegate(args) {
|
|
|
219
217
|
if (platform !== "ios") return;
|
|
220
218
|
FSExtra.writeFileSync(path.join(dest, app.name, "SceneDelegate.swift"), renderSceneDelegateSwift(app.name));
|
|
221
219
|
}
|
|
222
|
-
function fail(message) {
|
|
223
|
-
throw new Error(`[vxrn] invalid native.app: ${message}`);
|
|
224
|
-
}
|
|
225
|
-
function validatePrebuildApp(app, platform) {
|
|
226
|
-
if (!app || typeof app !== "object") fail("manifest must be an object");
|
|
227
|
-
if (!app.name || !TARGET_NAME.test(app.name)) {
|
|
228
|
-
fail(`name "${app?.name}" must start with a letter and contain only letters, digits, and underscore`);
|
|
229
|
-
}
|
|
230
|
-
const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];
|
|
231
|
-
for (const scheme of schemes) {
|
|
232
|
-
if (typeof scheme !== "string" || !SCHEME.test(scheme)) {
|
|
233
|
-
fail(`scheme "${scheme}" must be a valid uri scheme`);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (app.icon !== void 0 && (!app.icon.source || !HEX_COLOR.test(app.icon.backgroundColor))) {
|
|
237
|
-
fail("icon requires source and a six-digit hex backgroundColor");
|
|
238
|
-
}
|
|
239
|
-
if (app.splash !== void 0 && (!app.splash.source || !HEX_COLOR.test(app.splash.backgroundColor) || app.splash.width !== void 0 && (!Number.isFinite(app.splash.width) || app.splash.width < 1 || app.splash.width > 288))) {
|
|
240
|
-
fail("splash requires source, a six-digit hex backgroundColor, and width from 1 to 288");
|
|
241
|
-
}
|
|
242
|
-
if (app.version !== void 0 && !VERSION.test(app.version)) {
|
|
243
|
-
fail(`version "${app.version}" must start with major.minor.patch`);
|
|
244
|
-
}
|
|
245
|
-
if (!platform || platform === "ios") {
|
|
246
|
-
if (!app.ios?.bundleId || !REVERSE_DNS.test(app.ios.bundleId)) {
|
|
247
|
-
fail(`ios.bundleId "${app.ios?.bundleId}" must be reverse-dns`);
|
|
248
|
-
}
|
|
249
|
-
if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {
|
|
250
|
-
fail(`ios.deploymentTarget "${app.ios.deploymentTarget}" must look like "17.0"`);
|
|
251
|
-
}
|
|
252
|
-
if (app.ios.buildNumber !== void 0 && !BUILD_NUMBER.test(app.ios.buildNumber)) {
|
|
253
|
-
fail(`ios.buildNumber "${app.ios.buildNumber}" must contain only letters, digits, and dots`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (!platform || platform === "android") {
|
|
257
|
-
if (!app.android?.applicationId || !REVERSE_DNS.test(app.android.applicationId)) {
|
|
258
|
-
fail(`android.applicationId "${app.android?.applicationId}" must be reverse-dns`);
|
|
259
|
-
}
|
|
260
|
-
if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {
|
|
261
|
-
fail(`android.minSdk "${app.android.minSdk}" must be an integer from 21 to 36`);
|
|
262
|
-
}
|
|
263
|
-
if (app.android.versionCode !== void 0 && (!Number.isInteger(app.android.versionCode) || app.android.versionCode < 1)) {
|
|
264
|
-
fail(`android.versionCode "${app.android.versionCode}" must be a positive integer`);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
220
|
async function generateAppIcons(args) {
|
|
269
221
|
const { root, dest, platform, app } = args;
|
|
270
222
|
if (!app.icon) return;
|
|
@@ -452,8 +404,10 @@ function renderPrebuildFile(args) {
|
|
|
452
404
|
for (const [find, value] of replacements) {
|
|
453
405
|
rendered = rendered.split(find).join(value);
|
|
454
406
|
}
|
|
455
|
-
if (platform === "ios" && relativePath.endsWith("/Info.plist")
|
|
456
|
-
|
|
407
|
+
if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
|
|
408
|
+
const stamps = [];
|
|
409
|
+
if (schemes.length) {
|
|
410
|
+
stamps.push(` <key>CFBundleURLTypes</key>
|
|
457
411
|
<array>
|
|
458
412
|
<dict>
|
|
459
413
|
<key>CFBundleTypeRole</key>
|
|
@@ -463,8 +417,32 @@ function renderPrebuildFile(args) {
|
|
|
463
417
|
${schemes.map((scheme) => ` <string>${scheme}</string>`).join("\n")}
|
|
464
418
|
</array>
|
|
465
419
|
</dict>
|
|
466
|
-
</array
|
|
467
|
-
|
|
420
|
+
</array>`);
|
|
421
|
+
}
|
|
422
|
+
if (app.ios?.usesNonExemptEncryption !== void 0) {
|
|
423
|
+
stamps.push(` <key>ITSAppUsesNonExemptEncryption</key>
|
|
424
|
+
<${app.ios.usesNonExemptEncryption ? "true" : "false"}/>`);
|
|
425
|
+
}
|
|
426
|
+
if (app.ios?.fileSharing) {
|
|
427
|
+
stamps.push(` <key>UIFileSharingEnabled</key>
|
|
428
|
+
<true/>
|
|
429
|
+
<key>LSSupportsOpeningDocumentsInPlace</key>
|
|
430
|
+
<true/>`);
|
|
431
|
+
}
|
|
432
|
+
if (stamps.length) {
|
|
433
|
+
const anchor = " <key>LSRequiresIPhoneOS</key>";
|
|
434
|
+
if (!rendered.includes(anchor)) throw new Error(`[vxrn] prebuild template ${relativePath} lost its LSRequiresIPhoneOS anchor`);
|
|
435
|
+
rendered = rendered.replace(anchor, `${stamps.join("\n")}
|
|
436
|
+
${anchor}`);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.imagePicker?.camera !== void 0) {
|
|
440
|
+
const anchor = "<uses-permission android:name=\"android.permission.INTERNET\" />";
|
|
441
|
+
if (!rendered.includes(anchor)) {
|
|
442
|
+
throw new Error("[vxrn] cannot stamp the camera permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
|
|
443
|
+
}
|
|
444
|
+
rendered = rendered.replace(anchor, `${anchor}
|
|
445
|
+
<uses-permission android:name="android.permission.CAMERA" />`);
|
|
468
446
|
}
|
|
469
447
|
if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && schemes.length) {
|
|
470
448
|
rendered = rendered.replace(" </activity>", ` <intent-filter>
|
|
@@ -487,10 +465,14 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
|
|
|
487
465
|
}
|
|
488
466
|
}
|
|
489
467
|
if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
|
|
490
|
-
if (app.
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
468
|
+
if (app.imagePicker?.camera !== void 0) {
|
|
469
|
+
const anchor = " <key>LSRequiresIPhoneOS</key>";
|
|
470
|
+
if (!rendered.includes(anchor)) {
|
|
471
|
+
throw new Error("[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist");
|
|
472
|
+
}
|
|
473
|
+
rendered = rendered.replace(anchor, ` <key>NSCameraUsageDescription</key>
|
|
474
|
+
<string>${escapeXml(app.imagePicker.camera)}</string>
|
|
475
|
+
${anchor}`);
|
|
494
476
|
}
|
|
495
477
|
rendered = patchIosInfoPlistSceneManifest(rendered);
|
|
496
478
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuildWithoutExpo.js","names":[],"sources":["exports/prebuildWithoutExpo.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport module from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport FSExtra from \"fs-extra\";\nimport sharp from \"sharp\";\nconst nativeProjectPatches = module.createRequire(import.meta.url)(\n \"../../native-project-patches.cjs\"\n);\nconst TARGET_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;\nconst SCHEME = /^[a-z][a-z0-9+.-]*$/i;\nconst VERSION = /^\\d+\\.\\d+\\.\\d+/;\nconst BUILD_NUMBER = /^[A-Za-z0-9.]+$/;\nconst REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\\.[A-Za-z][A-Za-z0-9-]*)+$/;\nconst DEPLOYMENT_TARGET = /^\\d+\\.\\d+$/;\nconst HEX_COLOR = /^#[\\da-f]{6}$/i;\nconst ANDROID_DENSITIES = {\n mdpi: 1,\n hdpi: 1.5,\n xhdpi: 2,\n xxhdpi: 3,\n xxxhdpi: 4\n};\nconst IOS_BUNDLE_PLACEHOLDER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\nconst ANDROID_PACKAGE_PLACEHOLDER = \"com.helloworld\";\nconst ANDROID_PACKAGE_PATH = \"com/helloworld\";\nfunction patchIosBundlePhase(project) {\n let patchedBundlePhases = 0;\n const patchedProject = project.replace(\n /shellScript = (\"(?:\\\\.|[^\"\\\\])*\");/g,\n (assignment, serializedScript) => {\n let script;\n try {\n script = JSON.parse(serializedScript);\n } catch {\n return assignment;\n }\n if (typeof script !== \"string\" || !script.includes(\"react-native-xcode.sh\")) {\n return assignment;\n }\n let patched = script;\n patched = nativeProjectPatches.addSetCliPathToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addPodHermescToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addDepsPatchToBundleReactNativeShellScript(patched);\n if (!patched.includes(\"[vxrn/one] React Native now defaults CLI_PATH\") || !patched.includes(\"[vxrn/one] use the hermes-engine pod\") || !patched.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required iOS bundle phase patches\");\n }\n patchedBundlePhases++;\n return `shellScript = ${JSON.stringify(patched)};`;\n }\n );\n if (patchedBundlePhases !== 1) {\n throw new Error(\n `[vxrn] expected one iOS React Native bundle phase, found ${patchedBundlePhases}`\n );\n }\n return patchedProject;\n}\nconst SCENE_DELEGATE_FILE_REF_ID = \"1A2B3C4D5E6F7A8B9C0D1E2F\";\nconst SCENE_DELEGATE_BUILD_FILE_ID = \"2B3C4D5E6F7A8B9C0D1E2F1A\";\nfunction renderSceneDelegateSwift(appName) {\n return `import UIKit\nimport React\nimport React_RCTAppDelegate\nimport ReactAppDependencyProvider\n\n// owns the window and the react native root. with a scene manifest the\n// system creates this delegate per foreground scene instead of asking the\n// app delegate for a window, which is what the xcode 27 sdk requires.\nclass SceneDelegate: UIResponder, UIWindowSceneDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func scene(\n _ scene: UIScene,\n willConnectTo session: UISceneSession,\n options connectionOptions: UIScene.ConnectionOptions\n ) {\n guard let windowScene = scene as? UIWindowScene else { return }\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n let window = UIWindow(windowScene: windowScene)\n self.window = window\n\n // cold-start links arrive in connectionOptions under scenes, never in\n // the app launchOptions, so they are translated into the launchOptions\n // shape RCTLinkingManager.getInitialURL reads.\n var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]\n if let url = connectionOptions.urlContexts.first?.url {\n launchOptions[.url] = url\n }\n if let activity = connectionOptions.userActivities.first(where: {\n $0.activityType == NSUserActivityTypeBrowsingWeb\n }) {\n launchOptions[.userActivityDictionary] = [\n \"UIApplicationLaunchOptionsUserActivityTypeKey\": activity.activityType,\n \"UIApplicationLaunchOptionsUserActivityKey\": activity,\n ]\n }\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n }\n\n func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {\n guard let url = URLContexts.first?.url else { return }\n RCTLinkingManager.application(UIApplication.shared, open: url, options: [:])\n }\n\n func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {\n RCTLinkingManager.application(\n UIApplication.shared,\n continue: userActivity,\n restorationHandler: { _ in }\n )\n }\n}\n`;\n}\nfunction insertAfterLine(haystack, anchor, insertion) {\n const anchorIndex = haystack.indexOf(anchor);\n if (anchorIndex === -1) return haystack;\n const lineEnd = haystack.indexOf(\"\\n\", anchorIndex);\n if (lineEnd === -1) return `${haystack}\n${insertion}`;\n return `${haystack.slice(0, lineEnd + 1)}${insertion}\n${haystack.slice(lineEnd + 1)}`;\n}\nfunction patchIosInfoPlistSceneManifest(rendered) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor)) {\n throw new Error(\"[vxrn] prebuild template Info.plist lost its LSRequiresIPhoneOS anchor\");\n }\n return rendered.replace(\n anchor,\n `\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t\t<key>UISceneConfigurations</key>\n\t\t<dict>\n\t\t\t<key>UIWindowSceneSessionRoleApplication</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>UISceneConfigurationName</key>\n\t\t\t\t\t<string>Default Configuration</string>\n\t\t\t\t\t<key>UISceneDelegateClassName</key>\n\t\t\t\t\t<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t</dict>\n${anchor}`\n );\n}\nfunction patchIosAppDelegateSceneLifecycle(rendered, appName) {\n const anchor = `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n window = UIWindow(frame: UIScreen.main.bounds)\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n\n return true\n }\n}`;\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] prebuild template AppDelegate.swift changed shape: cannot move the RN root to the scene delegate\"\n );\n }\n return rendered.replace(\n anchor,\n `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n true\n }\n}`\n );\n}\nfunction patchIosPbxprojSceneDelegate(rendered, appName) {\n const edits = [\n [\n \"/* AppDelegate.swift in Sources */ = {isa = PBXBuildFile;\",\n `\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */; };`\n ],\n [\n \"/* AppDelegate.swift */ = {isa = PBXFileReference;\",\n `\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SceneDelegate.swift; path = ${appName}/SceneDelegate.swift; sourceTree = \"<group>\"; };`\n ],\n [\n \"/* AppDelegate.swift */,\",\n `\t\t\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */,`\n ],\n [\n \"/* AppDelegate.swift in Sources */,\",\n `\t\t\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */,`\n ]\n ];\n let patched = rendered;\n for (const [anchor, insertion] of edits) {\n const next = insertAfterLine(patched, anchor, insertion);\n if (next === patched) {\n throw new Error(\n `[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`\n );\n }\n patched = next;\n }\n return patched;\n}\nfunction generateSceneDelegate(args) {\n const { dest, platform, app } = args;\n if (platform !== \"ios\") return;\n FSExtra.writeFileSync(\n path.join(dest, app.name, \"SceneDelegate.swift\"),\n renderSceneDelegateSwift(app.name)\n );\n}\nfunction fail(message) {\n throw new Error(`[vxrn] invalid native.app: ${message}`);\n}\nfunction validatePrebuildApp(app, platform) {\n if (!app || typeof app !== \"object\") fail(\"manifest must be an object\");\n if (!app.name || !TARGET_NAME.test(app.name)) {\n fail(\n `name \"${app?.name}\" must start with a letter and contain only letters, digits, and underscore`\n );\n }\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n for (const scheme of schemes) {\n if (typeof scheme !== \"string\" || !SCHEME.test(scheme)) {\n fail(`scheme \"${scheme}\" must be a valid uri scheme`);\n }\n }\n if (app.icon !== void 0 && (!app.icon.source || !HEX_COLOR.test(app.icon.backgroundColor))) {\n fail(\"icon requires source and a six-digit hex backgroundColor\");\n }\n if (app.splash !== void 0 && (!app.splash.source || !HEX_COLOR.test(app.splash.backgroundColor) || app.splash.width !== void 0 && (!Number.isFinite(app.splash.width) || app.splash.width < 1 || app.splash.width > 288))) {\n fail(\n \"splash requires source, a six-digit hex backgroundColor, and width from 1 to 288\"\n );\n }\n if (app.version !== void 0 && !VERSION.test(app.version)) {\n fail(`version \"${app.version}\" must start with major.minor.patch`);\n }\n if (!platform || platform === \"ios\") {\n if (!app.ios?.bundleId || !REVERSE_DNS.test(app.ios.bundleId)) {\n fail(`ios.bundleId \"${app.ios?.bundleId}\" must be reverse-dns`);\n }\n if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {\n fail(`ios.deploymentTarget \"${app.ios.deploymentTarget}\" must look like \"17.0\"`);\n }\n if (app.ios.buildNumber !== void 0 && !BUILD_NUMBER.test(app.ios.buildNumber)) {\n fail(\n `ios.buildNumber \"${app.ios.buildNumber}\" must contain only letters, digits, and dots`\n );\n }\n }\n if (!platform || platform === \"android\") {\n if (!app.android?.applicationId || !REVERSE_DNS.test(app.android.applicationId)) {\n fail(`android.applicationId \"${app.android?.applicationId}\" must be reverse-dns`);\n }\n if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {\n fail(`android.minSdk \"${app.android.minSdk}\" must be an integer from 21 to 36`);\n }\n if (app.android.versionCode !== void 0 && (!Number.isInteger(app.android.versionCode) || app.android.versionCode < 1)) {\n fail(\n `android.versionCode \"${app.android.versionCode}\" must be a positive integer`\n );\n }\n }\n}\nasync function generateAppIcons(args) {\n const { root, dest, platform, app } = args;\n if (!app.icon) return;\n const source = path.resolve(root, app.icon.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.icon source does not exist: ${source}`);\n }\n const metadata = await sharp(source).metadata();\n if (metadata.width === void 0 || metadata.height === void 0 || metadata.width !== metadata.height || metadata.width < 1024) {\n throw new Error(\n \"[vxrn] native.app.icon source must be a square image at least 1024px wide\"\n );\n }\n if (platform === \"ios\") {\n const iconDir = path.join(dest, app.name, \"Images.xcassets\", \"AppIcon.appiconset\");\n const contentsPath = path.join(iconDir, \"Contents.json\");\n const contents = JSON.parse(FSExtra.readFileSync(contentsPath, \"utf8\"));\n for (const image of contents.images) {\n const points = Number.parseFloat(image.size.split(\"x\")[0]);\n const scale = Number.parseInt(image.scale, 10);\n const pixels = points * scale;\n const filename = image.idiom === \"ios-marketing\" ? \"icon-1024.png\" : `icon-${points}@${image.scale}.png`;\n image.filename = filename;\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n FSExtra.writeFileSync(contentsPath, `${JSON.stringify(contents, null, 2)}\n`);\n return;\n }\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const pixels = 48 * multiplier;\n const iconDir = path.join(dest, \"app\", \"src\", \"main\", \"res\", `mipmap-${density}`);\n for (const filename of [\"ic_launcher.png\", \"ic_launcher_round.png\"]) {\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n }\n}\nasync function generateSplashScreen(args) {\n const { root, dest, platform, app } = args;\n if (!app.splash) return;\n const source = path.resolve(root, app.splash.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.splash source does not exist: ${source}`);\n }\n const { data: artwork, info: metadata } = await sharp(source).rotate().trim({ background: app.splash.backgroundColor }).png().toBuffer({ resolveWithObject: true });\n if (!metadata.width || !metadata.height) {\n throw new Error(\"[vxrn] native.app.splash source must be an image\");\n }\n const artworkWidth = app.splash.width ?? 200;\n const artworkHeight = Number(\n (artworkWidth * (metadata.height / metadata.width)).toFixed(3)\n );\n if (platform === \"ios\") {\n const appDir = path.join(dest, app.name);\n const splashDir = path.join(appDir, \"Images.xcassets\", \"Splash.imageset\");\n FSExtra.mkdirSync(splashDir, { recursive: true });\n await sharp(artwork).toFile(path.join(splashDir, \"splash.png\"));\n FSExtra.writeFileSync(\n path.join(splashDir, \"Contents.json\"),\n `${JSON.stringify(\n {\n images: [{ filename: \"splash.png\", idiom: \"universal\", scale: \"1x\" }],\n info: { author: \"xcode\", version: 1 }\n },\n null,\n 2\n )}\n`\n );\n const red = Number.parseInt(app.splash.backgroundColor.slice(1, 3), 16) / 255;\n const green = Number.parseInt(app.splash.backgroundColor.slice(3, 5), 16) / 255;\n const blue = Number.parseInt(app.splash.backgroundColor.slice(5, 7), 16) / 255;\n FSExtra.writeFileSync(\n path.join(appDir, \"LaunchScreen.storyboard\"),\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"launch-controller\">\n <device id=\"retina6_12\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"launch-scene\">\n <objects>\n <viewController id=\"launch-controller\" sceneMemberID=\"viewController\">\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"launch-view\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"390\" height=\"844\"/>\n <subviews>\n <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" image=\"Splash\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"splash-image\"/>\n </subviews>\n <color key=\"backgroundColor\" red=\"${red}\" green=\"${green}\" blue=\"${blue}\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n <constraints>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerX\" secondItem=\"launch-view\" secondAttribute=\"centerX\" id=\"splash-center-x\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerY\" secondItem=\"launch-view\" secondAttribute=\"centerY\" id=\"splash-center-y\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"width\" constant=\"${artworkWidth}\" id=\"splash-width\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"height\" constant=\"${artworkHeight}\" id=\"splash-height\"/>\n </constraints>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"launch-responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"Splash\" width=\"${metadata.width}\" height=\"${metadata.height}\"/>\n </resources>\n</document>\n`\n );\n return;\n }\n const mainRes = path.join(dest, \"app\", \"src\", \"main\", \"res\");\n const drawable = path.join(mainRes, \"drawable\");\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const canvasSize = 288 * multiplier;\n const imageSize = Math.round(artworkWidth * multiplier);\n const contained = await sharp(artwork).resize(imageSize, imageSize, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }).png().toBuffer();\n const drawableDensity = path.join(mainRes, `drawable-${density}`);\n FSExtra.mkdirSync(drawableDensity, { recursive: true });\n await sharp({\n create: {\n width: canvasSize,\n height: canvasSize,\n channels: 4,\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }\n }).composite([\n {\n input: contained,\n left: Math.round((canvasSize - imageSize) / 2),\n top: Math.round((canvasSize - imageSize) / 2)\n }\n ]).png().toFile(path.join(drawableDensity, \"splash.png\"));\n }\n FSExtra.writeFileSync(\n path.join(drawable, \"launch_screen.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:drawable=\"@color/splash_background\" />\n <item>\n <bitmap android:gravity=\"center\" android:src=\"@drawable/splash\" />\n </item>\n</layer-list>\n`\n );\n FSExtra.writeFileSync(\n path.join(mainRes, \"values\", \"colors.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"splash_background\">${app.splash.backgroundColor}</color>\n</resources>\n`\n );\n const stylesPath = path.join(mainRes, \"values\", \"styles.xml\");\n const styles = FSExtra.readFileSync(stylesPath, \"utf8\").replace(\n \" <!-- Customize your theme here. -->\",\n ' <item name=\"android:windowBackground\">@drawable/launch_screen</item>'\n );\n FSExtra.writeFileSync(stylesPath, styles);\n const stylesV31 = path.join(mainRes, \"values-v31\");\n FSExtra.mkdirSync(stylesV31, { recursive: true });\n FSExtra.writeFileSync(\n path.join(stylesV31, \"styles.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\">\n <item name=\"android:windowSplashScreenBackground\">@color/splash_background</item>\n <item name=\"android:windowSplashScreenAnimatedIcon\">@drawable/splash</item>\n </style>\n</resources>\n`\n );\n}\nfunction renderPrebuildFile(args) {\n const { relativePath, content, platform, app } = args;\n const appName = app.name;\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n let destRelativePath = transformPath(relativePath);\n if (platform === \"android\" && app.android) {\n const packagePath = app.android.applicationId.split(\".\").join(\"/\");\n destRelativePath = destRelativePath.split(ANDROID_PACKAGE_PATH).join(packagePath);\n }\n destRelativePath = destRelativePath.replace(/HelloWorld/g, appName).replace(/helloworld/g, appName.toLowerCase());\n let rendered = content;\n if (rendered !== null) {\n const replacements = [];\n if (platform === \"ios\" && app.ios) {\n replacements.push([IOS_BUNDLE_PLACEHOLDER, app.ios.bundleId]);\n }\n if (platform === \"android\" && app.android) {\n replacements.push([ANDROID_PACKAGE_PLACEHOLDER, app.android.applicationId]);\n }\n replacements.push(\n [\"Hello App Display Name\", app.displayName || appName],\n [\"HelloWorld\", appName],\n [\"helloworld\", appName.toLowerCase()]\n );\n for (const [find, value] of replacements) {\n rendered = rendered.split(find).join(value);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\") && schemes.length) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n${schemes.map((scheme) => `\t\t\t\t<string>${scheme}</string>`).join(\"\\n\")}\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && schemes.length) {\n rendered = rendered.replace(\n \" </activity>\",\n ` <intent-filter>\n <action android:name=\"android.intent.action.VIEW\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <category android:name=\"android.intent.category.BROWSABLE\" />\n${schemes.map((scheme) => ` <data android:scheme=\"${scheme}\" />`).join(\"\\n\")}\n </intent-filter>\n </activity>`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = rendered.replace(\n /TARGETED_DEVICE_FAMILY = \"1,2\";/g,\n `TARGETED_DEVICE_FAMILY = \"${app.ios?.tablet ? \"1,2\" : \"1\"}\";`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /MARKETING_VERSION = [^;]+;/g,\n `MARKETING_VERSION = \"${app.version}\";`\n );\n }\n if (app.ios?.buildNumber !== void 0) {\n rendered = rendered.replace(\n /CURRENT_PROJECT_VERSION = [^;]+;/g,\n `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\")) {\n if (app.ios?.usesNonExemptEncryption !== void 0) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>ITSAppUsesNonExemptEncryption</key>\n\t<${app.ios.usesNonExemptEncryption ? \"true\" : \"false\"}/>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n rendered = patchIosInfoPlistSceneManifest(rendered);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/AppDelegate.swift\")) {\n rendered = patchIosAppDelegateSceneLifecycle(rendered, appName);\n }\n if (platform === \"ios\" && app.ios?.deploymentTarget) {\n rendered = rendered.replace(\n \"platform :ios, min_ios_version_supported\",\n `platform :ios, '${app.ios.deploymentTarget}'`\n ).replace(\n /IPHONEOS_DEPLOYMENT_TARGET = \\d+(?:\\.\\d+)?;/g,\n `IPHONEOS_DEPLOYMENT_TARGET = ${app.ios.deploymentTarget};`\n );\n if (relativePath === \"Podfile\") {\n rendered = rendered.replace(\n \" )\\n end\\nend\",\n ` )\n\n installer.pods_project.targets.each do |target|\n target.build_configurations.each do |config|\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${app.ios.deploymentTarget}'\n end\n end\n end\nend`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = patchIosBundlePhase(rendered);\n rendered = patchIosPbxprojSceneDelegate(rendered, appName);\n }\n if (platform === \"ios\" && relativePath === \"Podfile\") {\n if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'\n${rendered}`;\n if (app.ios?.useFrameworks) {\n rendered = rendered.replace(\n /^(platform :ios, .+)$/m,\n `$1\nuse_frameworks! :linkage => :${app.ios.useFrameworks}`\n );\n }\n if (app.ios?.screensGamma) {\n rendered = nativeProjectPatches.injectReactNativeScreensGammaIntoPodfile(rendered);\n }\n rendered = nativeProjectPatches.injectFmtCxx17FixIntoPodfile(rendered);\n rendered = nativeProjectPatches.injectHermesMinificationPatchIntoPodfile(rendered);\n if (!rendered.includes(\"[vxrn/one] fmt c++17 fix\") || !rendered.includes(\"[vxrn/one] minify iOS Hermes Release bundle input\")) {\n throw new Error(\"[vxrn] failed to apply required iOS Podfile patches\");\n }\n }\n if (platform === \"android\" && relativePath === \"app/build.gradle\") {\n rendered = nativeProjectPatches.replaceAppBuildGradleReactBlock(rendered);\n rendered = nativeProjectPatches.addDepsPatchToAppBuildGradle(rendered);\n if (!rendered.includes('entryFile = file(\"../../package.json\")') || !rendered.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required Android Gradle patches\");\n }\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /versionName \"[^\"]*\"/g,\n `versionName \"${app.version}\"`\n );\n }\n if (app.android?.versionCode !== void 0) {\n rendered = rendered.replace(\n /versionCode \\d+/g,\n `versionCode ${app.android.versionCode}`\n );\n }\n }\n if (platform === \"android\" && relativePath === \"settings.gradle\") {\n const hardcodedGradlePlugin = /includeBuild\\((['\"])\\.\\.\\/node_modules\\/@react-native\\/gradle-plugin\\1\\)/g;\n if ([...rendered.matchAll(hardcodedGradlePlugin)].length !== 2) {\n throw new Error(\"[vxrn] expected two React Native Gradle plugin paths\");\n }\n rendered = rendered.replace(\n hardcodedGradlePlugin,\n `includeBuild(new File([\"node\", \"--print\", \"require('module').createRequire(require.resolve('react-native/package.json')).resolve('@react-native/gradle-plugin/package.json')\"].execute(null, settingsDir).text.trim()).parentFile.canonicalPath)`\n );\n }\n if (platform === \"android\" && app.android?.minSdk !== void 0) {\n rendered = rendered.replace(\n /minSdkVersion = \\d+/g,\n `minSdkVersion = ${app.android.minSdk}`\n );\n }\n }\n return { destRelativePath, content: rendered };\n}\nconst generateForPlatform = async (root, platform, app, outDir = path.resolve(root, platform)) => {\n validatePrebuildApp(app, platform);\n const dest = outDir;\n const require2 = module.createRequire(root + \"/\");\n const importPath = require2.resolve(\"@react-native-community/cli/build/tools/walk.js\", {\n paths: [root]\n });\n const src = path.join(\n path.dirname(\n require2.resolve(\"@react-native-community/template/template/package.json\", {\n paths: [root]\n })\n ),\n platform\n );\n const walkModule = await import(pathToFileURL(importPath).href);\n const walkFn = walkModule?.default?.default ?? walkModule?.default ?? walkModule;\n if (typeof walkFn !== \"function\") {\n throw new Error(\"[vxrn] could not resolve the community template walker\");\n }\n const files = [...walkFn(src)].sort();\n FSExtra.removeSync(dest);\n for (const absoluteSrc of files) {\n const relativeFilePath = path.relative(src, absoluteSrc);\n const stat = FSExtra.lstatSync(absoluteSrc);\n if (stat.isDirectory()) continue;\n const extension = path.extname(absoluteSrc);\n const raw = [\".png\", \".jar\", \".keystore\"].includes(extension) ? null : FSExtra.readFileSync(absoluteSrc, \"utf8\");\n const { destRelativePath, content } = renderPrebuildFile({\n relativePath: relativeFilePath,\n content: raw,\n platform,\n app\n });\n const destPath = path.resolve(dest, destRelativePath);\n FSExtra.mkdirSync(path.dirname(destPath), { recursive: true });\n console.info(\"copying\", '\"' + absoluteSrc + '\"', \"to\", '\"' + destPath + '\"');\n if (content === null) {\n FSExtra.copyFileSync(absoluteSrc, destPath);\n continue;\n }\n FSExtra.writeFileSync(destPath, content, {\n encoding: \"utf8\",\n mode: stat.mode\n });\n }\n await generateAppIcons({ root, dest, platform, app });\n await generateSplashScreen({ root, dest, platform, app });\n generateSceneDelegate({ dest, platform, app });\n};\nfunction applyAndroidDependencyPatches(args) {\n const { root, app, inventory } = args;\n if (!app.android || !inventory.some(\n (dependency) => dependency.name === \"react-native-screens\" && dependency.platforms.includes(\"android\")\n )) {\n return;\n }\n const activityPath = path.join(\n root,\n \"android\",\n \"app\",\n \"src\",\n \"main\",\n \"java\",\n ...app.android.applicationId.split(\".\"),\n \"MainActivity.kt\"\n );\n const rendered = nativeProjectPatches.addReactNativeScreensFix(\n FSExtra.readFileSync(activityPath, \"utf8\")\n );\n if (!rendered.includes(\"RNScreensFragmentFactory\")) {\n throw new Error(\"[vxrn] failed to apply the react-native-screens activity patch\");\n }\n FSExtra.writeFileSync(activityPath, rendered);\n}\nasync function getNativeDependencyInventory(root) {\n const require2 = module.createRequire(root + \"/\");\n const cliConfigPath = require2.resolve(\"@react-native-community/cli-config\", {\n paths: [root]\n });\n const cliConfig = await import(pathToFileURL(cliConfigPath).href);\n const config = await cliConfig.loadConfigAsync({ projectRoot: root });\n const inventory = [];\n for (const name of Object.keys(config.dependencies).sort()) {\n const dependency = config.dependencies[name];\n const depRoot = dependency.root;\n let version = \"unknown\";\n try {\n version = JSON.parse(FSExtra.readFileSync(path.join(depRoot, \"package.json\"), \"utf8\")).version ?? \"unknown\";\n } catch {\n }\n const platforms = Object.entries(dependency.platforms).filter(([, platformConfig]) => platformConfig !== null).map(([platform]) => platform).sort();\n if (platforms.length > 0) inventory.push({ name, version, platforms });\n }\n return inventory;\n}\nfunction installNativeDependencies(args) {\n const { root, platform } = args;\n if (!platform || platform === \"ios\") {\n execFileSync(\"pod\", [\"install\", `--project-directory=${path.join(root, \"ios\")}`], {\n stdio: \"inherit\"\n });\n }\n}\nconst transformPath = (filePath) => {\n return filePath.replace(\"_BUCK\", \"BUCK\").replace(\"_gitignore\", \".gitignore\").replace(\"_gitattributes\", \".gitattributes\").replace(\"_babelrc\", \".babelrc\").replace(\"_editorconfig\", \".editorconfig\").replace(\"_eslintrc.js\", \".eslintrc.js\").replace(\"_flowconfig\", \".flowconfig\").replace(\"_buckconfig\", \".buckconfig\").replace(\"_prettierrc.js\", \".prettierrc.js\").replace(\"_bundle\", \".bundle\").replace(\"_ruby-version\", \".ruby-version\").replace(\"_node-version\", \".node-version\").replace(\"_watchmanconfig\", \".watchmanconfig\").replace(\"_xcode.env\", \".xcode.env\");\n};\nexport {\n applyAndroidDependencyPatches,\n generateForPlatform,\n getNativeDependencyInventory,\n installNativeDependencies,\n renderPrebuildFile,\n renderSceneDelegateSwift,\n validatePrebuildApp\n};\n//# sourceMappingURL=prebuildWithoutExpo.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,uBAAuB,OAAO,cAAc,YAAY,GAAG,CAAC,CAChE,kCACF;AACA,MAAM,cAAc;AACpB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAC1B,MAAM,YAAY;AAClB,MAAM,oBAAoB;CACxB,MAAM;CACN,MAAM;CACN,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AACA,MAAM,yBAAyB;AAC/B,MAAM,8BAA8B;AACpC,MAAM,uBAAuB;AAC7B,SAAS,oBAAoB,SAAS;CACpC,IAAI,sBAAsB;CAC1B,MAAM,iBAAiB,QAAQ,QAC7B,wCACC,YAAY,qBAAqB;EAChC,IAAI;EACJ,IAAI;GACF,SAAS,KAAK,MAAM,gBAAgB;EACtC,QAAQ;GACN,OAAO;EACT;EACA,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,uBAAuB,GAAG;GAC3E,OAAO;EACT;EACA,IAAI,UAAU;EACd,UAAU,qBAAqB,4CAA4C,OAAO;EAClF,UAAU,qBAAqB,4CAA4C,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AAC,CAAC,KAAK,CAAC,cAAc,QAAQ,CAAC,CAAC,KAAK;EAClJ,IAAI,UAAU,SAAS,GAAG,UAAU,KAAK;GAAE;GAAM;GAAS;EAAU,CAAC;CACvE;CACA,OAAO;AACT;AACA,SAAS,0BAA0B,MAAM;CACvC,MAAM,EAAE,MAAM,aAAa;CAC3B,IAAI,CAAC,YAAY,aAAa,OAAO;EACnC,aAAa,OAAO,CAAC,WAAW,uBAAuB,KAAK,KAAK,MAAM,KAAK,GAAG,GAAG,EAChF,OAAO,UACT,CAAC;CACH;AACF;AACA,MAAM,iBAAiB,aAAa;CAClC,OAAO,SAAS,QAAQ,SAAS,MAAM,CAAC,CAAC,QAAQ,cAAc,YAAY,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,YAAY,UAAU,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,gBAAgB,cAAc,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,mBAAmB,iBAAiB,CAAC,CAAC,QAAQ,cAAc,YAAY;AACviB"}
|
|
1
|
+
{"version":3,"file":"prebuildWithoutExpo.js","names":[],"sources":["exports/prebuildWithoutExpo.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport module from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateNativeApp } from \"@vxrn/utils/nativeAppManifest\";\nimport FSExtra from \"fs-extra\";\nimport sharp from \"sharp\";\nconst nativeProjectPatches = module.createRequire(import.meta.url)(\n \"../../native-project-patches.cjs\"\n);\nconst validatePrebuildApp = validateNativeApp;\nconst ANDROID_DENSITIES = {\n mdpi: 1,\n hdpi: 1.5,\n xhdpi: 2,\n xxhdpi: 3,\n xxxhdpi: 4\n};\nconst IOS_BUNDLE_PLACEHOLDER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\nconst ANDROID_PACKAGE_PLACEHOLDER = \"com.helloworld\";\nconst ANDROID_PACKAGE_PATH = \"com/helloworld\";\nfunction patchIosBundlePhase(project) {\n let patchedBundlePhases = 0;\n const patchedProject = project.replace(\n /shellScript = (\"(?:\\\\.|[^\"\\\\])*\");/g,\n (assignment, serializedScript) => {\n let script;\n try {\n script = JSON.parse(serializedScript);\n } catch {\n return assignment;\n }\n if (typeof script !== \"string\" || !script.includes(\"react-native-xcode.sh\")) {\n return assignment;\n }\n let patched = script;\n patched = nativeProjectPatches.addSetCliPathToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addPodHermescToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addDepsPatchToBundleReactNativeShellScript(patched);\n if (!patched.includes(\"[vxrn/one] React Native now defaults CLI_PATH\") || !patched.includes(\"[vxrn/one] use the hermes-engine pod\") || !patched.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required iOS bundle phase patches\");\n }\n patchedBundlePhases++;\n return `shellScript = ${JSON.stringify(patched)};`;\n }\n );\n if (patchedBundlePhases !== 1) {\n throw new Error(\n `[vxrn] expected one iOS React Native bundle phase, found ${patchedBundlePhases}`\n );\n }\n return patchedProject;\n}\nfunction escapeXml(value) {\n return value.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\");\n}\nconst SCENE_DELEGATE_FILE_REF_ID = \"1A2B3C4D5E6F7A8B9C0D1E2F\";\nconst SCENE_DELEGATE_BUILD_FILE_ID = \"2B3C4D5E6F7A8B9C0D1E2F1A\";\nfunction renderSceneDelegateSwift(appName) {\n return `import UIKit\nimport React\nimport React_RCTAppDelegate\nimport ReactAppDependencyProvider\n\n// owns the window and the react native root. with a scene manifest the\n// system creates this delegate per foreground scene instead of asking the\n// app delegate for a window, which is what the xcode 27 sdk requires.\nclass SceneDelegate: UIResponder, UIWindowSceneDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func scene(\n _ scene: UIScene,\n willConnectTo session: UISceneSession,\n options connectionOptions: UIScene.ConnectionOptions\n ) {\n guard let windowScene = scene as? UIWindowScene else { return }\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n let window = UIWindow(windowScene: windowScene)\n self.window = window\n\n // cold-start links arrive in connectionOptions under scenes, never in\n // the app launchOptions, so they are translated into the launchOptions\n // shape RCTLinkingManager.getInitialURL reads.\n var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]\n if let url = connectionOptions.urlContexts.first?.url {\n launchOptions[.url] = url\n }\n if let activity = connectionOptions.userActivities.first(where: {\n $0.activityType == NSUserActivityTypeBrowsingWeb\n }) {\n launchOptions[.userActivityDictionary] = [\n \"UIApplicationLaunchOptionsUserActivityTypeKey\": activity.activityType,\n \"UIApplicationLaunchOptionsUserActivityKey\": activity,\n ]\n }\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n }\n\n func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {\n guard let url = URLContexts.first?.url else { return }\n RCTLinkingManager.application(UIApplication.shared, open: url, options: [:])\n }\n\n func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {\n RCTLinkingManager.application(\n UIApplication.shared,\n continue: userActivity,\n restorationHandler: { _ in }\n )\n }\n}\n`;\n}\nfunction insertAfterLine(haystack, anchor, insertion) {\n const anchorIndex = haystack.indexOf(anchor);\n if (anchorIndex === -1) return haystack;\n const lineEnd = haystack.indexOf(\"\\n\", anchorIndex);\n if (lineEnd === -1) return `${haystack}\n${insertion}`;\n return `${haystack.slice(0, lineEnd + 1)}${insertion}\n${haystack.slice(lineEnd + 1)}`;\n}\nfunction patchIosInfoPlistSceneManifest(rendered) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor)) {\n throw new Error(\"[vxrn] prebuild template Info.plist lost its LSRequiresIPhoneOS anchor\");\n }\n return rendered.replace(\n anchor,\n `\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t\t<key>UISceneConfigurations</key>\n\t\t<dict>\n\t\t\t<key>UIWindowSceneSessionRoleApplication</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>UISceneConfigurationName</key>\n\t\t\t\t\t<string>Default Configuration</string>\n\t\t\t\t\t<key>UISceneDelegateClassName</key>\n\t\t\t\t\t<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t</dict>\n${anchor}`\n );\n}\nfunction patchIosAppDelegateSceneLifecycle(rendered, appName) {\n const anchor = `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n window = UIWindow(frame: UIScreen.main.bounds)\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n\n return true\n }\n}`;\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] prebuild template AppDelegate.swift changed shape: cannot move the RN root to the scene delegate\"\n );\n }\n return rendered.replace(\n anchor,\n `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n true\n }\n}`\n );\n}\nfunction patchIosPbxprojSceneDelegate(rendered, appName) {\n const edits = [\n [\n \"/* AppDelegate.swift in Sources */ = {isa = PBXBuildFile;\",\n `\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */; };`\n ],\n [\n \"/* AppDelegate.swift */ = {isa = PBXFileReference;\",\n `\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SceneDelegate.swift; path = ${appName}/SceneDelegate.swift; sourceTree = \"<group>\"; };`\n ],\n [\n \"/* AppDelegate.swift */,\",\n `\t\t\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */,`\n ],\n [\n \"/* AppDelegate.swift in Sources */,\",\n `\t\t\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */,`\n ]\n ];\n let patched = rendered;\n for (const [anchor, insertion] of edits) {\n const next = insertAfterLine(patched, anchor, insertion);\n if (next === patched) {\n throw new Error(\n `[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`\n );\n }\n patched = next;\n }\n return patched;\n}\nfunction generateSceneDelegate(args) {\n const { dest, platform, app } = args;\n if (platform !== \"ios\") return;\n FSExtra.writeFileSync(\n path.join(dest, app.name, \"SceneDelegate.swift\"),\n renderSceneDelegateSwift(app.name)\n );\n}\nasync function generateAppIcons(args) {\n const { root, dest, platform, app } = args;\n if (!app.icon) return;\n const source = path.resolve(root, app.icon.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.icon source does not exist: ${source}`);\n }\n const metadata = await sharp(source).metadata();\n if (metadata.width === void 0 || metadata.height === void 0 || metadata.width !== metadata.height || metadata.width < 1024) {\n throw new Error(\n \"[vxrn] native.app.icon source must be a square image at least 1024px wide\"\n );\n }\n if (platform === \"ios\") {\n const iconDir = path.join(dest, app.name, \"Images.xcassets\", \"AppIcon.appiconset\");\n const contentsPath = path.join(iconDir, \"Contents.json\");\n const contents = JSON.parse(FSExtra.readFileSync(contentsPath, \"utf8\"));\n for (const image of contents.images) {\n const points = Number.parseFloat(image.size.split(\"x\")[0]);\n const scale = Number.parseInt(image.scale, 10);\n const pixels = points * scale;\n const filename = image.idiom === \"ios-marketing\" ? \"icon-1024.png\" : `icon-${points}@${image.scale}.png`;\n image.filename = filename;\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n FSExtra.writeFileSync(contentsPath, `${JSON.stringify(contents, null, 2)}\n`);\n return;\n }\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const pixels = 48 * multiplier;\n const iconDir = path.join(dest, \"app\", \"src\", \"main\", \"res\", `mipmap-${density}`);\n for (const filename of [\"ic_launcher.png\", \"ic_launcher_round.png\"]) {\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n }\n}\nasync function generateSplashScreen(args) {\n const { root, dest, platform, app } = args;\n if (!app.splash) return;\n const source = path.resolve(root, app.splash.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.splash source does not exist: ${source}`);\n }\n const { data: artwork, info: metadata } = await sharp(source).rotate().trim({ background: app.splash.backgroundColor }).png().toBuffer({ resolveWithObject: true });\n if (!metadata.width || !metadata.height) {\n throw new Error(\"[vxrn] native.app.splash source must be an image\");\n }\n const artworkWidth = app.splash.width ?? 200;\n const artworkHeight = Number(\n (artworkWidth * (metadata.height / metadata.width)).toFixed(3)\n );\n if (platform === \"ios\") {\n const appDir = path.join(dest, app.name);\n const splashDir = path.join(appDir, \"Images.xcassets\", \"Splash.imageset\");\n FSExtra.mkdirSync(splashDir, { recursive: true });\n await sharp(artwork).toFile(path.join(splashDir, \"splash.png\"));\n FSExtra.writeFileSync(\n path.join(splashDir, \"Contents.json\"),\n `${JSON.stringify(\n {\n images: [{ filename: \"splash.png\", idiom: \"universal\", scale: \"1x\" }],\n info: { author: \"xcode\", version: 1 }\n },\n null,\n 2\n )}\n`\n );\n const red = Number.parseInt(app.splash.backgroundColor.slice(1, 3), 16) / 255;\n const green = Number.parseInt(app.splash.backgroundColor.slice(3, 5), 16) / 255;\n const blue = Number.parseInt(app.splash.backgroundColor.slice(5, 7), 16) / 255;\n FSExtra.writeFileSync(\n path.join(appDir, \"LaunchScreen.storyboard\"),\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"launch-controller\">\n <device id=\"retina6_12\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"launch-scene\">\n <objects>\n <viewController id=\"launch-controller\" sceneMemberID=\"viewController\">\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"launch-view\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"390\" height=\"844\"/>\n <subviews>\n <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" image=\"Splash\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"splash-image\"/>\n </subviews>\n <color key=\"backgroundColor\" red=\"${red}\" green=\"${green}\" blue=\"${blue}\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n <constraints>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerX\" secondItem=\"launch-view\" secondAttribute=\"centerX\" id=\"splash-center-x\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerY\" secondItem=\"launch-view\" secondAttribute=\"centerY\" id=\"splash-center-y\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"width\" constant=\"${artworkWidth}\" id=\"splash-width\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"height\" constant=\"${artworkHeight}\" id=\"splash-height\"/>\n </constraints>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"launch-responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"Splash\" width=\"${metadata.width}\" height=\"${metadata.height}\"/>\n </resources>\n</document>\n`\n );\n return;\n }\n const mainRes = path.join(dest, \"app\", \"src\", \"main\", \"res\");\n const drawable = path.join(mainRes, \"drawable\");\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const canvasSize = 288 * multiplier;\n const imageSize = Math.round(artworkWidth * multiplier);\n const contained = await sharp(artwork).resize(imageSize, imageSize, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }).png().toBuffer();\n const drawableDensity = path.join(mainRes, `drawable-${density}`);\n FSExtra.mkdirSync(drawableDensity, { recursive: true });\n await sharp({\n create: {\n width: canvasSize,\n height: canvasSize,\n channels: 4,\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }\n }).composite([\n {\n input: contained,\n left: Math.round((canvasSize - imageSize) / 2),\n top: Math.round((canvasSize - imageSize) / 2)\n }\n ]).png().toFile(path.join(drawableDensity, \"splash.png\"));\n }\n FSExtra.writeFileSync(\n path.join(drawable, \"launch_screen.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:drawable=\"@color/splash_background\" />\n <item>\n <bitmap android:gravity=\"center\" android:src=\"@drawable/splash\" />\n </item>\n</layer-list>\n`\n );\n FSExtra.writeFileSync(\n path.join(mainRes, \"values\", \"colors.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"splash_background\">${app.splash.backgroundColor}</color>\n</resources>\n`\n );\n const stylesPath = path.join(mainRes, \"values\", \"styles.xml\");\n const styles = FSExtra.readFileSync(stylesPath, \"utf8\").replace(\n \" <!-- Customize your theme here. -->\",\n ' <item name=\"android:windowBackground\">@drawable/launch_screen</item>'\n );\n FSExtra.writeFileSync(stylesPath, styles);\n const stylesV31 = path.join(mainRes, \"values-v31\");\n FSExtra.mkdirSync(stylesV31, { recursive: true });\n FSExtra.writeFileSync(\n path.join(stylesV31, \"styles.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\">\n <item name=\"android:windowSplashScreenBackground\">@color/splash_background</item>\n <item name=\"android:windowSplashScreenAnimatedIcon\">@drawable/splash</item>\n </style>\n</resources>\n`\n );\n}\nfunction renderPrebuildFile(args) {\n const { relativePath, content, platform, app } = args;\n const appName = app.name;\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n let destRelativePath = transformPath(relativePath);\n if (platform === \"android\" && app.android) {\n const packagePath = app.android.applicationId.split(\".\").join(\"/\");\n destRelativePath = destRelativePath.split(ANDROID_PACKAGE_PATH).join(packagePath);\n }\n destRelativePath = destRelativePath.replace(/HelloWorld/g, appName).replace(/helloworld/g, appName.toLowerCase());\n let rendered = content;\n if (rendered !== null) {\n const replacements = [];\n if (platform === \"ios\" && app.ios) {\n replacements.push([IOS_BUNDLE_PLACEHOLDER, app.ios.bundleId]);\n }\n if (platform === \"android\" && app.android) {\n replacements.push([ANDROID_PACKAGE_PLACEHOLDER, app.android.applicationId]);\n }\n replacements.push(\n [\"Hello App Display Name\", app.displayName || appName],\n [\"HelloWorld\", appName],\n [\"helloworld\", appName.toLowerCase()]\n );\n for (const [find, value] of replacements) {\n rendered = rendered.split(find).join(value);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\")) {\n const stamps = [];\n if (schemes.length) {\n stamps.push(`\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n${schemes.map((scheme) => `\t\t\t\t<string>${scheme}</string>`).join(\"\\n\")}\n\t\t\t</array>\n\t\t</dict>\n\t</array>`);\n }\n if (app.ios?.usesNonExemptEncryption !== void 0) {\n stamps.push(\n `\t<key>ITSAppUsesNonExemptEncryption</key>\n\t<${app.ios.usesNonExemptEncryption ? \"true\" : \"false\"}/>`\n );\n }\n if (app.ios?.fileSharing) {\n stamps.push(\n `\t<key>UIFileSharingEnabled</key>\n\t<true/>\n\t<key>LSSupportsOpeningDocumentsInPlace</key>\n\t<true/>`\n );\n }\n if (stamps.length) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor))\n throw new Error(\n `[vxrn] prebuild template ${relativePath} lost its LSRequiresIPhoneOS anchor`\n );\n rendered = rendered.replace(anchor, `${stamps.join(\"\\n\")}\n${anchor}`);\n }\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && app.imagePicker?.camera !== void 0) {\n const anchor = '<uses-permission android:name=\"android.permission.INTERNET\" />';\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] cannot stamp the camera permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml\"\n );\n }\n rendered = rendered.replace(\n anchor,\n `${anchor}\n <uses-permission android:name=\"android.permission.CAMERA\" />`\n );\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && schemes.length) {\n rendered = rendered.replace(\n \" </activity>\",\n ` <intent-filter>\n <action android:name=\"android.intent.action.VIEW\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <category android:name=\"android.intent.category.BROWSABLE\" />\n${schemes.map((scheme) => ` <data android:scheme=\"${scheme}\" />`).join(\"\\n\")}\n </intent-filter>\n </activity>`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = rendered.replace(\n /TARGETED_DEVICE_FAMILY = \"1,2\";/g,\n `TARGETED_DEVICE_FAMILY = \"${app.ios?.tablet ? \"1,2\" : \"1\"}\";`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /MARKETING_VERSION = [^;]+;/g,\n `MARKETING_VERSION = \"${app.version}\";`\n );\n }\n if (app.ios?.buildNumber !== void 0) {\n rendered = rendered.replace(\n /CURRENT_PROJECT_VERSION = [^;]+;/g,\n `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\")) {\n if (app.imagePicker?.camera !== void 0) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist\"\n );\n }\n rendered = rendered.replace(\n anchor,\n `\t<key>NSCameraUsageDescription</key>\n\t<string>${escapeXml(app.imagePicker.camera)}</string>\n${anchor}`\n );\n }\n rendered = patchIosInfoPlistSceneManifest(rendered);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/AppDelegate.swift\")) {\n rendered = patchIosAppDelegateSceneLifecycle(rendered, appName);\n }\n if (platform === \"ios\" && app.ios?.deploymentTarget) {\n rendered = rendered.replace(\n \"platform :ios, min_ios_version_supported\",\n `platform :ios, '${app.ios.deploymentTarget}'`\n ).replace(\n /IPHONEOS_DEPLOYMENT_TARGET = \\d+(?:\\.\\d+)?;/g,\n `IPHONEOS_DEPLOYMENT_TARGET = ${app.ios.deploymentTarget};`\n );\n if (relativePath === \"Podfile\") {\n rendered = rendered.replace(\n \" )\\n end\\nend\",\n ` )\n\n installer.pods_project.targets.each do |target|\n target.build_configurations.each do |config|\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${app.ios.deploymentTarget}'\n end\n end\n end\nend`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = patchIosBundlePhase(rendered);\n rendered = patchIosPbxprojSceneDelegate(rendered, appName);\n }\n if (platform === \"ios\" && relativePath === \"Podfile\") {\n if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'\n${rendered}`;\n if (app.ios?.useFrameworks) {\n rendered = rendered.replace(\n /^(platform :ios, .+)$/m,\n `$1\nuse_frameworks! :linkage => :${app.ios.useFrameworks}`\n );\n }\n if (app.ios?.screensGamma) {\n rendered = nativeProjectPatches.injectReactNativeScreensGammaIntoPodfile(rendered);\n }\n rendered = nativeProjectPatches.injectFmtCxx17FixIntoPodfile(rendered);\n rendered = nativeProjectPatches.injectHermesMinificationPatchIntoPodfile(rendered);\n if (!rendered.includes(\"[vxrn/one] fmt c++17 fix\") || !rendered.includes(\"[vxrn/one] minify iOS Hermes Release bundle input\")) {\n throw new Error(\"[vxrn] failed to apply required iOS Podfile patches\");\n }\n }\n if (platform === \"android\" && relativePath === \"app/build.gradle\") {\n rendered = nativeProjectPatches.replaceAppBuildGradleReactBlock(rendered);\n rendered = nativeProjectPatches.addDepsPatchToAppBuildGradle(rendered);\n if (!rendered.includes('entryFile = file(\"../../package.json\")') || !rendered.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required Android Gradle patches\");\n }\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /versionName \"[^\"]*\"/g,\n `versionName \"${app.version}\"`\n );\n }\n if (app.android?.versionCode !== void 0) {\n rendered = rendered.replace(\n /versionCode \\d+/g,\n `versionCode ${app.android.versionCode}`\n );\n }\n }\n if (platform === \"android\" && relativePath === \"settings.gradle\") {\n const hardcodedGradlePlugin = /includeBuild\\((['\"])\\.\\.\\/node_modules\\/@react-native\\/gradle-plugin\\1\\)/g;\n if ([...rendered.matchAll(hardcodedGradlePlugin)].length !== 2) {\n throw new Error(\"[vxrn] expected two React Native Gradle plugin paths\");\n }\n rendered = rendered.replace(\n hardcodedGradlePlugin,\n `includeBuild(new File([\"node\", \"--print\", \"require('module').createRequire(require.resolve('react-native/package.json')).resolve('@react-native/gradle-plugin/package.json')\"].execute(null, settingsDir).text.trim()).parentFile.canonicalPath)`\n );\n }\n if (platform === \"android\" && app.android?.minSdk !== void 0) {\n rendered = rendered.replace(\n /minSdkVersion = \\d+/g,\n `minSdkVersion = ${app.android.minSdk}`\n );\n }\n }\n return { destRelativePath, content: rendered };\n}\nconst generateForPlatform = async (root, platform, app, outDir = path.resolve(root, platform)) => {\n validatePrebuildApp(app, platform);\n const dest = outDir;\n const require2 = module.createRequire(root + \"/\");\n const importPath = require2.resolve(\"@react-native-community/cli/build/tools/walk.js\", {\n paths: [root]\n });\n const src = path.join(\n path.dirname(\n require2.resolve(\"@react-native-community/template/template/package.json\", {\n paths: [root]\n })\n ),\n platform\n );\n const walkModule = await import(pathToFileURL(importPath).href);\n const walkFn = walkModule?.default?.default ?? walkModule?.default ?? walkModule;\n if (typeof walkFn !== \"function\") {\n throw new Error(\"[vxrn] could not resolve the community template walker\");\n }\n const files = [...walkFn(src)].sort();\n FSExtra.removeSync(dest);\n for (const absoluteSrc of files) {\n const relativeFilePath = path.relative(src, absoluteSrc);\n const stat = FSExtra.lstatSync(absoluteSrc);\n if (stat.isDirectory()) continue;\n const extension = path.extname(absoluteSrc);\n const raw = [\".png\", \".jar\", \".keystore\"].includes(extension) ? null : FSExtra.readFileSync(absoluteSrc, \"utf8\");\n const { destRelativePath, content } = renderPrebuildFile({\n relativePath: relativeFilePath,\n content: raw,\n platform,\n app\n });\n const destPath = path.resolve(dest, destRelativePath);\n FSExtra.mkdirSync(path.dirname(destPath), { recursive: true });\n console.info(\"copying\", '\"' + absoluteSrc + '\"', \"to\", '\"' + destPath + '\"');\n if (content === null) {\n FSExtra.copyFileSync(absoluteSrc, destPath);\n continue;\n }\n FSExtra.writeFileSync(destPath, content, {\n encoding: \"utf8\",\n mode: stat.mode\n });\n }\n await generateAppIcons({ root, dest, platform, app });\n await generateSplashScreen({ root, dest, platform, app });\n generateSceneDelegate({ dest, platform, app });\n};\nfunction applyAndroidDependencyPatches(args) {\n const { root, app, inventory } = args;\n if (!app.android || !inventory.some(\n (dependency) => dependency.name === \"react-native-screens\" && dependency.platforms.includes(\"android\")\n )) {\n return;\n }\n const activityPath = path.join(\n root,\n \"android\",\n \"app\",\n \"src\",\n \"main\",\n \"java\",\n ...app.android.applicationId.split(\".\"),\n \"MainActivity.kt\"\n );\n const rendered = nativeProjectPatches.addReactNativeScreensFix(\n FSExtra.readFileSync(activityPath, \"utf8\")\n );\n if (!rendered.includes(\"RNScreensFragmentFactory\")) {\n throw new Error(\"[vxrn] failed to apply the react-native-screens activity patch\");\n }\n FSExtra.writeFileSync(activityPath, rendered);\n}\nasync function getNativeDependencyInventory(root) {\n const require2 = module.createRequire(root + \"/\");\n const cliConfigPath = require2.resolve(\"@react-native-community/cli-config\", {\n paths: [root]\n });\n const cliConfig = await import(pathToFileURL(cliConfigPath).href);\n const config = await cliConfig.loadConfigAsync({ projectRoot: root });\n const inventory = [];\n for (const name of Object.keys(config.dependencies).sort()) {\n const dependency = config.dependencies[name];\n const depRoot = dependency.root;\n let version = \"unknown\";\n try {\n version = JSON.parse(FSExtra.readFileSync(path.join(depRoot, \"package.json\"), \"utf8\")).version ?? \"unknown\";\n } catch {\n }\n const platforms = Object.entries(dependency.platforms).filter(([, platformConfig]) => platformConfig !== null).map(([platform]) => platform).sort();\n if (platforms.length > 0) inventory.push({ name, version, platforms });\n }\n return inventory;\n}\nfunction installNativeDependencies(args) {\n const { root, platform } = args;\n if (!platform || platform === \"ios\") {\n execFileSync(\"pod\", [\"install\", `--project-directory=${path.join(root, \"ios\")}`], {\n stdio: \"inherit\"\n });\n }\n}\nconst transformPath = (filePath) => {\n return filePath.replace(\"_BUCK\", \"BUCK\").replace(\"_gitignore\", \".gitignore\").replace(\"_gitattributes\", \".gitattributes\").replace(\"_babelrc\", \".babelrc\").replace(\"_editorconfig\", \".editorconfig\").replace(\"_eslintrc.js\", \".eslintrc.js\").replace(\"_flowconfig\", \".flowconfig\").replace(\"_buckconfig\", \".buckconfig\").replace(\"_prettierrc.js\", \".prettierrc.js\").replace(\"_bundle\", \".bundle\").replace(\"_ruby-version\", \".ruby-version\").replace(\"_node-version\", \".node-version\").replace(\"_watchmanconfig\", \".watchmanconfig\").replace(\"_xcode.env\", \".xcode.env\");\n};\nexport {\n applyAndroidDependencyPatches,\n generateForPlatform,\n getNativeDependencyInventory,\n installNativeDependencies,\n renderPrebuildFile,\n renderSceneDelegateSwift,\n validatePrebuildApp\n};\n//# sourceMappingURL=prebuildWithoutExpo.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,uBAAuB,OAAO,cAAc,YAAY,GAAG,CAAC,CAChE,kCACF;AACA,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;CACxB,MAAM;CACN,MAAM;CACN,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AACA,MAAM,yBAAyB;AAC/B,MAAM,8BAA8B;AACpC,MAAM,uBAAuB;AAC7B,SAAS,oBAAoB,SAAS;CACpC,IAAI,sBAAsB;CAC1B,MAAM,iBAAiB,QAAQ,QAC7B,wCACC,YAAY,qBAAqB;EAChC,IAAI;EACJ,IAAI;GACF,SAAS,KAAK,MAAM,gBAAgB;EACtC,QAAQ;GACN,OAAO;EACT;EACA,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS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AM,QAAQ,aAAa,KAAK,KAAK,SAAS,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW;EACpG,QAAQ,CACR;EACA,MAAM,YAAY,OAAO,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,GAAG,oBAAoB,mBAAmB,IAAI,CAAC,CAAC,KAAK,CAAC,cAAc,QAAQ,CAAC,CAAC,KAAK;EAClJ,IAAI,UAAU,SAAS,GAAG,UAAU,KAAK;GAAE;GAAM;GAAS;EAAU,CAAC;CACvE;CACA,OAAO;AACT;AACA,SAAS,0BAA0B,MAAM;CACvC,MAAM,EAAE,MAAM,aAAa;CAC3B,IAAI,CAAC,YAAY,aAAa,OAAO;EACnC,aAAa,OAAO,CAAC,WAAW,uBAAuB,KAAK,KAAK,MAAM,KAAK,GAAG,GAAG,EAChF,OAAO,UACT,CAAC;CACH;AACF;AACA,MAAM,iBAAiB,aAAa;CAClC,OAAO,SAAS,QAAQ,SAAS,MAAM,CAAC,CAAC,QAAQ,cAAc,YAAY,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,YAAY,UAAU,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,gBAAgB,cAAc,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,mBAAmB,iBAAiB,CAAC,CAAC,QAAQ,cAAc,YAAY;AACviB"}
|
|
@@ -2,17 +2,12 @@ import { execFileSync } from "child_process";
|
|
|
2
2
|
import module from "module";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { pathToFileURL } from "url";
|
|
5
|
+
import { validateNativeApp } from "@vxrn/utils/nativeAppManifest";
|
|
5
6
|
import FSExtra from "fs-extra";
|
|
6
7
|
import sharp from "sharp";
|
|
7
8
|
|
|
8
9
|
var nativeProjectPatches = module.createRequire(import.meta.url)("../../native-project-patches.cjs");
|
|
9
|
-
var
|
|
10
|
-
var SCHEME = /^[a-z][a-z0-9+.-]*$/i;
|
|
11
|
-
var VERSION = /^\d+\.\d+\.\d+/;
|
|
12
|
-
var BUILD_NUMBER = /^[A-Za-z0-9.]+$/;
|
|
13
|
-
var REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\.[A-Za-z][A-Za-z0-9-]*)+$/;
|
|
14
|
-
var DEPLOYMENT_TARGET = /^\d+\.\d+$/;
|
|
15
|
-
var HEX_COLOR = /^#[\da-f]{6}$/i;
|
|
10
|
+
var validatePrebuildApp = validateNativeApp;
|
|
16
11
|
var ANDROID_DENSITIES = {
|
|
17
12
|
mdpi: 1,
|
|
18
13
|
hdpi: 1.5,
|
|
@@ -50,6 +45,9 @@ function patchIosBundlePhase(project) {
|
|
|
50
45
|
}
|
|
51
46
|
return patchedProject;
|
|
52
47
|
}
|
|
48
|
+
function escapeXml(value) {
|
|
49
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
50
|
+
}
|
|
53
51
|
var SCENE_DELEGATE_FILE_REF_ID = "1A2B3C4D5E6F7A8B9C0D1E2F";
|
|
54
52
|
var SCENE_DELEGATE_BUILD_FILE_ID = "2B3C4D5E6F7A8B9C0D1E2F1A";
|
|
55
53
|
function renderSceneDelegateSwift(appName) {
|
|
@@ -236,73 +234,6 @@ function generateSceneDelegate(args) {
|
|
|
236
234
|
if (platform !== "ios") return;
|
|
237
235
|
FSExtra.writeFileSync(path.join(dest, app.name, "SceneDelegate.swift"), renderSceneDelegateSwift(app.name));
|
|
238
236
|
}
|
|
239
|
-
function fail(message) {
|
|
240
|
-
throw new Error(`[vxrn] invalid native.app: ${message}`);
|
|
241
|
-
}
|
|
242
|
-
function validatePrebuildApp(app, platform) {
|
|
243
|
-
if (!app || typeof app !== "object") fail("manifest must be an object");
|
|
244
|
-
if (!app.name || !TARGET_NAME.test(app.name)) {
|
|
245
|
-
fail(`name "${app === null || app === void 0 ? void 0 : app.name}" must start with a letter and contain only letters, digits, and underscore`);
|
|
246
|
-
}
|
|
247
|
-
var schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];
|
|
248
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
249
|
-
try {
|
|
250
|
-
for (var _iterator = schemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
251
|
-
var scheme = _step.value;
|
|
252
|
-
if (typeof scheme !== "string" || !SCHEME.test(scheme)) {
|
|
253
|
-
fail(`scheme "${scheme}" must be a valid uri scheme`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
} catch (err) {
|
|
257
|
-
_didIteratorError = true;
|
|
258
|
-
_iteratorError = err;
|
|
259
|
-
} finally {
|
|
260
|
-
try {
|
|
261
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
262
|
-
_iterator.return();
|
|
263
|
-
}
|
|
264
|
-
} finally {
|
|
265
|
-
if (_didIteratorError) {
|
|
266
|
-
throw _iteratorError;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
if (app.icon !== void 0 && (!app.icon.source || !HEX_COLOR.test(app.icon.backgroundColor))) {
|
|
271
|
-
fail("icon requires source and a six-digit hex backgroundColor");
|
|
272
|
-
}
|
|
273
|
-
if (app.splash !== void 0 && (!app.splash.source || !HEX_COLOR.test(app.splash.backgroundColor) || app.splash.width !== void 0 && (!Number.isFinite(app.splash.width) || app.splash.width < 1 || app.splash.width > 288))) {
|
|
274
|
-
fail("splash requires source, a six-digit hex backgroundColor, and width from 1 to 288");
|
|
275
|
-
}
|
|
276
|
-
if (app.version !== void 0 && !VERSION.test(app.version)) {
|
|
277
|
-
fail(`version "${app.version}" must start with major.minor.patch`);
|
|
278
|
-
}
|
|
279
|
-
if (!platform || platform === "ios") {
|
|
280
|
-
var _app_ios;
|
|
281
|
-
if (!((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.bundleId) || !REVERSE_DNS.test(app.ios.bundleId)) {
|
|
282
|
-
var _app_ios1;
|
|
283
|
-
fail(`ios.bundleId "${(_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.bundleId}" must be reverse-dns`);
|
|
284
|
-
}
|
|
285
|
-
if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {
|
|
286
|
-
fail(`ios.deploymentTarget "${app.ios.deploymentTarget}" must look like "17.0"`);
|
|
287
|
-
}
|
|
288
|
-
if (app.ios.buildNumber !== void 0 && !BUILD_NUMBER.test(app.ios.buildNumber)) {
|
|
289
|
-
fail(`ios.buildNumber "${app.ios.buildNumber}" must contain only letters, digits, and dots`);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
if (!platform || platform === "android") {
|
|
293
|
-
var _app_android;
|
|
294
|
-
if (!((_app_android = app.android) === null || _app_android === void 0 ? void 0 : _app_android.applicationId) || !REVERSE_DNS.test(app.android.applicationId)) {
|
|
295
|
-
var _app_android1;
|
|
296
|
-
fail(`android.applicationId "${(_app_android1 = app.android) === null || _app_android1 === void 0 ? void 0 : _app_android1.applicationId}" must be reverse-dns`);
|
|
297
|
-
}
|
|
298
|
-
if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {
|
|
299
|
-
fail(`android.minSdk "${app.android.minSdk}" must be an integer from 21 to 36`);
|
|
300
|
-
}
|
|
301
|
-
if (app.android.versionCode !== void 0 && (!Number.isInteger(app.android.versionCode) || app.android.versionCode < 1)) {
|
|
302
|
-
fail(`android.versionCode "${app.android.versionCode}" must be a positive integer`);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
237
|
async function generateAppIcons(args) {
|
|
307
238
|
var { root, dest, platform, app } = args;
|
|
308
239
|
if (!app.icon) return;
|
|
@@ -532,7 +463,7 @@ function renderPrebuildFile(args) {
|
|
|
532
463
|
destRelativePath = destRelativePath.replace(/HelloWorld/g, appName).replace(/helloworld/g, appName.toLowerCase());
|
|
533
464
|
var rendered = content;
|
|
534
465
|
if (rendered !== null) {
|
|
535
|
-
var _app_ios, _app_android;
|
|
466
|
+
var _app_imagePicker, _app_ios, _app_android;
|
|
536
467
|
var replacements = [];
|
|
537
468
|
if (platform === "ios" && app.ios) {
|
|
538
469
|
replacements.push([IOS_BUNDLE_PLACEHOLDER, app.ios.bundleId]);
|
|
@@ -561,8 +492,11 @@ function renderPrebuildFile(args) {
|
|
|
561
492
|
}
|
|
562
493
|
}
|
|
563
494
|
}
|
|
564
|
-
if (platform === "ios" && relativePath.endsWith("/Info.plist")
|
|
565
|
-
|
|
495
|
+
if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
|
|
496
|
+
var _app_ios1, _app_ios2;
|
|
497
|
+
var stamps = [];
|
|
498
|
+
if (schemes.length) {
|
|
499
|
+
stamps.push(` <key>CFBundleURLTypes</key>
|
|
566
500
|
<array>
|
|
567
501
|
<dict>
|
|
568
502
|
<key>CFBundleTypeRole</key>
|
|
@@ -570,12 +504,36 @@ function renderPrebuildFile(args) {
|
|
|
570
504
|
<key>CFBundleURLSchemes</key>
|
|
571
505
|
<array>
|
|
572
506
|
${schemes.map(function(scheme) {
|
|
573
|
-
|
|
574
|
-
|
|
507
|
+
return ` <string>${scheme}</string>`;
|
|
508
|
+
}).join("\n")}
|
|
575
509
|
</array>
|
|
576
510
|
</dict>
|
|
577
|
-
</array
|
|
578
|
-
|
|
511
|
+
</array>`);
|
|
512
|
+
}
|
|
513
|
+
if (((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.usesNonExemptEncryption) !== void 0) {
|
|
514
|
+
stamps.push(` <key>ITSAppUsesNonExemptEncryption</key>
|
|
515
|
+
<${app.ios.usesNonExemptEncryption ? "true" : "false"}/>`);
|
|
516
|
+
}
|
|
517
|
+
if ((_app_ios2 = app.ios) === null || _app_ios2 === void 0 ? void 0 : _app_ios2.fileSharing) {
|
|
518
|
+
stamps.push(` <key>UIFileSharingEnabled</key>
|
|
519
|
+
<true/>
|
|
520
|
+
<key>LSSupportsOpeningDocumentsInPlace</key>
|
|
521
|
+
<true/>`);
|
|
522
|
+
}
|
|
523
|
+
if (stamps.length) {
|
|
524
|
+
var anchor = " <key>LSRequiresIPhoneOS</key>";
|
|
525
|
+
if (!rendered.includes(anchor)) throw new Error(`[vxrn] prebuild template ${relativePath} lost its LSRequiresIPhoneOS anchor`);
|
|
526
|
+
rendered = rendered.replace(anchor, `${stamps.join("\n")}
|
|
527
|
+
${anchor}`);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && ((_app_imagePicker = app.imagePicker) === null || _app_imagePicker === void 0 ? void 0 : _app_imagePicker.camera) !== void 0) {
|
|
531
|
+
var anchor1 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
|
|
532
|
+
if (!rendered.includes(anchor1)) {
|
|
533
|
+
throw new Error("[vxrn] cannot stamp the camera permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
|
|
534
|
+
}
|
|
535
|
+
rendered = rendered.replace(anchor1, `${anchor1}
|
|
536
|
+
<uses-permission android:name="android.permission.CAMERA" />`);
|
|
579
537
|
}
|
|
580
538
|
if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && schemes.length) {
|
|
581
539
|
rendered = rendered.replace(" </activity>", ` <intent-filter>
|
|
@@ -589,24 +547,28 @@ ${schemes.map(function(scheme) {
|
|
|
589
547
|
</activity>`);
|
|
590
548
|
}
|
|
591
549
|
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
592
|
-
var
|
|
593
|
-
rendered = rendered.replace(/TARGETED_DEVICE_FAMILY = "1,2";/g, `TARGETED_DEVICE_FAMILY = "${((
|
|
550
|
+
var _app_ios3;
|
|
551
|
+
rendered = rendered.replace(/TARGETED_DEVICE_FAMILY = "1,2";/g, `TARGETED_DEVICE_FAMILY = "${((_app_ios3 = app.ios) === null || _app_ios3 === void 0 ? void 0 : _app_ios3.tablet) ? "1,2" : "1"}";`);
|
|
594
552
|
}
|
|
595
553
|
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
596
|
-
var
|
|
554
|
+
var _app_ios4;
|
|
597
555
|
if (app.version !== void 0) {
|
|
598
556
|
rendered = rendered.replace(/MARKETING_VERSION = [^;]+;/g, `MARKETING_VERSION = "${app.version}";`);
|
|
599
557
|
}
|
|
600
|
-
if (((
|
|
558
|
+
if (((_app_ios4 = app.ios) === null || _app_ios4 === void 0 ? void 0 : _app_ios4.buildNumber) !== void 0) {
|
|
601
559
|
rendered = rendered.replace(/CURRENT_PROJECT_VERSION = [^;]+;/g, `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`);
|
|
602
560
|
}
|
|
603
561
|
}
|
|
604
562
|
if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
|
|
605
|
-
var
|
|
606
|
-
if (((
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
563
|
+
var _app_imagePicker1;
|
|
564
|
+
if (((_app_imagePicker1 = app.imagePicker) === null || _app_imagePicker1 === void 0 ? void 0 : _app_imagePicker1.camera) !== void 0) {
|
|
565
|
+
var anchor2 = " <key>LSRequiresIPhoneOS</key>";
|
|
566
|
+
if (!rendered.includes(anchor2)) {
|
|
567
|
+
throw new Error("[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist");
|
|
568
|
+
}
|
|
569
|
+
rendered = rendered.replace(anchor2, ` <key>NSCameraUsageDescription</key>
|
|
570
|
+
<string>${escapeXml(app.imagePicker.camera)}</string>
|
|
571
|
+
${anchor2}`);
|
|
610
572
|
}
|
|
611
573
|
rendered = patchIosInfoPlistSceneManifest(rendered);
|
|
612
574
|
}
|
|
@@ -632,14 +594,14 @@ end`);
|
|
|
632
594
|
rendered = patchIosPbxprojSceneDelegate(rendered, appName);
|
|
633
595
|
}
|
|
634
596
|
if (platform === "ios" && relativePath === "Podfile") {
|
|
635
|
-
var
|
|
636
|
-
if ((
|
|
597
|
+
var _app_ios5, _app_ios6, _app_ios7;
|
|
598
|
+
if ((_app_ios5 = app.ios) === null || _app_ios5 === void 0 ? void 0 : _app_ios5.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'
|
|
637
599
|
${rendered}`;
|
|
638
|
-
if ((
|
|
600
|
+
if ((_app_ios6 = app.ios) === null || _app_ios6 === void 0 ? void 0 : _app_ios6.useFrameworks) {
|
|
639
601
|
rendered = rendered.replace(/^(platform :ios, .+)$/m, `$1
|
|
640
602
|
use_frameworks! :linkage => :${app.ios.useFrameworks}`);
|
|
641
603
|
}
|
|
642
|
-
if ((
|
|
604
|
+
if ((_app_ios7 = app.ios) === null || _app_ios7 === void 0 ? void 0 : _app_ios7.screensGamma) {
|
|
643
605
|
rendered = nativeProjectPatches.injectReactNativeScreensGammaIntoPodfile(rendered);
|
|
644
606
|
}
|
|
645
607
|
rendered = nativeProjectPatches.injectFmtCxx17FixIntoPodfile(rendered);
|