Merge remote-tracking branch 'origin/master'

pull/1090/head
gedoor 3 years ago
commit 5d07cdcecb
  1. 3
      app/src/main/assets/epub/chapter.html
  2. 3
      app/src/main/assets/epub/cover.html
  3. 3
      app/src/main/assets/epub/intro.html
  4. 5
      app/src/main/java/io/legado/app/model/localBook/EpubFile.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt
  6. 4
      app/src/main/res/values-zh/strings.xml
  7. 14
      epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Chapter</title>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cover</title>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN">
<head>
<title>Intro</title>

@ -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

@ -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 ->

@ -764,8 +764,8 @@
<string name="import_str">导入</string>
<string name="export_str">导出</string>
<string name="save_theme_config">保存主题配置</string>
<string name="save_day_theme_summary">保存白天主题配置以调用和分享</string>
<string name="save_night_theme_summary">保存夜间主题配置以调用和分享</string>
<string name="save_day_theme_summary">保存白天主题配置以调用和分享</string>
<string name="save_night_theme_summary">保存夜间主题配置以调用和分享</string>
<string name="theme_list">主题列表</string>
<string name="theme_list_summary">使用保存主题,导入,分享主题</string>
<string name="select_theme">切换默认主题</string>

@ -43,17 +43,17 @@ public class ResourceUtil {
if (title.contains("</span>"))
title = "<span class=\"chapter-sequence-number\">" + 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);
}

Loading…
Cancel
Save