fix: loadDataWithBaseURL加载缓存HTML (file://权限不足)
This commit is contained in:
@@ -26,8 +26,9 @@ class MainActivity : AppCompatActivity() {
|
||||
addJavascriptInterface(Bridge(this@MainActivity), "Android")
|
||||
|
||||
if (cacheFile.exists()) {
|
||||
loadUrl("file://" + cacheFile.absolutePath)
|
||||
Log.i(TAG, "Loaded cached hot-update HTML (${cacheFile.length()}B)")
|
||||
val html = cacheFile.readText()
|
||||
loadDataWithBaseURL("https://gca.app/", html, "text/html", "UTF-8", null)
|
||||
Log.i(TAG, "Loaded cached HTML (${cacheFile.length()}B)")
|
||||
} else {
|
||||
loadUrl("file:///android_asset/index.html")
|
||||
Log.i(TAG, "Loaded embedded index.html")
|
||||
|
||||
Reference in New Issue
Block a user