From 14e27a4f167b170d05df1701e36146f1c380dd76 Mon Sep 17 00:00:00 2001 From: jmj Date: Mon, 30 Nov 2026 08:41:47 +0800 Subject: [PATCH] fix(android): load WebView pages over http to avoid mixed content Pages are hosted on appassets.androidplatform.net and the in-page requests target the hub over http://192.168.1.111:8765. Because the pages were loaded over https, Chromium blocked those http requests under the mixed content policy before they ever hit the network, which surfaced as immediate ERR_ABORTED failures. Switch the page scheme to http so the page is served from an insecure context. Mixed content rules are directional: an http page may load https subresources, so both the http hub (8765) and the https hub (8766) remain reachable. WebViewAssetLoader only accepts the http scheme when explicitly enabled, so also call setHttpAllowed(true). Without it PathMatcher.match() returns null for http URIs, the request escapes interception and is treated as a real network request to appassets.androidplatform.net, leaving a blank page with no error log. Also raise the default versionCode/versionName to 34 / 0.3.4 so a build without -PpwVersionCode no longer regresses to 1 / 0.1.0 and triggers a spurious downgrade. --- .gitignore | 1 + android/app/build.gradle.kts | 4 ++-- android/app/src/main/assets/pulsewall/host.html | 2 +- android/app/src/main/assets/pulsewall/sandbox.html | 2 +- android/app/src/main/java/com/pulsewall/app/MainActivity.kt | 5 +++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6aa09d7..108f6ff 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__/ *.py[cod] .venv/ *.db +*.db-journal *.sqlite3 .env diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 25a6aae..5076bce 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -3,8 +3,8 @@ plugins { id("org.jetbrains.kotlin.android") } -val pwVersionCode = (project.findProperty("pwVersionCode") as String?)?.toIntOrNull() ?: 1 -val pwVersionName = (project.findProperty("pwVersionName") as String?) ?: "0.1.0" +val pwVersionCode = (project.findProperty("pwVersionCode") as String?)?.toIntOrNull() ?: 34 +val pwVersionName = (project.findProperty("pwVersionName") as String?) ?: "0.3.4" android { namespace = "com.pulsewall.app" diff --git a/android/app/src/main/assets/pulsewall/host.html b/android/app/src/main/assets/pulsewall/host.html index 14c8cf4..88d0eb8 100644 --- a/android/app/src/main/assets/pulsewall/host.html +++ b/android/app/src/main/assets/pulsewall/host.html @@ -90,7 +90,7 @@