Skip to content

Commit

Permalink
Merge branch 'main' into fix-vname-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
markemer authored Jan 6, 2025
2 parents 2e92530 + 9d08df6 commit c698566
Show file tree
Hide file tree
Showing 31 changed files with 212 additions and 335 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [7.0.0-rc.0](https://github.com/ionic-team/capacitor/compare/7.0.0-beta.0...7.0.0-rc.0) (2024-12-20)

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

# [7.0.0-beta.0](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.2...7.0.0-beta.0) (2024-12-20)

### Bug Fixes

- **cli:** correct rimraf import ([#7811](https://github.com/ionic-team/capacitor/issues/7811)) ([0891624](https://github.com/ionic-team/capacitor/commit/0891624c46b78a0fd39f617f834d5cdd1f54f5e6))
- **cli:** update link to telemetry information ([e922e2b](https://github.com/ionic-team/capacitor/commit/e922e2b718f5c6f2e4062cdccdeb92da3321e67d))
- **ios:** Make Bridge webView first responder ([#7753](https://github.com/ionic-team/capacitor/issues/7753)) ([77e4668](https://github.com/ionic-team/capacitor/commit/77e4668fa8dbb24b4561387e101547f74e37538e))

### Features

- Add global initialFocus configuration ([#7775](https://github.com/ionic-team/capacitor/issues/7775)) ([61d0165](https://github.com/ionic-team/capacitor/commit/61d01653685d8e3594d2d8a6bd870fa9643ba95c))

# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.1...7.0.0-alpha.2) (2024-11-19)

### Bug Fixes
Expand Down
10 changes: 10 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [7.0.0-rc.0](https://github.com/ionic-team/capacitor/compare/7.0.0-beta.0...7.0.0-rc.0) (2024-12-20)

**Note:** Version bump only for package @capacitor/android

# [7.0.0-beta.0](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.2...7.0.0-beta.0) (2024-12-20)

### Features

- Add global initialFocus configuration ([#7775](https://github.com/ionic-team/capacitor/issues/7775)) ([61d0165](https://github.com/ionic-team/capacitor/commit/61d01653685d8e3594d2d8a6bd870fa9643ba95c))

# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.1...7.0.0-alpha.2) (2024-11-19)

**Note:** Version bump only for package @capacitor/android
Expand Down
4 changes: 2 additions & 2 deletions android/capacitor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ android {
lintConfig file('lint.xml')
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
publishing {
singleVariant("release")
Expand Down
16 changes: 16 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.webkit.ServiceWorkerClient;
import android.webkit.ServiceWorkerController;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import androidx.activity.result.ActivityResultCallback;
Expand Down Expand Up @@ -274,6 +278,18 @@ private void loadWebView() {
webView.setWebChromeClient(new BridgeWebChromeClient(this));
webView.setWebViewClient(this.webViewClient);

if (Build.VERSION.SDK_INT >= 24 && config.isResolveServiceWorkerRequests()) {
ServiceWorkerController swController = ServiceWorkerController.getInstance();
swController.setServiceWorkerClient(
new ServiceWorkerClient() {
@Override
public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
return getLocalServer().shouldInterceptRequest(request);
}
}
);
}

if (!isDeployDisabled() && !isNewBinary()) {
SharedPreferences prefs = getContext()
.getSharedPreferences(com.getcapacitor.plugin.WebView.WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);
Expand Down
133 changes: 0 additions & 133 deletions android/capacitor/src/main/java/com/getcapacitor/BridgeFragment.java

This file was deleted.

19 changes: 18 additions & 1 deletion android/capacitor/src/main/java/com/getcapacitor/CapConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class CapConfig {
private int minHuaweiWebViewVersion = DEFAULT_HUAWEI_WEBVIEW_VERSION;
private String errorPath;
private boolean zoomableWebView = false;
private boolean resolveServiceWorkerRequests = true;

// Embedded
private String startPath;
Expand Down Expand Up @@ -179,6 +180,7 @@ private CapConfig(Builder builder) {
this.minHuaweiWebViewVersion = builder.minHuaweiWebViewVersion;
this.errorPath = builder.errorPath;
this.zoomableWebView = builder.zoomableWebView;
this.resolveServiceWorkerRequests = builder.resolveServiceWorkerRequests;

// Embedded
this.startPath = builder.startPath;
Expand Down Expand Up @@ -282,6 +284,7 @@ private void deserializeConfig(@Nullable Context context) {
useLegacyBridge = JSONUtils.getBoolean(configJSON, "android.useLegacyBridge", useLegacyBridge);
webContentsDebuggingEnabled = JSONUtils.getBoolean(configJSON, "android.webContentsDebuggingEnabled", isDebug);
zoomableWebView = JSONUtils.getBoolean(configJSON, "android.zoomEnabled", JSONUtils.getBoolean(configJSON, "zoomEnabled", false));
resolveServiceWorkerRequests = JSONUtils.getBoolean(configJSON, "android.resolveServiceWorkerRequests", true);

String logBehavior = JSONUtils.getString(
configJSON,
Expand All @@ -299,7 +302,11 @@ private void deserializeConfig(@Nullable Context context) {
loggingEnabled = isDebug;
}

initialFocus = JSONUtils.getBoolean(configJSON, "android.initialFocus", initialFocus);
initialFocus = JSONUtils.getBoolean(
configJSON,
"android.initialFocus",
JSONUtils.getBoolean(configJSON, "initialFocus", initialFocus)
);

// Plugins
pluginsConfiguration = deserializePluginsConfig(JSONUtils.getObject(configJSON, "plugins"));
Expand Down Expand Up @@ -370,6 +377,10 @@ public boolean isInputCaptured() {
return captureInput;
}

public boolean isResolveServiceWorkerRequests() {
return resolveServiceWorkerRequests;
}

public boolean isWebContentsDebuggingEnabled() {
return webContentsDebuggingEnabled;
}
Expand Down Expand Up @@ -569,6 +580,7 @@ public static class Builder {
private int minWebViewVersion = DEFAULT_ANDROID_WEBVIEW_VERSION;
private int minHuaweiWebViewVersion = DEFAULT_HUAWEI_WEBVIEW_VERSION;
private boolean zoomableWebView = false;
private boolean resolveServiceWorkerRequests = true;

// Embedded
private String startPath = null;
Expand Down Expand Up @@ -668,6 +680,11 @@ public Builder setUseLegacyBridge(boolean useLegacyBridge) {
return this;
}

public Builder setResolveServiceWorkerRequests(boolean resolveServiceWorkerRequests) {
this.resolveServiceWorkerRequests = resolveServiceWorkerRequests;
return this;
}

public Builder setWebContentsDebuggingEnabled(boolean webContentsDebuggingEnabled) {
this.webContentsDebuggingEnabled = webContentsDebuggingEnabled;
return this;
Expand Down
13 changes: 0 additions & 13 deletions android/capacitor/src/main/res/layout/fragment_bridge.xml

This file was deleted.

6 changes: 0 additions & 6 deletions android/capacitor/src/main/res/values/attrs.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void setup() {
.setBackgroundColor("red")
.setPluginsConfiguration(pluginConfig)
.setServerUrl("http://www.google.com")
.setResolveServiceWorkerRequests(false)
.create();
} catch (Exception e) {
fail();
Expand All @@ -73,6 +74,7 @@ public void getCoreConfigValues() {
assertTrue(config.isWebContentsDebuggingEnabled());
assertEquals("red", config.getBackgroundColor());
assertEquals("http://www.google.com", config.getServerUrl());
assertFalse(config.isResolveServiceWorkerRequests());
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions android/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/android",
"version": "7.0.0-alpha.2",
"version": "7.0.0-rc.0",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
"homepage": "https://capacitorjs.com",
"author": "Ionic Team <[email protected]> (https://ionic.io)",
Expand All @@ -23,7 +23,7 @@
"verify": "./gradlew clean lint build test -b capacitor/build.gradle"
},
"peerDependencies": {
"@capacitor/core": "^7.0.0-alpha.2"
"@capacitor/core": "^7.0.0-rc.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions capacitor-cordova-android-plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}

Expand Down
16 changes: 16 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [7.0.0-rc.0](https://github.com/ionic-team/capacitor/compare/7.0.0-beta.0...7.0.0-rc.0) (2024-12-20)

**Note:** Version bump only for package @capacitor/cli

# [7.0.0-beta.0](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.2...7.0.0-beta.0) (2024-12-20)

### Bug Fixes

- **cli:** correct rimraf import ([#7811](https://github.com/ionic-team/capacitor/issues/7811)) ([0891624](https://github.com/ionic-team/capacitor/commit/0891624c46b78a0fd39f617f834d5cdd1f54f5e6))
- **cli:** update link to telemetry information ([e922e2b](https://github.com/ionic-team/capacitor/commit/e922e2b718f5c6f2e4062cdccdeb92da3321e67d))
- **ios:** Make Bridge webView first responder ([#7753](https://github.com/ionic-team/capacitor/issues/7753)) ([77e4668](https://github.com/ionic-team/capacitor/commit/77e4668fa8dbb24b4561387e101547f74e37538e))

### Features

- Add global initialFocus configuration ([#7775](https://github.com/ionic-team/capacitor/issues/7775)) ([61d0165](https://github.com/ionic-team/capacitor/commit/61d01653685d8e3594d2d8a6bd870fa9643ba95c))

# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor/compare/7.0.0-alpha.1...7.0.0-alpha.2) (2024-11-19)

### Bug Fixes
Expand Down
Loading

0 comments on commit c698566

Please sign in to comment.