From 16a78320be0944ad7f2448b5cc7282b951ac0161 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 12 Dec 2020 12:08:02 +0800 Subject: [PATCH 1/2] update lib --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 2403cd321..550d06afc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -166,7 +166,7 @@ dependencies { implementation 'org.jsoup:jsoup:1.13.1' //noinspection GradleDependency implementation 'cn.wanghaomiao:JsoupXpath:2.3.2' - implementation 'com.jayway.jsonpath:json-path:2.4.0' + implementation 'com.jayway.jsonpath:json-path:2.5.0' //JS rhino implementation 'com.github.gedoor:rhino-android:1.4' From a455f773bee257d5bc7354b3a1048b878c03db74 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 12 Dec 2020 12:40:47 +0800 Subject: [PATCH 2/2] update AnalyzeRule.kt --- .../java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index bf812256e..3954cee2f 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -163,7 +163,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { if (result is List<*>) { for (url in result as List<*>) { val absoluteURL = NetworkUtils.getAbsoluteURL(baseURL, url.toString()) - if (!absoluteURL.isNullOrEmpty() && !urlList.contains(absoluteURL)) { + if (absoluteURL.isNotEmpty() && !urlList.contains(absoluteURL)) { urlList.add(absoluteURL) } } @@ -231,7 +231,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { return if (str.isBlank()) { baseUrl ?: "" } else { - NetworkUtils.getAbsoluteURL(baseURL, str) ?: "" + NetworkUtils.getAbsoluteURL(baseURL, str) } } return str @@ -573,8 +573,8 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { rule = infoVal.toString() } //分离正则表达式 - val ruleStrS = rule.trim { it <= ' ' }.split("##") - rule = ruleStrS[0] + val ruleStrS = rule.split("##") + rule = ruleStrS[0].trim() if (ruleStrS.size > 1) { replaceRegex = ruleStrS[1] }