From cd1ff46929dbc65af1e053ac212f4bda891c40b2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 18 Nov 2019 13:33:30 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/http/AjaxWebView.kt | 7 ++++--- .../java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 2 +- 2 files changed, 5 insertions(+), 4 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 662b71a6c..81d0347b8 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 @@ -92,7 +92,8 @@ class AjaxWebView { mHandler.obtainMessage(DESTROY_WEB_VIEW) } - class AjaxParams(val url: String, private val tag: String?) { + class AjaxParams(val url: String) { + var tag: String? = null var requestMethod = RequestMethod.GET var postData: ByteArray? = null var headerMap: Map? = null @@ -115,9 +116,9 @@ class AjaxWebView { get() = !TextUtils.isEmpty(sourceRegex) fun setCookie(url: String) { - if (tag != null) { + tag?.let { val cookie = CookieManager.getInstance().getCookie(url) - CookieStore.setCookie(tag, cookie) + CookieStore.setCookie(it, cookie) } } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 95ead6ef4..b776e2b31 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -272,7 +272,7 @@ class AnalyzeUrl( sourceRegex: String? = null ): Res { if (useWebView) { - val params = AjaxWebView.AjaxParams(url, tag) + val params = AjaxWebView.AjaxParams(url) params.headerMap = headerMap params.requestMethod = method params.javaScript = jsStr