diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index 2e7ebfb38..0867fd95e 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -32,7 +32,7 @@ object BookChapterList { appCtx.getString(R.string.error_get_web_content, baseUrl) ) Debug.log(bookSource.bookSourceUrl, "≡获取成功:${baseUrl}") - + Debug.log(bookSource.bookSourceUrl, body, state = 30) val tocRule = bookSource.getTocRule() val nextUrlList = arrayListOf(baseUrl) var reverse = false diff --git a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt index 574a9acdf..8eef8d50b 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt @@ -33,6 +33,7 @@ object BookContent { appCtx.getString(R.string.error_get_web_content, baseUrl) ) Debug.log(bookSource.bookSourceUrl, "≡获取成功:${baseUrl}") + Debug.log(bookSource.bookSourceUrl, body, state = 40) val mNextChapterUrl = if (!nextChapterUrl.isNullOrEmpty()) { nextChapterUrl } else { diff --git a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt index 5bd30e2b3..bb3e99a39 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt @@ -29,6 +29,7 @@ object BookInfo { appCtx.getString(R.string.error_get_web_content, baseUrl) ) Debug.log(bookSource.bookSourceUrl, "≡获取成功:${baseUrl}") + Debug.log(bookSource.bookSourceUrl, body, state = 20) val analyzeRule = AnalyzeRule(book) analyzeRule.setContent(body).setBaseUrl(baseUrl) analyzeRule.setRedirectUrl(redirectUrl) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookList.kt b/app/src/main/java/io/legado/app/model/webBook/BookList.kt index c24192ab2..64c0618d9 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookList.kt @@ -36,6 +36,7 @@ object BookList { ) ) Debug.log(bookSource.bookSourceUrl, "≡获取成功:${analyzeUrl.ruleUrl}") + Debug.log(bookSource.bookSourceUrl, body, state = 10) val analyzeRule = AnalyzeRule(variableBook) analyzeRule.setContent(body).setBaseUrl(baseUrl) analyzeRule.setRedirectUrl(baseUrl) diff --git a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt index 977502eba..ffb21b7bf 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt @@ -96,8 +96,18 @@ class BookSourceDebugActivity : VMBaseActivity { - qrCodeResult.launch(null) + R.id.menu_scan -> qrCodeResult.launch(null) + R.id.menu_search_src -> { + + } + R.id.menu_book_src -> { + + } + R.id.menu_toc_src -> { + + } + R.id.menu_content_src -> { + } R.id.menu_help -> showHelp() } diff --git a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugModel.kt b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugModel.kt index 3ce462f24..43e969e97 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugModel.kt @@ -10,8 +10,11 @@ class BookSourceDebugModel(application: Application) : BaseViewModel(application Debug.Callback { private var webBook: WebBook? = null - - private var callback: ((Int, String)-> Unit)? = null + private var callback: ((Int, String) -> Unit)? = null + var searchSrc: String? = null + var bookSrc: String? = null + var tocSrc: String? = null + var contentSrc: String? = null fun init(sourceUrl: String?) { sourceUrl?.let { @@ -39,7 +42,13 @@ class BookSourceDebugModel(application: Application) : BaseViewModel(application } override fun printLog(state: Int, msg: String) { - callback?.invoke(state, msg) + when (state) { + 10 -> searchSrc = msg + 20 -> bookSrc = msg + 30 -> tocSrc = msg + 40 -> contentSrc = msg + else -> callback?.invoke(state, msg) + } } override fun onCleared() {