소스 검색

书源校验:不显示调试符号

Xwite 4 년 전
부모
커밋
ded9f86a4e
2개의 변경된 파일과 5개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      app/src/main/java/io/legado/app/constant/AppPattern.kt
  2. 2 1
      app/src/main/java/io/legado/app/model/Debug.kt

+ 3 - 0
app/src/main/java/io/legado/app/constant/AppPattern.kt

@@ -16,6 +16,9 @@ object AppPattern {
     val fileNameRegex = Regex("[\\\\/:*?\"<>|.]")
     val splitGroupRegex = Regex("[,;,;]")
 
+    //书源调试信息中的各种符号
+    val debugMessageSymbolRegex = Regex("[⇒◇┌└≡]")
+
     /**
      * 所有标点
      */

+ 2 - 1
app/src/main/java/io/legado/app/model/Debug.kt

@@ -1,6 +1,7 @@
 package io.legado.app.model
 
 import android.annotation.SuppressLint
+import io.legado.app.constant.AppPattern
 import io.legado.app.data.entities.*
 import io.legado.app.help.coroutine.CompositeCoroutine
 import io.legado.app.model.rss.Rss
@@ -56,7 +57,7 @@ object Debug {
                 if (showTime && debugTimeMap[sourceUrl] != null) {
                     val time =
                         debugTimeFormat.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!))
-                    printMsg = printMsg.substring(1)
+                    printMsg = printMsg.replace(AppPattern.debugMessageSymbolRegex,"")
                     debugMessageMap[sourceUrl] = "$time $printMsg"
                 }
             }