修复: 恢复WebView跨域设置(本设备必需) + 工作版index.html
This commit is contained in:
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
#Tue Jul 21 19:20:43 CST 2026
|
||||
#Tue Jul 21 20:14:20 CST 2026
|
||||
gradle.version=8.13
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -14,12 +14,15 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val wv = WebView(this).apply {
|
||||
if (BuildConfig.DEBUG) {
|
||||
if (0 != (applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE)) {
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
}
|
||||
settings.javaScriptEnabled = true
|
||||
settings.domStorageEnabled = true
|
||||
settings.allowFileAccess = true
|
||||
settings.allowFileAccessFromFileURLs = true
|
||||
settings.allowUniversalAccessFromFileURLs = true
|
||||
settings.mixedContentMode = android.webkit.WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
|
||||
addJavascriptInterface(Bridge(this@MainActivity), "Android")
|
||||
|
||||
if (cacheFile.exists()) {
|
||||
|
||||
Reference in New Issue
Block a user