Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [8.3.4](https://github.com/Cap-go/capacitor-plus/compare/8.3.3...8.3.4) (2026-05-07)
## [8.3.4](https://github.com/ionic-team/capacitor/compare/8.3.3...8.3.4) (2026-05-12)

**Note:** Version bump only for package capacitor

## [8.3.3](https://github.com/ionic-team/capacitor/compare/8.3.2...8.3.3) (2026-05-08)

### Bug Fixes

- **cli:** copy plugin files in CocoaPods projects ([#8467](https://github.com/ionic-team/capacitor/issues/8467)) ([b2d7719](https://github.com/ionic-team/capacitor/commit/b2d771926a180e60deea31992d7d4abcd5ca3bc7))

## [8.3.2](https://github.com/ionic-team/capacitor/compare/8.3.1...8.3.2) (2026-05-07)

### Bug Fixes

- **cli:** add cSettings support for compiler flags in generated Package.swift ([#8448](https://github.com/ionic-team/capacitor/issues/8448)) ([0bd0676](https://github.com/ionic-team/capacitor/commit/0bd0676315c5fd77e50312dd7b5bf4990dcbd7d0))
- **cli:** add system framework and weak framework support in SPM Package.swift ([#8447](https://github.com/ionic-team/capacitor/issues/8447)) ([3232f0f](https://github.com/ionic-team/capacitor/commit/3232f0fe1d9811b0b5c500e3dc05cb8a250177f8))
- **cli:** correct Capacitor plugin SPM compat check ([#8440](https://github.com/ionic-team/capacitor/issues/8440)) ([e5ccc45](https://github.com/ionic-team/capacitor/commit/e5ccc451dda27d56bca824ed644bd20fe4d988cb))
- **cli:** generate binaryTarget entries for custom xcframeworks in Package.swift ([#8445](https://github.com/ionic-team/capacitor/issues/8445)) ([1f7e33f](https://github.com/ionic-team/capacitor/commit/1f7e33fca43d183332ec19d22b0d75ef81d8cc6d))
- **cli:** generate resource entries in Package.swift ([#8455](https://github.com/ionic-team/capacitor/issues/8455)) ([790bd27](https://github.com/ionic-team/capacitor/commit/790bd27123497111984227010c3162cec94a108e))
- **cli:** handle Cordova plugins without iOS source files ([#8443](https://github.com/ionic-team/capacitor/issues/8443)) ([0da130e](https://github.com/ionic-team/capacitor/commit/0da130eb7a861bee4e2c35bc0aac53ba9c983fc3))
- **cli:** link plugin dependencies in Package.swift ([#8457](https://github.com/ionic-team/capacitor/issues/8457)) ([b3c769e](https://github.com/ionic-team/capacitor/commit/b3c769e856c826b1174518877cf86ac7ce73bf09))
- **ios:** support Cordova plugins with Package.swift ([#8438](https://github.com/ionic-team/capacitor/issues/8438)) ([139943b](https://github.com/ionic-team/capacitor/commit/139943b0c05fddb2d1ce2d6f468800fddf17b4cf))
- **SystemBars:** avoid extra view padding on API <= 34 ([#8439](https://github.com/ionic-team/capacitor/issues/8439)) ([5b135a7](https://github.com/ionic-team/capacitor/commit/5b135a70217be560e7176c8d5b514cc92ed3e4e4))

## [8.3.1](https://github.com/ionic-team/capacitor/compare/8.3.0...8.3.1) (2026-04-16)

### Bug Fixes

Expand Down
254 changes: 6 additions & 248 deletions android/CHANGELOG.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/PluginConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ public int getInt(String configKey, int defaultValue) {
return JSONUtils.getInt(config, configKey, defaultValue);
}

/**
* Get a double value for a plugin in the Capacitor config.
*
* @param configKey The key of the value to retrieve
* @param defaultValue A default value to return if the key does not exist in the config
* @return The value from the config, if key exists. Default value returned if not
*/
public double getDouble(String configKey, double defaultValue) {
return JSONUtils.getDouble(config, configKey, defaultValue);
}

/**
* Get a string array value for a plugin in the Capacitor config.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,22 @@ private WebResourceResponse handleLocalRequest(WebResourceRequest request, PathH
Map<String, String> tempResponseHeaders = handler.buildDefaultResponseHeaders();
int statusCode = 206;
try {
int totalRange = responseStream.available();
int totalSize = responseStream.available();
String[] parts = rangeString.split("=");
String[] streamParts = parts[1].split("-");
String fromRange = streamParts[0];
int range = totalRange - 1;
if (streamParts.length > 1) {
range = Integer.parseInt(streamParts[1]);
int fromRange = Integer.parseInt(streamParts[0]);
int endRange = totalSize - 1;
if (streamParts.length > 1 && !streamParts[1].isEmpty()) {
endRange = Integer.parseInt(streamParts[1]);
}

// Truncate the stream at the end of the requested range.
// Somewhere in the request pipeline, the stream gets automatically
// seeked to the correct start position, so we don't need to skip to the fromRange position here.
responseStream = new BoundedInputStream(responseStream, endRange + 1);

tempResponseHeaders.put("Accept-Ranges", "bytes");
tempResponseHeaders.put("Content-Range", "bytes " + fromRange + "-" + range + "/" + totalRange);
tempResponseHeaders.put("Content-Range", "bytes " + fromRange + "-" + endRange + "/" + totalSize);
} catch (IOException e) {
statusCode = 404;
}
Expand Down Expand Up @@ -750,6 +756,48 @@ public long skip(long n) throws IOException {
}
}

/**
* An InputStream wrapper that limits the number of bytes that can be read.
*/
static class BoundedInputStream extends InputStream {

private final InputStream in;
private long remaining;

public BoundedInputStream(InputStream in, long limit) {
this.in = in;
this.remaining = limit;
}

@Override
public int available() throws IOException {
int available = in.available();
return (int) Math.min(available, remaining);
}

@Override
public int read() throws IOException {
if (remaining <= 0) return -1;
int result = in.read();
if (result != -1) remaining--;
return result;
}

@Override
public int read(byte[] b, int off, int len) throws IOException {
if (remaining <= 0) return -1;
int toRead = (int) Math.min(len, remaining);
int result = in.read(b, off, toRead);
if (result > 0) remaining -= result;
return result;
}

@Override
public void close() throws IOException {
in.close();
}
}

// For L and above.
private static class LollipopLazyInputStream extends LazyInputStream {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ public CapacitorEvalBridgeMode(WebView webView, CordovaInterface cordova) {

@Override
public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
cordova
.getActivity()
.runOnUiThread(() -> {
String js = queue.popAndEncodeAsJs();
if (js != null) {
webView.evaluateJavascript(js, null);
}
});
cordova.getActivity().runOnUiThread(() -> {
String js = queue.popAndEncodeAsJs();
if (js != null) {
webView.evaluateJavascript(js, null);
}
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,18 @@ private Insets calcSafeAreaInsets(WindowInsetsCompat insets) {
}

private void initSafeAreaCSSVariables() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM && insetHandlingEnabled) {
WindowInsetsCompat insets;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
View v = (View) this.getBridge().getWebView().getParent();
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(v);
if (insets != null) {
Insets safeAreaInsets = calcSafeAreaInsets(insets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);
}
insets = ViewCompat.getRootWindowInsets(v);
} else {
insets = WindowInsetsCompat.CONSUMED;
}

if (insets != null) {
Insets safeAreaInsets = calcSafeAreaInsets(insets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);
}
}

Expand All @@ -186,10 +191,8 @@ private void initWindowInsetsListener() {
// We need to correct for a possible shown IME
v.setPadding(0, 0, 0, keyboardVisible ? imeInsets.bottom : 0);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM && hasViewportCover && insetHandlingEnabled) {
Insets safeAreaInsets = calcSafeAreaInsets(insets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);
}
Insets safeAreaInsets = calcSafeAreaInsets(insets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);

return new WindowInsetsCompat.Builder(insets)
.setInsets(
Expand Down Expand Up @@ -221,10 +224,8 @@ private void initWindowInsetsListener() {
.setInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout(), Insets.of(0, 0, 0, 0))
.build();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM && hasViewportCover && insetHandlingEnabled) {
Insets safeAreaInsets = calcSafeAreaInsets(newInsets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);
}
Insets safeAreaInsets = calcSafeAreaInsets(newInsets);
injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);

return newInsets;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ public static int getInt(JSONObject jsonObject, String key, int defaultValue) {
return defaultValue;
}

/**
* Get a double value from the given JSON object.
*
* @param jsonObject A JSON object to search
* @param key A key to fetch from the JSON object
* @param defaultValue A default value to return if the key cannot be found
* @return The value at the given key in the JSON object, or the default value
*/
public static double getDouble(JSONObject jsonObject, String key, double defaultValue) {
String k = getDeepestKey(key);
try {
JSONObject o = getDeepestObject(jsonObject, key);
return o.getDouble(k);
} catch (JSONException ignore) {
// value was not found
}

return defaultValue;
}

/**
* Get a JSON object value from the given JSON object.
*
Expand Down
Loading
Loading