diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 69941b1d..c169446b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -79,8 +79,8 @@ android { lint { baseline = file("lint-baseline.xml") - //isCheckReleaseBuilds = false disable.add("MissingTranslation") + checkReleaseBuilds = false } namespace = "info.plateaukao.einkbro" diff --git a/app/src/main/java/info/plateaukao/einkbro/browser/JsWebInterface.kt b/app/src/main/java/info/plateaukao/einkbro/browser/JsWebInterface.kt index d9c95652..04ff04a7 100644 --- a/app/src/main/java/info/plateaukao/einkbro/browser/JsWebInterface.kt +++ b/app/src/main/java/info/plateaukao/einkbro/browser/JsWebInterface.kt @@ -1,12 +1,10 @@ package info.plateaukao.einkbro.browser -import android.app.Activity import android.util.Log import android.webkit.JavascriptInterface import info.plateaukao.einkbro.preference.ConfigManager import info.plateaukao.einkbro.service.TranslateRepository import info.plateaukao.einkbro.view.EBWebView -import info.plateaukao.einkbro.view.dialog.DialogManager import info.plateaukao.einkbro.viewmodel.TRANSLATE_API import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers @@ -22,7 +20,6 @@ class JsWebInterface(private val webView: EBWebView) : KoinComponent { private val translateRepository: TranslateRepository = TranslateRepository() private val configManager: ConfigManager by inject() - private val dialogManager: DialogManager by lazy { DialogManager(webView.context as Activity) } // to control the translation request threshold private val semaphoreForTranslate = Semaphore(4) diff --git a/app/src/main/java/info/plateaukao/einkbro/browser/NinjaWebViewClient.kt b/app/src/main/java/info/plateaukao/einkbro/browser/NinjaWebViewClient.kt index 0b2d8016..def7c2b3 100755 --- a/app/src/main/java/info/plateaukao/einkbro/browser/NinjaWebViewClient.kt +++ b/app/src/main/java/info/plateaukao/einkbro/browser/NinjaWebViewClient.kt @@ -29,8 +29,8 @@ import info.plateaukao.einkbro.caption.DualCaptionProcessor import info.plateaukao.einkbro.preference.ConfigManager import info.plateaukao.einkbro.unit.BrowserUnit import info.plateaukao.einkbro.unit.HelperUnit -import info.plateaukao.einkbro.view.EBWebView import info.plateaukao.einkbro.view.EBToast +import info.plateaukao.einkbro.view.EBWebView import info.plateaukao.einkbro.view.dialog.DialogManager import info.plateaukao.einkbro.view.dialog.compose.AuthenticationDialogFragment import nl.siegmann.epublib.domain.Book @@ -231,6 +231,10 @@ class EBWebViewClient( request: WebResourceRequest?, error: WebResourceError?, ) { +// if (request?.isForMainFrame == true) { +// view?.loadUrl("file:///android_asset/trex.html") +// return +// } // if https is not available, try http if (error?.description == "net::ERR_SSL_PROTOCOL_ERROR" && request != null) { ebWebView.loadUrl(request.url.buildUpon().scheme("http").build().toString())