@capacitor/cli 7.0.0-rc.0 → 7.0.0

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.
Binary file
Binary file
Binary file
@@ -138,6 +138,10 @@ async function migrateCommand(config, noprompt, packagemanager) {
138
138
  log_1.logger.warn('Skipped Running cap sync.');
139
139
  }
140
140
  if (allDependencies['@capacitor/android'] && (0, fs_extra_1.existsSync)(config.android.platformDirAbs)) {
141
+ // AndroidManifest.xml add navigation"
142
+ await (0, common_2.runTask)(`Migrating AndroidManifest.xml by adding navigation to Activity configChanges.`, () => {
143
+ return updateAndroidManifest((0, path_1.join)(config.android.srcMainDirAbs, 'AndroidManifest.xml'));
144
+ });
141
145
  const gradleWrapperVersion = getGradleWrapperVersion((0, path_1.join)(config.android.platformDirAbs, 'gradle', 'wrapper', 'gradle-wrapper.properties'));
142
146
  if (!installFailed && (0, semver_1.gte)(gradleVersion, gradleWrapperVersion)) {
143
147
  try {
@@ -494,6 +498,17 @@ function setAllStringIn(data, start, end, replacement) {
494
498
  }
495
499
  return result;
496
500
  }
501
+ async function updateAndroidManifest(filename) {
502
+ const txt = readFile(filename);
503
+ if (!txt) {
504
+ return;
505
+ }
506
+ if (txt.includes('navigation')) {
507
+ return; // Probably already updated
508
+ }
509
+ const replaced = txt.replace('android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"', 'android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"');
510
+ (0, fs_extra_1.writeFileSync)(filename, replaced, 'utf-8');
511
+ }
497
512
  async function patchOldCapacitorPlugins(config) {
498
513
  const allPlugins = await (0, plugin_1.getPlugins)(config, 'android');
499
514
  const androidPlugins = await (0, common_1.getAndroidPlugins)(allPlugins);
@@ -518,26 +533,3 @@ async function patchOldCapacitorPlugins(config) {
518
533
  }));
519
534
  }
520
535
  exports.patchOldCapacitorPlugins = patchOldCapacitorPlugins;
521
- async function removeKey(filename, key) {
522
- const txt = readFile(filename);
523
- if (!txt) {
524
- return;
525
- }
526
- let lines = txt.split('\n');
527
- let removed = false;
528
- let removing = false;
529
- lines = lines.filter((line) => {
530
- if (removing && line.includes('</string>')) {
531
- removing = false;
532
- return false;
533
- }
534
- if (line.includes(`<key>${key}</key`)) {
535
- removing = true;
536
- removed = true;
537
- }
538
- return !removing;
539
- });
540
- if (removed) {
541
- (0, fs_extra_1.writeFileSync)(filename, lines.join('\n'), 'utf-8');
542
- }
543
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "7.0.0-rc.0",
3
+ "version": "7.0.0",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",