@capacitor/android 5.3.1-nightly-20230914T150514.0 → 5.4.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.
@@ -1,10 +1,10 @@
1
1
  ext {
2
- androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.7.2'
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.10.1'
6
- androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.6.1'
7
- androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.7.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,7 +13,7 @@ ext {
13
13
 
14
14
 
15
15
  buildscript {
16
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10'
16
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.8.20'
17
17
  repositories {
18
18
  google()
19
19
  mavenCentral()
@@ -22,7 +22,7 @@ buildscript {
22
22
  }
23
23
  }
24
24
  dependencies {
25
- classpath 'com.android.tools.build:gradle:8.1.1'
25
+ classpath 'com.android.tools.build:gradle:8.0.0'
26
26
 
27
27
  if (System.getenv("CAP_PUBLISH") == "true") {
28
28
  classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
@@ -42,10 +42,10 @@ if (System.getenv("CAP_PUBLISH") == "true") {
42
42
 
43
43
  android {
44
44
  namespace "com.getcapacitor.android"
45
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
45
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
46
46
  defaultConfig {
47
47
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
48
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
48
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
49
49
  versionCode 1
50
50
  versionName "1.0"
51
51
  consumerProguardFiles 'proguard-rules.pro'
@@ -424,22 +424,21 @@ var nativeBridge = (function (exports) {
424
424
  if (doPatchHttp) {
425
425
  // fetch patch
426
426
  window.fetch = async (resource, options) => {
427
- if (!(resource.toString().startsWith('http:') ||
428
- resource.toString().startsWith('https:'))) {
427
+ const request = new Request(resource, options);
428
+ if (!(request.url.startsWith('http:') ||
429
+ request.url.startsWith('https:'))) {
429
430
  return win.CapacitorWebFetch(resource, options);
430
431
  }
431
432
  const tag = `CapacitorHttp fetch ${Date.now()} ${resource}`;
432
433
  console.time(tag);
433
434
  try {
434
435
  // intercept request & pass to the bridge
435
- const { data: requestData, type, headers, } = await convertBody((options === null || options === void 0 ? void 0 : options.body) || undefined);
436
- let optionHeaders = options === null || options === void 0 ? void 0 : options.headers;
437
- if ((options === null || options === void 0 ? void 0 : options.headers) instanceof Headers) {
438
- optionHeaders = Object.fromEntries(options.headers.entries());
439
- }
436
+ const { body, method } = request;
437
+ const { data: requestData, type, headers, } = await convertBody(body || undefined);
438
+ const optionHeaders = Object.fromEntries(request.headers.entries());
440
439
  const nativeResponse = await cap.nativePromise('CapacitorHttp', 'request', {
441
- url: resource,
442
- method: (options === null || options === void 0 ? void 0 : options.method) ? options.method : undefined,
440
+ url: request.url,
441
+ method: method,
443
442
  data: requestData,
444
443
  dataType: type,
445
444
  headers: Object.assign(Object.assign({}, headers), optionHeaders),
@@ -587,12 +586,22 @@ var nativeBridge = (function (exports) {
587
586
  }
588
587
  this._headers = nativeResponse.headers;
589
588
  this.status = nativeResponse.status;
589
+ const responseString = typeof nativeResponse.data !== 'string'
590
+ ? JSON.stringify(nativeResponse.data)
591
+ : nativeResponse.data;
590
592
  if (this.responseType === '' ||
591
593
  this.responseType === 'text') {
592
- this.response =
593
- typeof nativeResponse.data !== 'string'
594
- ? JSON.stringify(nativeResponse.data)
595
- : nativeResponse.data;
594
+ this.response = responseString;
595
+ }
596
+ else if (this.responseType === 'blob') {
597
+ this.response = new Blob([responseString], {
598
+ type: "application/json",
599
+ });
600
+ }
601
+ else if (this.responseType === 'arraybuffer') {
602
+ const encoder = new TextEncoder();
603
+ const uint8Array = encoder.encode(responseString);
604
+ this.response = uint8Array.buffer;
596
605
  }
597
606
  else {
598
607
  this.response = nativeResponse.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "5.3.1-nightly-20230914T150514.0",
3
+ "version": "5.4.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)",
@@ -23,7 +23,7 @@
23
23
  "verify": "./gradlew clean lint build test -b capacitor/build.gradle"
24
24
  },
25
25
  "peerDependencies": {
26
- "@capacitor/core": "^5.3.0-nightly-20230914T150514.0"
26
+ "@capacitor/core": "^5.4.0"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"