@capacitor/android 4.7.2 → 4.7.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.7.3](https://github.com/ionic-team/capacitor/compare/4.7.2...4.7.3) (2023-03-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **android:** remove stored references to bridge that holds it in memory ([#6448](https://github.com/ionic-team/capacitor/issues/6448)) ([#6455](https://github.com/ionic-team/capacitor/issues/6455)) ([8fa2d1c](https://github.com/ionic-team/capacitor/commit/8fa2d1c560321d9eb91edb1c81bf64f802289604))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.7.2](https://github.com/ionic-team/capacitor/compare/4.7.1...4.7.2) (2023-03-31)
7
18
 
8
19
 
@@ -17,7 +17,10 @@ import java.util.Objects;
17
17
  public class CapacitorCookieManager extends CookieManager {
18
18
 
19
19
  private final android.webkit.CookieManager webkitCookieManager;
20
- private final Bridge bridge;
20
+
21
+ private final String localUrl;
22
+
23
+ private final String serverUrl;
21
24
 
22
25
  /**
23
26
  * Create a new cookie manager with the default cookie store and policy
@@ -36,18 +39,19 @@ public class CapacitorCookieManager extends CookieManager {
36
39
  public CapacitorCookieManager(CookieStore store, CookiePolicy policy, Bridge bridge) {
37
40
  super(store, policy);
38
41
  webkitCookieManager = android.webkit.CookieManager.getInstance();
39
- this.bridge = bridge;
42
+ this.localUrl = bridge.getLocalUrl();
43
+ this.serverUrl = bridge.getServerUrl();
40
44
  }
41
45
 
42
46
  public String getSanitizedDomain(String url) {
43
47
  if (url == null || url.isEmpty()) {
44
- url = this.bridge.getLocalUrl();
48
+ url = this.localUrl;
45
49
  }
46
50
 
47
51
  try {
48
52
  new URI(url);
49
53
  } catch (Exception ex) {
50
- return this.bridge.getServerUrl();
54
+ return this.serverUrl;
51
55
  }
52
56
 
53
57
  return url;
@@ -31,8 +31,7 @@ public class CapacitorHttp extends Plugin {
31
31
  @Override
32
32
  public void run() {
33
33
  try {
34
- HttpRequestHandler.bridge = bridge;
35
- JSObject response = HttpRequestHandler.request(call, httpMethod);
34
+ JSObject response = HttpRequestHandler.request(call, httpMethod, getBridge());
36
35
  call.resolve(response);
37
36
  } catch (Exception e) {
38
37
  call.reject(e.getLocalizedMessage(), e.getClass().getSimpleName(), e);
@@ -27,8 +27,6 @@ import org.json.JSONObject;
27
27
 
28
28
  public class HttpRequestHandler {
29
29
 
30
- public static Bridge bridge = null;
31
-
32
30
  /**
33
31
  * An enum specifying conventional HTTP Response Types
34
32
  * See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType
@@ -367,7 +365,8 @@ public class HttpRequestHandler {
367
365
  * @throws URISyntaxException thrown when the URI is malformed
368
366
  * @throws JSONException thrown when the incoming JSON is malformed
369
367
  */
370
- public static JSObject request(PluginCall call, String httpMethod) throws IOException, URISyntaxException, JSONException {
368
+ public static JSObject request(PluginCall call, String httpMethod, Bridge bridge)
369
+ throws IOException, URISyntaxException, JSONException {
371
370
  String urlString = call.getString("url", "");
372
371
  JSObject headers = call.getObject("headers");
373
372
  JSObject params = call.getObject("params");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "4.7.2",
3
+ "version": "4.7.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)",
@@ -28,5 +28,5 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "f17e5827ea115250c17c289c3db5432b67df6907"
31
+ "gitHead": "aa522964a8521f65b95e4233993019e3fe2531a4"
32
32
  }