diff --git a/app/src/main/java/io/legado/app/data/entities/BaseSource.kt b/app/src/main/java/io/legado/app/data/entities/BaseSource.kt index 63101f23c..8a67c9ef7 100644 --- a/app/src/main/java/io/legado/app/data/entities/BaseSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BaseSource.kt @@ -13,7 +13,6 @@ import io.legado.app.help.config.AppConfig import io.legado.app.help.crypto.SymmetricCryptoAndroid import io.legado.app.help.http.CookieStore import io.legado.app.help.source.getShareScope -import io.legado.app.model.Debug import io.legado.app.utils.GSON import io.legado.app.utils.GSONStrict import io.legado.app.utils.fromJsonArray @@ -116,7 +115,7 @@ interface BaseSource : JsExtensions { GSONStrict.fromJsonObject>(json).getOrNull()?.let { map -> putAll(map) } ?: GSON.fromJsonObject>(json).getOrNull()?.let { map -> - Debug.log("≡请求头规则 JSON 格式不规范,请改为规范格式") + log("请求头规则 JSON 格式不规范,请改为规范格式") putAll(map) } } catch (e: Exception) { 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 3987bb6ae..5a1caf9fe 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 @@ -39,7 +39,6 @@ import io.legado.app.help.http.postForm import io.legado.app.help.http.postJson import io.legado.app.help.http.postMultipart import io.legado.app.help.source.getShareScope -import io.legado.app.model.Debug import io.legado.app.utils.EncoderUtils import io.legado.app.utils.GSON import io.legado.app.utils.GSONStrict @@ -225,32 +224,32 @@ class AnalyzeUrl( if (urlOption == null) { urlOption = GSON.fromJsonObject(urlOptionStr).getOrNull() if (urlOption != null) { - Debug.log("≡链接参数 JSON 格式不规范,请改为规范格式") + log("链接参数 JSON 格式不规范,请改为规范格式") } } urlOption?.let { option -> - option.getMethod()?.let { - if (it.equals("POST", true)) method = RequestMethod.POST - } - option.getHeaderMap()?.forEach { entry -> - headerMap[entry.key.toString()] = entry.value.toString() - } - option.getBody()?.let { - body = it - } - type = option.getType() - charset = option.getCharset() - retry = option.getRetry() - useWebView = option.useWebView() - webJs = option.getWebJs() - option.getJs()?.let { jsStr -> - evalJS(jsStr, url)?.toString()?.let { - url = it - } - } - serverID = option.getServerID() - webViewDelayTime = max(0, option.getWebViewDelayTime() ?: 0) + option.getMethod()?.let { + if (it.equals("POST", true)) method = RequestMethod.POST } + option.getHeaderMap()?.forEach { entry -> + headerMap[entry.key.toString()] = entry.value.toString() + } + option.getBody()?.let { + body = it + } + type = option.getType() + charset = option.getCharset() + retry = option.getRetry() + useWebView = option.useWebView() + webJs = option.getWebJs() + option.getJs()?.let { jsStr -> + evalJS(jsStr, url)?.toString()?.let { + url = it + } + } + serverID = option.getServerID() + webViewDelayTime = max(0, option.getWebViewDelayTime() ?: 0) + } } urlNoQuery = url when (method) {