From da5c5ecd30ced0e05c011453e421b7365d8ca602 Mon Sep 17 00:00:00 2001
From: fengyuecanzhu <1021300691@qq.com>
Date: Fri, 21 Jan 2022 12:53:05 +0800
Subject: [PATCH] fix bug
---
.../greendao/entity/rule/BookSource.java | 15 ++-
.../fycz/myreader/model/third3/BaseSource.kt | 18 ++--
.../xyz/fycz/myreader/model/third3/Debug.kt | 29 ++++++
.../model/third3/analyzeRule/AnalyzeRule.kt | 1 -
.../model/third3/analyzeRule/AnalyzeUrl.kt | 3 +-
.../model/third3/analyzeRule/JsExtensions.kt | 8 +-
.../ui/activity/SourceDebugActivity.java | 33 ++++++-
.../ui/activity/SourceEditActivity.java | 12 +++
.../main/res/layout/activity_source_debug.xml | 99 +++++++++----------
app/src/main/res/menu/menu_source_edit.xml | 5 +-
app/src/main/res/values/strings.xml | 2 +
11 files changed, 151 insertions(+), 74 deletions(-)
create mode 100644 app/src/main/java/xyz/fycz/myreader/model/third3/Debug.kt
diff --git a/app/src/main/java/xyz/fycz/myreader/greendao/entity/rule/BookSource.java b/app/src/main/java/xyz/fycz/myreader/greendao/entity/rule/BookSource.java
index a24f9c1..d878691 100644
--- a/app/src/main/java/xyz/fycz/myreader/greendao/entity/rule/BookSource.java
+++ b/app/src/main/java/xyz/fycz/myreader/greendao/entity/rule/BookSource.java
@@ -425,14 +425,21 @@ public class BookSource extends BaseSource implements Parcelable, Cloneable {
this.concurrentRate = concurrentRate;
}
+ @Nullable
@Override
- public String getHeader() {
- return sourceHeaders;
+ public String getConcurrentRateKt() {
+ return concurrentRate;
}
+ @Nullable
@Override
- public void setHeader(@Nullable String header) {
- this.sourceHeaders = header;
+ public String getLoginUrlKt() {
+ return loginUrl;
+ }
+
+ @Override
+ public String getHeader() {
+ return sourceHeaders;
}
@NonNull
diff --git a/app/src/main/java/xyz/fycz/myreader/model/third3/BaseSource.kt b/app/src/main/java/xyz/fycz/myreader/model/third3/BaseSource.kt
index baca4fe..f4f3027 100644
--- a/app/src/main/java/xyz/fycz/myreader/model/third3/BaseSource.kt
+++ b/app/src/main/java/xyz/fycz/myreader/model/third3/BaseSource.kt
@@ -17,10 +17,16 @@ import javax.script.SimpleBindings
@Suppress("unused")
abstract class BaseSource : JsExtensions {
- open var concurrentRate: String? = null // 并发率
- open var loginUrl: String? = null // 登录地址
- //var loginUi: String? // 登录UI
- open var header: String? = null // 请求头
+ //var concurrentRate: String? // 并发率
+ //var loginUrl: String? // 登录地址
+ //var loginUi: String? // 登录UI
+ //var header: String? // 请求头
+
+ open fun getConcurrentRateKt(): String? = null // 并发率
+
+ open fun getLoginUrlKt(): String? = null // 登录地址
+
+ open fun getHeader(): String? = null // 请求头
open fun getTag(): String = ""
@@ -31,7 +37,7 @@ abstract class BaseSource : JsExtensions {
}*/
fun getLoginJs(): String? {
- val loginJs = loginUrl
+ val loginJs = getLoginUrlKt()
return when {
loginJs == null -> null
loginJs.startsWith("@js:") -> loginJs.substring(4)
@@ -52,7 +58,7 @@ abstract class BaseSource : JsExtensions {
*/
fun getHeaderMap(hasLoginHeader: Boolean = false) = HashMap().apply {
this[APPCONST.UA_NAME] = APPCONST.DEFAULT_USER_AGENT
- header?.let {
+ getHeader()?.let {
GSON.fromJsonObject
解析结果
网页源码
+ 调试日志
重新请求
测试搜索配置
测试书籍详情
@@ -540,6 +541,7 @@
没有网络
网络连接超时
数据解析失败
+ 拷贝书源