@capacitor/android 9.0.0-alpha.4 → 9.0.0-alpha.5
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/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java +2 -2
- package/capacitor/src/main/java/com/getcapacitor/FileUtils.java +1 -1
- package/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java +6 -6
- package/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java +3 -3
- package/capacitor/src/main/java/com/getcapacitor/plugin/util/HttpRequestHandler.java +2 -2
- package/package.json +3 -3
|
@@ -282,7 +282,7 @@ public class BridgeWebChromeClient extends WebChromeClient {
|
|
|
282
282
|
boolean captureEnabled = fileChooserParams.isCaptureEnabled();
|
|
283
283
|
boolean capturePhoto = captureEnabled && acceptTypes.contains("image/*");
|
|
284
284
|
final boolean captureVideo = captureEnabled && acceptTypes.contains("video/*");
|
|
285
|
-
if (
|
|
285
|
+
if (capturePhoto || captureVideo) {
|
|
286
286
|
if (isMediaCaptureSupported()) {
|
|
287
287
|
showMediaCaptureOrFilePicker(filePathCallback, fileChooserParams, captureVideo);
|
|
288
288
|
} else {
|
|
@@ -447,7 +447,7 @@ public class BridgeWebChromeClient extends WebChromeClient {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
public boolean isValidMsg(String msg) {
|
|
450
|
-
return !(msg.contains("%cresult %c") ||
|
|
450
|
+
return !(msg.contains("%cresult %c") || msg.contains("%cnative %c") || msg.equalsIgnoreCase("console.groupEnd"));
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
private Uri createImageFileUri() throws IOException {
|
|
@@ -218,7 +218,7 @@ public class FileUtils {
|
|
|
218
218
|
Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
|
|
219
219
|
int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
|
|
220
220
|
cursor.moveToFirst();
|
|
221
|
-
String name =
|
|
221
|
+
String name = cursor.getString(nameIndex);
|
|
222
222
|
String fileName = sanitizeFilename(name);
|
|
223
223
|
File file = new File(context.getFilesDir(), fileName);
|
|
224
224
|
try {
|
|
@@ -208,7 +208,7 @@ public class WebViewLocalServer {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
private boolean isMainUrl(Uri loadingUrl) {
|
|
211
|
-
return
|
|
211
|
+
return bridge.getServerUrl() == null && loadingUrl.getHost().equalsIgnoreCase(bridge.getHost());
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
private boolean isAllowedUrl(Uri loadingUrl) {
|
|
@@ -709,31 +709,31 @@ public class WebViewLocalServer {
|
|
|
709
709
|
@Override
|
|
710
710
|
public int available() throws IOException {
|
|
711
711
|
InputStream is = getInputStream();
|
|
712
|
-
return
|
|
712
|
+
return is != null ? is.available() : -1;
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
@Override
|
|
716
716
|
public int read() throws IOException {
|
|
717
717
|
InputStream is = getInputStream();
|
|
718
|
-
return
|
|
718
|
+
return is != null ? is.read() : -1;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
@Override
|
|
722
722
|
public int read(byte[] b) throws IOException {
|
|
723
723
|
InputStream is = getInputStream();
|
|
724
|
-
return
|
|
724
|
+
return is != null ? is.read(b) : -1;
|
|
725
725
|
}
|
|
726
726
|
|
|
727
727
|
@Override
|
|
728
728
|
public int read(byte[] b, int off, int len) throws IOException {
|
|
729
729
|
InputStream is = getInputStream();
|
|
730
|
-
return
|
|
730
|
+
return is != null ? is.read(b, off, len) : -1;
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
@Override
|
|
734
734
|
public long skip(long n) throws IOException {
|
|
735
735
|
InputStream is = getInputStream();
|
|
736
|
-
return
|
|
736
|
+
return is != null ? is.skip(n) : 0;
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
|
|
@@ -192,12 +192,12 @@ public class CapacitorCookieManager extends CookieManager {
|
|
|
192
192
|
@Override
|
|
193
193
|
public void put(URI uri, Map<String, List<String>> responseHeaders) {
|
|
194
194
|
// make sure our args are valid
|
|
195
|
-
if (
|
|
195
|
+
if (uri == null || responseHeaders == null) return;
|
|
196
196
|
|
|
197
197
|
// go over the headers
|
|
198
198
|
for (String headerKey : responseHeaders.keySet()) {
|
|
199
199
|
// ignore headers which aren't cookie related
|
|
200
|
-
if (
|
|
200
|
+
if (headerKey == null || !(headerKey.equalsIgnoreCase("Set-Cookie2") || headerKey.equalsIgnoreCase("Set-Cookie"))) continue;
|
|
201
201
|
|
|
202
202
|
// process each of the headers
|
|
203
203
|
for (String headerValue : Objects.requireNonNull(responseHeaders.get(headerKey))) {
|
|
@@ -215,7 +215,7 @@ public class CapacitorCookieManager extends CookieManager {
|
|
|
215
215
|
@Override
|
|
216
216
|
public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) {
|
|
217
217
|
// make sure our args are valid
|
|
218
|
-
if (
|
|
218
|
+
if (uri == null || requestHeaders == null) throw new IllegalArgumentException("Argument is null");
|
|
219
219
|
|
|
220
220
|
// save our url once
|
|
221
221
|
String url = uri.toString();
|
|
@@ -168,8 +168,8 @@ public class HttpRequestHandler {
|
|
|
168
168
|
"://" +
|
|
169
169
|
uri.getAuthority() +
|
|
170
170
|
uri.getPath() +
|
|
171
|
-
(
|
|
172
|
-
(
|
|
171
|
+
(!urlQuery.equals("") ? "?" + urlQuery : "") +
|
|
172
|
+
(uri.getFragment() != null ? uri.getFragment() : "");
|
|
173
173
|
this.url = new URL(unEncodedUrlString);
|
|
174
174
|
|
|
175
175
|
return this;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/android",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.5",
|
|
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
|
"capacitor-cordova/src/main/"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"verify": "./gradlew clean lint build test
|
|
26
|
+
"verify": "./gradlew :capacitor-android:clean :capacitor-android:lint :capacitor-android:build :capacitor-android:test"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@capacitor/core": "^9.0.0-alpha.
|
|
29
|
+
"@capacitor/core": "^9.0.0-alpha.5"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|