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