修复: 恢复WebView跨域设置(本设备必需) + 工作版index.html

This commit is contained in:
LukeMackin
2026-07-21 20:19:23 +08:00
parent 7f22d4028f
commit f4ee38f39f
6 changed files with 6 additions and 3 deletions

View File

@@ -1 +1 @@
0.1.0-dav-android-6|https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/h5/index-v6.html|79a254cfce0a44a33cc0e56a5beb167d68fc30205d5055c7be6e21f96753dff2 0.1.0-dav-android-6|https://git.childish-ghost.com/LukeMackin/Yuzu-GCA/raw/branch/main/ota/h5/index-v6.html

View File

@@ -1,2 +1,2 @@
#Tue Jul 21 19:20:43 CST 2026 #Tue Jul 21 20:14:20 CST 2026
gradle.version=8.13 gradle.version=8.13

View File

@@ -14,12 +14,15 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
val wv = WebView(this).apply { val wv = WebView(this).apply {
if (BuildConfig.DEBUG) { if (0 != (applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE)) {
WebView.setWebContentsDebuggingEnabled(true) WebView.setWebContentsDebuggingEnabled(true)
} }
settings.javaScriptEnabled = true settings.javaScriptEnabled = true
settings.domStorageEnabled = true settings.domStorageEnabled = true
settings.allowFileAccess = true settings.allowFileAccess = true
settings.allowFileAccessFromFileURLs = true
settings.allowUniversalAccessFromFileURLs = true
settings.mixedContentMode = android.webkit.WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
addJavascriptInterface(Bridge(this@MainActivity), "Android") addJavascriptInterface(Bridge(this@MainActivity), "Android")
if (cacheFile.exists()) { if (cacheFile.exists()) {