diff --git a/.github/workflows/legado.yml b/.github/workflows/legado.yml index f12eb4826..4d9940f4d 100644 --- a/.github/workflows/legado.yml +++ b/.github/workflows/legado.yml @@ -28,7 +28,7 @@ jobs: # 蓝奏云里的文件夹名(需手动在蓝奏云创建) LANZOU_FOLDER: '阅读3测试版' # 是否上传到artifact - UPLOAD_ARTIFACT: 'true' + UPLOAD_ARTIFACT: 'false' steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 @@ -57,7 +57,7 @@ jobs: echo "开始进行release构建" chmod +x gradlew ./gradlew assembleAppRelease - - name: upload apk + - name: Upload App To Artifact if: ${{ env.UPLOAD_ARTIFACT != 'false' }} uses: actions/upload-artifact@v2 with: @@ -83,7 +83,7 @@ jobs: f.write(res.content) env: FILEPATH: ${{ github.workspace }}/.github/lzy.py - - name: Upload App + - name: Upload App To Lanzou if: ${{ env.LANZOU_PSD }} run: python $GITHUB_WORKSPACE/.github/lzy.py env: diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 835862fc0..31dbb55b8 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -36,9 +36,8 @@ object AppConst { val keyboardToolChars: List by lazy { arrayListOf( - "❓", "@", "&", "|", "%", "/", "\\", ":", "[", "]", "{", "}", "<", ">", - "$", "#", "!", ".", "+", "-", "*", "=", "href", "src", "textNodes", "xpath", "json", - "css", "id", "class", "tag" + "❓", "@css:", "", "{{}}", "&&", "%%", "||", "//", "$.", "@", "class", "id", "href", + "textNodes", "ownText", "all", "html", "[", "]", "<", ">","#", "!", ".", "+", "-", "*", "=" ) } @@ -69,4 +68,4 @@ object AppConst { ) val sysElevation = App.INSTANCE.resources.getDimension(R.dimen.design_appbar_elevation).toInt() -} \ No newline at end of file +} diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index 825141793..04f3c7744 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -54,10 +54,10 @@ interface JsExtensions { } /** - * 实现文件下载,返回路径 + * 实现16进制字符串转文件 */ fun downloadFile(content: String, url: String): String { - val type = AnalyzeUrl(url).type ?: return "type为空,未下载" + val type = AnalyzeUrl(url).type ?: return "" val zipPath = FileUtils.getPath( FileUtils.createFolderIfNotExist(FileUtils.getCachePath()), "${MD5Utils.md5Encode16(url)}.${type}" @@ -76,6 +76,7 @@ interface JsExtensions { * js实现压缩文件解压 */ fun unzipFile(zipPath: String): String { + if (zipPath.isEmpty()) return "" val unzipPath = FileUtils.getPath( FileUtils.createFolderIfNotExist(FileUtils.getCachePath()), FileUtils.getNameExcludeExtension(zipPath) @@ -92,6 +93,7 @@ interface JsExtensions { * js实现文件夹内所有文件读取 */ fun getTxtInFolder(unzipPath: String): String { + if (unzipPath.isEmpty()) return "" val unzipFolder = FileUtils.createFolderIfNotExist(unzipPath) val contents = StringBuilder() unzipFolder.listFiles().let { @@ -109,7 +111,7 @@ interface JsExtensions { } /** - * js实现重定向拦截,不能删 + * js实现重定向拦截,网络访问get */ fun get(urlStr: String, headers: Map): Connection.Response { return Jsoup.connect(urlStr) @@ -279,7 +281,7 @@ interface JsExtensions { val oldCode = s.toInt() if (font1.InLimit(s)) { val code = font2.GetCodeByGlyf(font1.GetGlyfByCode(oldCode)) - if(code != 0) contentArray[index] = code.toChar() + if (code != 0) contentArray[index] = code.toChar() } } return contentArray.joinToString("") 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 877fcf41b..877081cbc 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 @@ -70,7 +70,7 @@ object BookInfo { analyzeRule.getString(infoRule.intro).let { if (it.isNotEmpty()) book.intro = it.htmlFormat() } - Debug.log(bookSource.bookSourceUrl, "└${book.intro}", isHtml = true) + Debug.log(bookSource.bookSourceUrl, "└${book.intro}") Debug.log(bookSource.bookSourceUrl, "┌获取封面链接") analyzeRule.getString(infoRule.coverUrl).let { 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 fd2697587..464580854 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 @@ -163,7 +163,7 @@ object BookList { if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取简介") searchBook.intro = analyzeRule.getString(intro).htmlFormat() - Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}", true) + Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}") if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取封面链接") searchBook.coverUrl = analyzeRule.getString(coverUrl, true) @@ -223,7 +223,7 @@ object BookList { if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取简介", log) searchBook.intro = analyzeRule.getString(ruleIntro).htmlFormat() - Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}", log, true) + Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}", log) if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取封面链接", log) analyzeRule.getString(ruleCoverUrl).let {