@capacitor/android 7.0.0-alpha.1 → 7.0.0-alpha.2

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.
@@ -1,13 +1,13 @@
1
1
  ext {
2
- androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.8.0'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
2
+ androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.9.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
4
  androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
5
- androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0'
6
- androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.6.2'
7
- androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.9.0'
5
+ androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.15.0'
6
+ androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.8.4'
7
+ androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.12.1'
8
8
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
9
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
10
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
9
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
10
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
11
11
  cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '10.1.1'
12
12
  }
13
13
 
@@ -90,7 +90,7 @@ dependencies {
90
90
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
91
91
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
92
92
  implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
93
- testImplementation 'org.json:json:20231013'
94
- testImplementation 'org.mockito:mockito-inline:5.2.0'
93
+ testImplementation 'org.json:json:20240303'
94
+ testImplementation 'org.mockito:mockito-core:5.14.1'
95
95
  }
96
96
 
@@ -142,9 +142,7 @@ var nativeBridge = (function (exports) {
142
142
  const CAPACITOR_HTTP_INTERCEPTOR = '/_capacitor_http_interceptor_';
143
143
  const CAPACITOR_HTTP_INTERCEPTOR_URL_PARAM = 'u';
144
144
  // TODO: export as Cap function
145
- const isRelativeOrProxyUrl = (url) => !url ||
146
- !(url.startsWith('http:') || url.startsWith('https:')) ||
147
- url.indexOf(CAPACITOR_HTTP_INTERCEPTOR) > -1;
145
+ const isRelativeOrProxyUrl = (url) => !url || !(url.startsWith('http:') || url.startsWith('https:')) || url.indexOf(CAPACITOR_HTTP_INTERCEPTOR) > -1;
148
146
  // TODO: export as Cap function
149
147
  const createProxyUrl = (url, win) => {
150
148
  var _a, _b;
@@ -174,11 +172,10 @@ var nativeBridge = (function (exports) {
174
172
  return webviewServerUrl + '/_capacitor_file_' + filePath;
175
173
  }
176
174
  else if (filePath.startsWith('file://')) {
177
- return (webviewServerUrl + filePath.replace('file://', '/_capacitor_file_'));
175
+ return webviewServerUrl + filePath.replace('file://', '/_capacitor_file_');
178
176
  }
179
177
  else if (filePath.startsWith('content://')) {
180
- return (webviewServerUrl +
181
- filePath.replace('content:/', '/_capacitor_content_'));
178
+ return webviewServerUrl + filePath.replace('content:/', '/_capacitor_content_');
182
179
  }
183
180
  }
184
181
  return filePath;
@@ -289,9 +286,6 @@ var nativeBridge = (function (exports) {
289
286
  return docAddEventListener.apply(doc, args);
290
287
  };
291
288
  }
292
- // deprecated in v3, remove from v4
293
- cap.platform = cap.getPlatform();
294
- cap.isNative = cap.isNativePlatform();
295
289
  win.Capacitor = cap;
296
290
  };
297
291
  const initVendor = (win, cap) => {
@@ -321,27 +315,14 @@ var nativeBridge = (function (exports) {
321
315
  win.Ionic.WebView = IonicWebView;
322
316
  };
323
317
  const initLogger = (win, cap) => {
324
- const BRIDGED_CONSOLE_METHODS = [
325
- 'debug',
326
- 'error',
327
- 'info',
328
- 'log',
329
- 'trace',
330
- 'warn',
331
- ];
318
+ const BRIDGED_CONSOLE_METHODS = ['debug', 'error', 'info', 'log', 'trace', 'warn'];
332
319
  const createLogFromNative = (c) => (result) => {
333
320
  if (isFullConsole(c)) {
334
321
  const success = result.success === true;
335
322
  const tagStyles = success
336
323
  ? 'font-style: italic; font-weight: lighter; color: gray'
337
324
  : 'font-style: italic; font-weight: lighter; color: red';
338
- c.groupCollapsed('%cresult %c' +
339
- result.pluginId +
340
- '.' +
341
- result.methodName +
342
- ' (#' +
343
- result.callbackId +
344
- ')', tagStyles, 'font-style: italic; font-weight: bold; color: #444');
325
+ c.groupCollapsed('%cresult %c' + result.pluginId + '.' + result.methodName + ' (#' + result.callbackId + ')', tagStyles, 'font-style: italic; font-weight: bold; color: #444');
345
326
  if (result.success === false) {
346
327
  c.error(result.error);
347
328
  }
@@ -361,13 +342,7 @@ var nativeBridge = (function (exports) {
361
342
  };
362
343
  const createLogToNative = (c) => (call) => {
363
344
  if (isFullConsole(c)) {
364
- c.groupCollapsed('%cnative %c' +
365
- call.pluginId +
366
- '.' +
367
- call.methodName +
368
- ' (#' +
369
- call.callbackId +
370
- ')', 'font-weight: lighter; color: gray', 'font-weight: bold; color: #000');
345
+ c.groupCollapsed('%cnative %c' + call.pluginId + '.' + call.methodName + ' (#' + call.callbackId + ')', 'font-weight: lighter; color: gray', 'font-weight: bold; color: #000');
371
346
  c.dir(call);
372
347
  c.groupEnd();
373
348
  }
@@ -379,9 +354,7 @@ var nativeBridge = (function (exports) {
379
354
  if (!c) {
380
355
  return false;
381
356
  }
382
- return (typeof c.groupCollapsed === 'function' ||
383
- typeof c.groupEnd === 'function' ||
384
- typeof c.dir === 'function');
357
+ return typeof c.groupCollapsed === 'function' || typeof c.groupEnd === 'function' || typeof c.dir === 'function';
385
358
  };
386
359
  const serializeConsoleMessage = (msg) => {
387
360
  try {
@@ -440,9 +413,7 @@ var nativeBridge = (function (exports) {
440
413
  set: function (val) {
441
414
  const cookiePairs = val.split(';');
442
415
  const domainSection = val.toLowerCase().split('domain=')[1];
443
- const domain = cookiePairs.length > 1 &&
444
- domainSection != null &&
445
- domainSection.length > 0
416
+ const domain = cookiePairs.length > 1 && domainSection != null && domainSection.length > 0
446
417
  ? domainSection.split(';')[0].trim()
447
418
  : '';
448
419
  if (platform === 'ios') {
@@ -527,8 +498,7 @@ var nativeBridge = (function (exports) {
527
498
  dataType: type,
528
499
  headers: Object.assign(Object.assign({}, headers), optionHeaders),
529
500
  });
530
- const contentType = nativeResponse.headers['Content-Type'] ||
531
- nativeResponse.headers['content-type'];
501
+ const contentType = nativeResponse.headers['Content-Type'] || nativeResponse.headers['content-type'];
532
502
  let data = (contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json'))
533
503
  ? JSON.stringify(nativeResponse.data)
534
504
  : nativeResponse.data;
@@ -570,8 +540,7 @@ var nativeBridge = (function (exports) {
570
540
  },
571
541
  });
572
542
  const prototype = win.CapacitorWebXMLHttpRequest.prototype;
573
- const isProgressEventAvailable = () => typeof ProgressEvent !== 'undefined' &&
574
- ProgressEvent.prototype instanceof Event;
543
+ const isProgressEventAvailable = () => typeof ProgressEvent !== 'undefined' && ProgressEvent.prototype instanceof Event;
575
544
  // XHR patch abort
576
545
  prototype.abort = function () {
577
546
  if (isRelativeOrProxyUrl(this._url)) {
@@ -652,9 +621,7 @@ var nativeBridge = (function (exports) {
652
621
  },
653
622
  });
654
623
  convertBody(body).then(({ data, type, headers }) => {
655
- const otherHeaders = this._headers != null && Object.keys(this._headers).length > 0
656
- ? this._headers
657
- : undefined;
624
+ const otherHeaders = this._headers != null && Object.keys(this._headers).length > 0 ? this._headers : undefined;
658
625
  // intercept request & pass to the bridge
659
626
  cap
660
627
  .nativePromise('CapacitorHttp', 'request', {
@@ -678,8 +645,7 @@ var nativeBridge = (function (exports) {
678
645
  }
679
646
  this._headers = nativeResponse.headers;
680
647
  this.status = nativeResponse.status;
681
- if (this.responseType === '' ||
682
- this.responseType === 'text') {
648
+ if (this.responseType === '' || this.responseType === 'text') {
683
649
  this.response =
684
650
  typeof nativeResponse.data !== 'string'
685
651
  ? JSON.stringify(nativeResponse.data)
@@ -688,8 +654,7 @@ var nativeBridge = (function (exports) {
688
654
  else {
689
655
  this.response = nativeResponse.data;
690
656
  }
691
- this.responseText = ((_a = (nativeResponse.headers['Content-Type'] ||
692
- nativeResponse.headers['content-type'])) === null || _a === void 0 ? void 0 : _a.startsWith('application/json'))
657
+ this.responseText = ((_a = (nativeResponse.headers['Content-Type'] || nativeResponse.headers['content-type'])) === null || _a === void 0 ? void 0 : _a.startsWith('application/json'))
693
658
  ? JSON.stringify(nativeResponse.data)
694
659
  : nativeResponse.data;
695
660
  this.responseURL = nativeResponse.url;
@@ -805,7 +770,7 @@ var nativeBridge = (function (exports) {
805
770
  };
806
771
  cap.logToNative = createLogToNative(win.console);
807
772
  cap.logFromNative = createLogFromNative(win.console);
808
- cap.handleError = err => win.console.error(err);
773
+ cap.handleError = (err) => win.console.error(err);
809
774
  win.Capacitor = cap;
810
775
  };
811
776
  function initNativeBridge(win) {
@@ -814,7 +779,7 @@ var nativeBridge = (function (exports) {
814
779
  const callbacks = new Map();
815
780
  const webviewServerUrl = typeof win.WEBVIEW_SERVER_URL === 'string' ? win.WEBVIEW_SERVER_URL : '';
816
781
  cap.getServerUrl = () => webviewServerUrl;
817
- cap.convertFileSrc = filePath => convertFileSrcServerUrl(webviewServerUrl, filePath);
782
+ cap.convertFileSrc = (filePath) => convertFileSrcServerUrl(webviewServerUrl, filePath);
818
783
  // Counter of callback ids, randomized to avoid
819
784
  // any issues during reloads if a call comes back with
820
785
  // an existing callback id from an old session
@@ -823,12 +788,12 @@ var nativeBridge = (function (exports) {
823
788
  const isNativePlatform = () => true;
824
789
  const getPlatform = () => getPlatformId(win);
825
790
  cap.getPlatform = getPlatform;
826
- cap.isPluginAvailable = name => Object.prototype.hasOwnProperty.call(cap.Plugins, name);
791
+ cap.isPluginAvailable = (name) => Object.prototype.hasOwnProperty.call(cap.Plugins, name);
827
792
  cap.isNativePlatform = isNativePlatform;
828
793
  // create the postToNative() fn if needed
829
794
  if (getPlatformId(win) === 'android') {
830
795
  // android platform
831
- postToNative = data => {
796
+ postToNative = (data) => {
832
797
  var _a;
833
798
  try {
834
799
  win.androidBridge.postMessage(JSON.stringify(data));
@@ -840,7 +805,7 @@ var nativeBridge = (function (exports) {
840
805
  }
841
806
  else if (getPlatformId(win) === 'ios') {
842
807
  // ios platform
843
- postToNative = data => {
808
+ postToNative = (data) => {
844
809
  var _a;
845
810
  try {
846
811
  data.type = data.type ? data.type : 'message';
@@ -885,8 +850,7 @@ var nativeBridge = (function (exports) {
885
850
  if (typeof postToNative === 'function') {
886
851
  let callbackId = '-1';
887
852
  if (storedCallback &&
888
- (typeof storedCallback.callback === 'function' ||
889
- typeof storedCallback.resolve === 'function')) {
853
+ (typeof storedCallback.callback === 'function' || typeof storedCallback.resolve === 'function')) {
890
854
  // store the call for later lookup
891
855
  callbackId = String(++callbackIdCount);
892
856
  callbacks.set(callbackId, storedCallback);
@@ -921,7 +885,7 @@ var nativeBridge = (function (exports) {
921
885
  /**
922
886
  * Process a response from the native layer.
923
887
  */
924
- cap.fromNative = result => {
888
+ cap.fromNative = (result) => {
925
889
  returnResult(result);
926
890
  };
927
891
  const returnResult = (result) => {
@@ -143,7 +143,7 @@ public class UriMatcher {
143
143
  int lj = list.size();
144
144
  for (int j = 0; j < lj; j++) {
145
145
  UriMatcher n = list.get(j);
146
- which_switch:switch (n.mWhich) {
146
+ which_switch: switch (n.mWhich) {
147
147
  case MASK:
148
148
  if (HostMask.Parser.parse(n.mText).matches(u)) {
149
149
  node = n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-alpha.2",
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)",
@@ -23,7 +23,7 @@
23
23
  "verify": "./gradlew clean lint build test -b capacitor/build.gradle"
24
24
  },
25
25
  "peerDependencies": {
26
- "@capacitor/core": "^7.0.0-alpha.1"
26
+ "@capacitor/core": "^7.0.0-alpha.2"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"