@capacitor/android 5.0.0-beta.1 → 5.0.0-beta.3

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()
@@ -21,7 +22,7 @@ buildscript {
21
22
  }
22
23
  }
23
24
  dependencies {
24
- classpath 'com.android.tools.build:gradle:7.4.1'
25
+ classpath 'com.android.tools.build:gradle:8.0.0'
25
26
 
26
27
  if (System.getenv("CAP_PUBLISH") == "true") {
27
28
  classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
@@ -63,8 +64,8 @@ android {
63
64
  lintConfig file('lint.xml')
64
65
  }
65
66
  compileOptions {
66
- sourceCompatibility JavaVersion.VERSION_11
67
- targetCompatibility JavaVersion.VERSION_11
67
+ sourceCompatibility JavaVersion.VERSION_17
68
+ targetCompatibility JavaVersion.VERSION_17
68
69
  }
69
70
  }
70
71
 
@@ -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 {
@@ -275,12 +275,8 @@ public class CapConfig {
275
275
  String logBehavior = JSONUtils.getString(
276
276
  configJSON,
277
277
  "android.loggingBehavior",
278
- JSONUtils.getString(configJSON, "loggingBehavior", null)
278
+ JSONUtils.getString(configJSON, "loggingBehavior", LOG_BEHAVIOR_DEBUG)
279
279
  );
280
- if (logBehavior == null) {
281
- boolean hideLogs = JSONUtils.getBoolean(configJSON, "android.hideLogs", JSONUtils.getBoolean(configJSON, "hideLogs", false));
282
- logBehavior = hideLogs ? LOG_BEHAVIOR_NONE : LOG_BEHAVIOR_DEBUG;
283
- }
284
280
  switch (logBehavior.toLowerCase(Locale.ROOT)) {
285
281
  case LOG_BEHAVIOR_PRODUCTION:
286
282
  loggingEnabled = true;
@@ -20,15 +20,18 @@ 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);
25
23
  super.load();
26
24
  }
27
25
 
28
26
  @JavascriptInterface
29
27
  public boolean isEnabled() {
30
28
  PluginConfig pluginConfig = getBridge().getConfig().getPluginConfiguration("CapacitorCookies");
31
- return pluginConfig.getBoolean("enabled", false);
29
+ boolean isEnabled = pluginConfig.getBoolean("enabled", false);
30
+ if (isEnabled) {
31
+ this.cookieManager = new CapacitorCookieManager(null, java.net.CookiePolicy.ACCEPT_ALL, this.bridge);
32
+ CookieHandler.setDefault(cookieManager);
33
+ }
34
+ return isEnabled;
32
35
  }
33
36
 
34
37
  /**
@@ -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.1",
3
+ "version": "5.0.0-beta.3",
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-beta.0"
26
+ "@capacitor/core": "^5.0.0-beta.2"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "354ffd2062b1c20951bdc9539d99e6c37f54675e"
31
+ "gitHead": "60ffcc36bc4948876b94f1f7a0470c68b6a7e50f"
32
32
  }