@capacitor/android 5.0.0-beta.0 → 5.0.0-beta.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,10 +1,10 @@
1
1
  ext {
2
- androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.6.1'
2
+ androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.7.0'
3
3
  androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
4
  androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
5
- androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.9.0'
6
- androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.5.5'
7
- androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.6.0'
5
+ androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.10.0'
6
+ androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.5.6'
7
+ androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.6.1'
8
8
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
9
9
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
10
10
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
@@ -13,6 +13,7 @@ ext {
13
13
 
14
14
 
15
15
  buildscript {
16
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.8.20'
16
17
  repositories {
17
18
  google()
18
19
  mavenCentral()
@@ -75,6 +76,7 @@ repositories {
75
76
 
76
77
  dependencies {
77
78
  implementation fileTree(dir: 'libs', include: ['*.jar'])
79
+ implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version")
78
80
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
79
81
  implementation "androidx.core:core:$androidxCoreVersion"
80
82
  implementation "androidx.activity:activity:$androidxActivityVersion"
@@ -396,6 +396,14 @@ var nativeBridge = (function (exports) {
396
396
  headers: nativeResponse.headers,
397
397
  status: nativeResponse.status,
398
398
  });
399
+ /*
400
+ * copy url to response, `cordova-plugin-ionic` uses this url from the response
401
+ * we need `Object.defineProperty` because url is an inherited getter on the Response
402
+ * see: https://stackoverflow.com/a/57382543
403
+ * */
404
+ Object.defineProperty(response, 'url', {
405
+ value: nativeResponse.url,
406
+ });
399
407
  console.timeEnd(tag);
400
408
  return response;
401
409
  }
@@ -525,10 +533,9 @@ var nativeBridge = (function (exports) {
525
533
  this._headers = nativeResponse.headers;
526
534
  this.status = nativeResponse.status;
527
535
  this.response = nativeResponse.data;
528
- this.responseText =
529
- !nativeResponse.headers['Content-Type'].startsWith('application/json')
530
- ? nativeResponse.data
531
- : JSON.stringify(nativeResponse.data);
536
+ this.responseText = !nativeResponse.headers['Content-Type'].startsWith('application/json')
537
+ ? nativeResponse.data
538
+ : JSON.stringify(nativeResponse.data);
532
539
  this.responseURL = nativeResponse.url;
533
540
  this.readyState = 4;
534
541
  this.dispatchEvent(new Event('load'));
@@ -383,7 +383,7 @@ public class Bridge {
383
383
 
384
384
  Uri appUri = Uri.parse(appUrl);
385
385
  if (
386
- !(url.getHost().equals(appUri.getHost()) && url.getScheme().equals(appUri.getScheme())) &&
386
+ !(appUri.getHost().equals(url.getHost()) && url.getScheme().equals(appUri.getScheme())) &&
387
387
  !appAllowNavigationMask.matches(url.getHost())
388
388
  ) {
389
389
  try {
@@ -20,8 +20,10 @@ public class CapacitorCookies extends Plugin {
20
20
  @Override
21
21
  public void load() {
22
22
  this.bridge.getWebView().addJavascriptInterface(this, "CapacitorCookiesAndroidInterface");
23
- this.cookieManager = new CapacitorCookieManager(null, java.net.CookiePolicy.ACCEPT_ALL, this.bridge);
24
- CookieHandler.setDefault(cookieManager);
23
+ if (isEnabled()) {
24
+ this.cookieManager = new CapacitorCookieManager(null, java.net.CookiePolicy.ACCEPT_ALL, this.bridge);
25
+ CookieHandler.setDefault(cookieManager);
26
+ }
25
27
  super.load();
26
28
  }
27
29
 
@@ -338,7 +338,6 @@ public class CapacitorHttpUrlConnection implements ICapacitorHttpUrlConnection {
338
338
  * This is called as early as possible to allow overrides by user-provided values.
339
339
  */
340
340
  private void setDefaultRequestProperties() {
341
- connection.setRequestProperty("Accept-Charset", StandardCharsets.UTF_8.name());
342
341
  String acceptLanguage = buildDefaultAcceptLanguageProperty();
343
342
  if (!TextUtils.isEmpty(acceptLanguage)) {
344
343
  connection.setRequestProperty("Accept-Language", acceptLanguage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "5.0.0-beta.0",
3
+ "version": "5.0.0-beta.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,10 +23,10 @@
23
23
  "verify": "./gradlew clean lint build test -b capacitor/build.gradle"
24
24
  },
25
25
  "peerDependencies": {
26
- "@capacitor/core": "^5.0.0-alpha.1"
26
+ "@capacitor/core": "^5.0.0-beta.1"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "51a548b97129998de8c403b2a8eb0421135af812"
31
+ "gitHead": "80b59984c0bf07e0c2d2a6310f7a7ff2679606ab"
32
32
  }