vxrn 2.7.2 → 2.7.4

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.
@@ -2029,12 +2029,20 @@ ${stamps2.join("\n")}`);
2029
2029
  rendered = rendered.replace(anchor3, `${anchor3}
2030
2030
  <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />`);
2031
2031
  }
2032
- if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.notifications !== void 0) {
2032
+ if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.brightness === true) {
2033
2033
  var anchor4 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2034
2034
  if (!rendered.includes(anchor4)) {
2035
+ throw new Error("[vxrn] cannot stamp the brightness permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
2036
+ }
2037
+ rendered = rendered.replace(anchor4, `${anchor4}
2038
+ <uses-permission android:name="android.permission.WRITE_SETTINGS" />`);
2039
+ }
2040
+ if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.notifications !== void 0) {
2041
+ var anchor5 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2042
+ if (!rendered.includes(anchor5)) {
2035
2043
  throw new Error("[vxrn] cannot stamp notification permissions: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
2036
2044
  }
2037
- rendered = rendered.replace(anchor4, [anchor4, ...notificationsHost.androidPermissions.map(function(permission) {
2045
+ rendered = rendered.replace(anchor5, [anchor5, ...notificationsHost.androidPermissions.map(function(permission) {
2038
2046
  return ` <uses-permission android:name="${permission}" />`;
2039
2047
  })].join("\n"));
2040
2048
  if (!rendered.includes(notificationsHost.androidPermissions[0])) {
@@ -2052,8 +2060,8 @@ ${stamps2.join("\n")}`);
2052
2060
  }
2053
2061
  }
2054
2062
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && ((_app_notifications = app.notifications) === null || _app_notifications === void 0 ? void 0 : _app_notifications.push) === true) {
2055
- var anchor5 = notificationsHost.receiver;
2056
- if (!rendered.includes(anchor5)) {
2063
+ var anchor6 = notificationsHost.receiver;
2064
+ if (!rendered.includes(anchor6)) {
2057
2065
  throw new Error("[vxrn] cannot stamp the push service: expected the notification receiver in app/src/main/AndroidManifest.xml");
2058
2066
  }
2059
2067
  rendered = rendered.replace(" </receiver>\n </application>", ` </receiver>
@@ -2069,8 +2077,8 @@ ${stamps2.join("\n")}`);
2069
2077
  }
2070
2078
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && (app.audio !== void 0 || app.photoLibrary !== void 0 || app.contacts !== void 0 || app.calendar !== void 0 || ((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.backgroundTasks) !== void 0)) {
2071
2079
  var _app_audio1, _app_photoLibrary1, _app_photoLibrary2, _app_calendar, _app_calendar1, _app_audio2, _app_calendar2, _app_photoLibrary3, _app_audio3, _app_ios11;
2072
- var anchor6 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2073
- if (!rendered.includes(anchor6)) {
2080
+ var anchor7 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2081
+ if (!rendered.includes(anchor7)) {
2074
2082
  throw new Error("[vxrn] cannot stamp media permissions: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
2075
2083
  }
2076
2084
  var stamps3 = [];
@@ -2101,7 +2109,7 @@ ${stamps2.join("\n")}`);
2101
2109
  stamps3.push(" <uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />", " <uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK\" />");
2102
2110
  }
2103
2111
  if (stamps3.length) {
2104
- rendered = rendered.replace(anchor6, `${anchor6}
2112
+ rendered = rendered.replace(anchor7, `${anchor7}
2105
2113
  ${stamps3.join("\n")}`);
2106
2114
  }
2107
2115
  var appStamps = [];
@@ -2138,8 +2146,8 @@ ${appAnchor}`);
2138
2146
  rendered = patchAndroidMainApplicationUpdatesHost(rendered);
2139
2147
  }
2140
2148
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.updates !== void 0) {
2141
- var anchor7 = " </application>";
2142
- if (!rendered.includes(anchor7)) {
2149
+ var anchor8 = " </application>";
2150
+ if (!rendered.includes(anchor8)) {
2143
2151
  throw new Error("[vxrn] cannot stamp the updates config: expected </application> in app/src/main/AndroidManifest.xml");
2144
2152
  }
2145
2153
  var stamps4 = [];
@@ -2147,8 +2155,8 @@ ${appAnchor}`);
2147
2155
  stamps4.push(` <meta-data android:name="dev.onejs.updates.url" android:value="${escapeXml(app.updates.url)}" />`);
2148
2156
  }
2149
2157
  stamps4.push(" <meta-data android:name=\"dev.onejs.updates.runtimeVersion\" android:value=\"@string/one_updates_runtime_version\" />");
2150
- rendered = rendered.replace(anchor7, `${stamps4.join("\n")}
2151
- ${anchor7}`);
2158
+ rendered = rendered.replace(anchor8, `${stamps4.join("\n")}
2159
+ ${anchor8}`);
2152
2160
  }
2153
2161
  if (platform === "android" && relativePath === "app/src/main/res/values/strings.xml" && app.updates !== void 0) {
2154
2162
  var version = app.updates.runtimeVersion.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
@@ -2156,12 +2164,12 @@ ${anchor7}`);
2156
2164
  </resources>`);
2157
2165
  }
2158
2166
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && ((_app_android = app.android) === null || _app_android === void 0 ? void 0 : _app_android.googleMapsApiKey) !== void 0) {
2159
- var anchor8 = " </application>";
2160
- if (!rendered.includes(anchor8)) {
2167
+ var anchor9 = " </application>";
2168
+ if (!rendered.includes(anchor9)) {
2161
2169
  throw new Error("[vxrn] cannot stamp the maps api key: expected </application> in app/src/main/AndroidManifest.xml");
2162
2170
  }
2163
- rendered = rendered.replace(anchor8, ` <meta-data android:name="com.google.android.geo.API_KEY" android:value="${escapeXml(app.android.googleMapsApiKey)}" />
2164
- ${anchor8}`);
2171
+ rendered = rendered.replace(anchor9, ` <meta-data android:name="com.google.android.geo.API_KEY" android:value="${escapeXml(app.android.googleMapsApiKey)}" />
2172
+ ${anchor9}`);
2165
2173
  }
2166
2174
  if (platform === "android" && relativePath === "gradle.properties" && ((_app_notifications1 = app.notifications) === null || _app_notifications1 === void 0 ? void 0 : _app_notifications1.push) === true) {
2167
2175
  var line = `${notificationsHost.pushGradleProperty}=true`;
@@ -2195,8 +2203,8 @@ ${line1}
2195
2203
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && (((_app_android2 = app.android) === null || _app_android2 === void 0 ? void 0 : (_app_android_permissions = _app_android2.permissions) === null || _app_android_permissions === void 0 ? void 0 : _app_android_permissions.length) || ((_app_android3 = app.android) === null || _app_android3 === void 0 ? void 0 : (_app_android_blockedPermissions = _app_android3.blockedPermissions) === null || _app_android_blockedPermissions === void 0 ? void 0 : _app_android_blockedPermissions.length))) {
2196
2204
  var _ref3, _ref4;
2197
2205
  var _app_android8, _app_android9, _app_android_blockedPermissions1, _app_android10;
2198
- var anchor9 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2199
- if (!rendered.includes(anchor9)) {
2206
+ var anchor10 = "<uses-permission android:name=\"android.permission.INTERNET\" />";
2207
+ if (!rendered.includes(anchor10)) {
2200
2208
  throw new Error("[vxrn] cannot stamp permissions: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
2201
2209
  }
2202
2210
  var permissionName = function permissionName2(name) {
@@ -2207,7 +2215,7 @@ ${line1}
2207
2215
  }), ...((_ref4 = (_app_android9 = app.android) === null || _app_android9 === void 0 ? void 0 : _app_android9.blockedPermissions) !== null && _ref4 !== void 0 ? _ref4 : []).map(function(name) {
2208
2216
  return ` <uses-permission android:name="${permissionName(name)}" tools:node="remove" />`;
2209
2217
  })];
2210
- rendered = rendered.replace(anchor9, `${anchor9}
2218
+ rendered = rendered.replace(anchor10, `${anchor10}
2211
2219
  ${lines.join("\n")}`);
2212
2220
  if (((_app_android10 = app.android) === null || _app_android10 === void 0 ? void 0 : (_app_android_blockedPermissions1 = _app_android10.blockedPermissions) === null || _app_android_blockedPermissions1 === void 0 ? void 0 : _app_android_blockedPermissions1.length) && !rendered.includes("xmlns:tools=")) {
2213
2221
  rendered = rendered.replace("xmlns:android=\"http://schemas.android.com/apk/res/android\"", "xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"");
@@ -2226,19 +2234,19 @@ ${app.android.appLinks.map(function(link) {
2226
2234
  </activity>`);
2227
2235
  }
2228
2236
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.orientation !== void 0) {
2229
- var anchor10 = "android:name=\".MainActivity\"";
2230
- if (!rendered.includes(anchor10)) {
2237
+ var anchor11 = "android:name=\".MainActivity\"";
2238
+ if (!rendered.includes(anchor11)) {
2231
2239
  throw new Error("[vxrn] cannot stamp the orientation: expected .MainActivity in app/src/main/AndroidManifest.xml");
2232
2240
  }
2233
- rendered = rendered.replace(anchor10, `${anchor10}
2241
+ rendered = rendered.replace(anchor11, `${anchor11}
2234
2242
  android:screenOrientation="${app.orientation === "default" ? "unspecified" : app.orientation}"`);
2235
2243
  }
2236
2244
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.pictureInPicture) {
2237
- var anchor11 = "android:name=\".MainActivity\"";
2238
- if (!rendered.includes(anchor11)) {
2245
+ var anchor12 = "android:name=\".MainActivity\"";
2246
+ if (!rendered.includes(anchor12)) {
2239
2247
  throw new Error("[vxrn] cannot stamp picture in picture: expected .MainActivity in app/src/main/AndroidManifest.xml");
2240
2248
  }
2241
- rendered = rendered.replace(anchor11, `${anchor11}
2249
+ rendered = rendered.replace(anchor12, `${anchor12}
2242
2250
  android:supportsPictureInPicture="true"`);
2243
2251
  }
2244
2252
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && schemes.length) {
@@ -2266,12 +2274,12 @@ ${schemes.map(function(scheme) {
2266
2274
  }
2267
2275
  }
2268
2276
  if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj") && ((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.alternateIcons) !== void 0) {
2269
- var anchor12 = "ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;";
2270
- if (!rendered.includes(anchor12)) {
2277
+ var anchor13 = "ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;";
2278
+ if (!rendered.includes(anchor13)) {
2271
2279
  throw new Error("[vxrn] prebuild template lost its primary app icon build setting");
2272
2280
  }
2273
2281
  var names = Object.keys(app.ios.alternateIcons).sort().join(" ");
2274
- rendered = rendered.replaceAll(anchor12, `${anchor12}
2282
+ rendered = rendered.replaceAll(anchor13, `${anchor13}
2275
2283
  ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "${names}";`);
2276
2284
  }
2277
2285
  if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
@@ -2351,16 +2359,16 @@ ${schemes.map(function(scheme) {
2351
2359
  }
2352
2360
  }
2353
2361
  if (additions.length) {
2354
- var anchor13 = " <key>LSRequiresIPhoneOS</key>";
2355
- if (!rendered.includes(anchor13)) {
2362
+ var anchor14 = " <key>LSRequiresIPhoneOS</key>";
2363
+ if (!rendered.includes(anchor14)) {
2356
2364
  throw new Error(`[vxrn] cannot stamp ${additions[0][0]}: expected LSRequiresIPhoneOS in Info.plist`);
2357
2365
  }
2358
- rendered = rendered.replace(anchor13, `${additions.map(function(param) {
2366
+ rendered = rendered.replace(anchor14, `${additions.map(function(param) {
2359
2367
  var [key, text] = param;
2360
2368
  return ` <key>${key}</key>
2361
2369
  <string>${escapeXml(text)}</string>
2362
2370
  `;
2363
- }).join("")}${anchor13}`);
2371
+ }).join("")}${anchor14}`);
2364
2372
  }
2365
2373
  rendered = rendered.replace(/\t<key>NS\w+UsageDescription<\/key>\s*<string><\/string>\n/g, "");
2366
2374
  rendered = patchIosInfoPlistSceneManifest(rendered);
@@ -2489,11 +2497,11 @@ use_frameworks! :linkage => :${app.ios.useFrameworks}`);
2489
2497
  var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
2490
2498
  try {
2491
2499
  for (var _iterator3 = edits[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
2492
- var [file, anchor14, insertion] = _step3.value;
2500
+ var [file, anchor15, insertion] = _step3.value;
2493
2501
  if (relativePath !== file) continue;
2494
- var next = insertAfterLine(rendered, anchor14, insertion);
2502
+ var next = insertAfterLine(rendered, anchor15, insertion);
2495
2503
  if (next === rendered) {
2496
- throw new Error(`[vxrn] prebuild template ${file} lost its ${anchor14} anchor`);
2504
+ throw new Error(`[vxrn] prebuild template ${file} lost its ${anchor15} anchor`);
2497
2505
  }
2498
2506
  rendered = next;
2499
2507
  }