From 78781ff7574b9d0fb883c1c7c3702181093f3780 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 1 Mar 2020 13:09:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/http/AjaxWebView.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt b/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt index 81d0347b8..946b43f09 100644 --- a/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt +++ b/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt @@ -9,7 +9,11 @@ import android.os.Message import android.text.TextUtils import android.webkit.* import io.legado.app.App +import io.legado.app.R import io.legado.app.constant.AppConst +import io.legado.app.lib.dialogs.alert +import io.legado.app.lib.dialogs.cancelButton +import io.legado.app.lib.dialogs.okButton import org.apache.commons.text.StringEscapeUtils import java.lang.ref.WeakReference @@ -169,7 +173,11 @@ class AjaxWebView { } override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) { - handler.proceed() + App.INSTANCE.alert(titleResource = R.string.sure) { + message = "${view.url}证书不匹配,是否继续访问" + okButton { handler.proceed() } + cancelButton { handler.cancel() } + }.show() } } @@ -243,7 +251,11 @@ class AjaxWebView { } override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) { - handler.proceed() + App.INSTANCE.alert(titleResource = R.string.sure) { + message = "${view.url}证书不匹配,是否继续访问" + okButton { handler.proceed() } + cancelButton { handler.cancel() } + }.show() } override fun onPageFinished(view: WebView, url: String) {