From 04f3a2f81984db51a213bd7f6e45cf853940aa33 Mon Sep 17 00:00:00 2001 From: fisher Date: Fri, 25 Jun 2021 22:20:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fixed=20"=E4=BB=A5=E5=85=B1"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values-zh/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 011f56181..b617a26b5 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -764,8 +764,8 @@ 导入 导出 保存主题配置 - 保存白天主题配置以共调用和分享 - 保存夜间主题配置以共调用和分享 + 保存白天主题配置以供调用和分享 + 保存夜间主题配置以供调用和分享 主题列表 使用保存主题,导入,分享主题 切换默认主题 From e73bcc65b96353ca73ff4311628482c538d699c7 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Sat, 26 Jun 2021 10:06:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E5=AF=BC=E5=87=BAepub=E5=A4=B1=E8=B4=A5=20?= =?UTF-8?q?=E8=BF=99=E9=87=8C=E6=B2=A1=E5=BF=85=E8=A6=81=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/localBook/EpubFile.kt | 5 +++-- .../java/me/ag2s/epublib/util/ResourceUtil.java | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt index 062816b13..5365be900 100644 --- a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt @@ -30,10 +30,11 @@ class EpubFile(var book: Book) { @Synchronized private fun getEFile(book: Book): EpubFile { BookHelp.getEpubFile(book) - //对于Epub文件默认不启用替换 - book.setUseReplaceRule(false) + if (eFile == null || eFile?.book?.bookUrl != book.bookUrl) { eFile = EpubFile(book) + //对于Epub文件默认不启用替换 + book.setUseReplaceRule(false) return eFile!! } eFile?.book = book diff --git a/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java b/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java index f270bdbb3..853d1a5e4 100644 --- a/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java +++ b/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java @@ -43,17 +43,17 @@ public class ResourceUtil { if (title.contains("")) title = "" + title; } - String html = model.replaceAll("\\{title\\}", title) - .replaceAll("\\{content\\}", StringUtil.formatHtml(txt)); + String html = model.replace("{title}", title) + .replace("{content}", StringUtil.formatHtml(txt)); return new Resource(html.getBytes(), href); } public static Resource createPublicResource(String name, String author, String intro, String kind, String wordCount, String model, String href) { - String html = model.replaceAll("\\{name\\}", name) - .replaceAll("\\{author\\}", author) - .replaceAll("\\{kind\\}", kind) - .replaceAll("\\{wordCount\\}", wordCount) - .replaceAll("\\{intro\\}", StringUtil.formatHtml(intro)); + String html = model.replace("{name}", name) + .replace("{author}", author) + .replace("{kind}", kind) + .replace("{wordCount}", wordCount) + .replace("{intro}", StringUtil.formatHtml(intro)); return new Resource(html.getBytes(), href); } From b0317b5609dc2a9a7a0208957b3ffff7565baa14 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Sat, 26 Jun 2021 11:23:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=88=90html5=E7=9A=84do?= =?UTF-8?q?ctype,=E8=8A=82=E7=9C=81=E7=A9=BA=E9=97=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/epub/chapter.html | 3 +-- app/src/main/assets/epub/cover.html | 3 +-- app/src/main/assets/epub/intro.html | 3 +-- .../main/java/io/legado/app/ui/book/cache/CacheViewModel.kt | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/assets/epub/chapter.html b/app/src/main/assets/epub/chapter.html index 8503c3f97..6067f6649 100644 --- a/app/src/main/assets/epub/chapter.html +++ b/app/src/main/assets/epub/chapter.html @@ -1,6 +1,5 @@ - + Chapter diff --git a/app/src/main/assets/epub/cover.html b/app/src/main/assets/epub/cover.html index 268cc3f85..cb6df6353 100644 --- a/app/src/main/assets/epub/cover.html +++ b/app/src/main/assets/epub/cover.html @@ -1,6 +1,5 @@ - + Cover diff --git a/app/src/main/assets/epub/intro.html b/app/src/main/assets/epub/intro.html index 85eb28a63..5c64026f8 100644 --- a/app/src/main/assets/epub/intro.html +++ b/app/src/main/assets/epub/intro.html @@ -1,6 +1,5 @@ - + Intro diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt index f89d997c3..81f866866 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt @@ -233,7 +233,7 @@ class CacheViewModel(application: Application) : BaseViewModel(application) { } private fun setAssets(doc: DocumentFile, book: Book, epubBook: EpubBook): String { - if(!AppConfig.isGooglePlay) return setAssets(book, epubBook) + if(!(AppConfig.isGooglePlay|| appCtx.packageName.contains("debug",true))) return setAssets(book, epubBook) var contentModel = "" DocumentUtils.getDirDocument(doc, "Asset").let { customPath ->