From b3a7effe7b4d7e8cc212e2355ca81042a0c25f4d Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sat, 22 Jan 2022 19:24:08 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=85=8D=E8=B4=A3=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/about/AboutFragment.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index a88986385..18626bc06 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -20,7 +20,6 @@ import io.legado.app.utils.* class AboutFragment : PreferenceFragmentCompat() { private val licenseUrl = "https://github.com/gedoor/legado/blob/master/LICENSE" - private val disclaimerUrl = "https://gedoor.github.io/MyBookshelf/disclaimer.html" private val qqGroups = linkedMapOf( Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"), Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"), @@ -58,7 +57,7 @@ class AboutFragment : PreferenceFragmentCompat() { "git" -> openUrl(R.string.this_github_url) "home_page" -> openUrl(R.string.home_page_url) "license" -> requireContext().openUrl(licenseUrl) - "disclaimer" -> requireContext().openUrl(disclaimerUrl) + "disclaimer" -> showDisclaimer() "qq" -> showQqGroups() "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "crashLog" -> showCrashLogs() @@ -78,6 +77,11 @@ class AboutFragment : PreferenceFragmentCompat() { showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) } + private fun showDisclaimer() { + val disclaimer = String(requireContext().assets.open("disclaimer.md").readBytes()) + showDialogFragment(TextDialog(disclaimer, TextDialog.Mode.MD)) + } + private fun checkUpdate() { AppUpdate.checkFromGitHub(lifecycleScope) { newVersion, updateBody, url, name -> showDialogFragment( From 5d1cf5705beca003c2152f3a4346205ea842fb69 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sat, 22 Jan 2022 23:34:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=E8=AE=A2=E9=98=85=E6=BA=90=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E7=BC=96=E8=BE=91=20=E6=95=B0=E6=8D=AE=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/web/rssSource/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/web/rssSource/index.js b/app/src/main/assets/web/rssSource/index.js index 235abf332..c0a487909 100644 --- a/app/src/main/assets/web/rssSource/index.js +++ b/app/src/main/assets/web/rssSource/index.js @@ -76,14 +76,15 @@ function rule2json() { let RuleJSON = Container(); // 转换base Object.keys(RuleJSON).forEach(key => { - if (!key.startsWith("rule")) { RuleJSON[key] = $('#' + key).value; - } }); - + //类型转换 RuleJSON.lastUpdateTime = new Date().getTime(); RuleJSON.customOrder = RuleJSON.customOrder == '' ? 0 : parseInt(RuleJSON.customOrder); + RuleJSON.articleStyle = RuleJSON.articleStyle == '' ? 0 : parseInt(RuleJSON.articleStyle); RuleJSON.enabled = RuleJSON.enabled == '' || String(RuleJSON.enabled).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; + RuleJSON.loadWithBaseUrl = RuleJSON.loadWithBaseUrl == '' || String(RuleJSON.loadWithBaseUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; + RuleJSON.enableJs = RuleJSON.enableJs == '' || String(RuleJSON.enableJs).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; return RuleJSON; } // 将源对象填充到源表单 From ad8a70d435f17dbad3f9b7780091fbe16139df7a Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sun, 23 Jan 2022 08:27:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/AppUpdate.kt | 3 ++- .../io/legado/app/ui/about/AboutFragment.kt | 20 +++++++------------ app/src/main/res/values/non_translat.xml | 3 ++- app/src/main/res/xml/about.xml | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/AppUpdate.kt b/app/src/main/java/io/legado/app/help/AppUpdate.kt index c19713d6c..66aa2983a 100644 --- a/app/src/main/java/io/legado/app/help/AppUpdate.kt +++ b/app/src/main/java/io/legado/app/help/AppUpdate.kt @@ -1,5 +1,6 @@ package io.legado.app.help +import io.legado.app.R import io.legado.app.constant.AppConst import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.http.newCallStrResponse @@ -19,7 +20,7 @@ object AppUpdate { callback: (newVersion: String, updateBody: String, url: String, fileName: String) -> Unit ) { Coroutine.async(scope) { - val lastReleaseUrl = "https://api.github.com/repos/gedoor/legado/releases/latest" + val lastReleaseUrl = appCtx.getString(R.string.latest_release_api) val body = okHttpClient.newCallStrResponse { url(lastReleaseUrl) }.body diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index 18626bc06..bcd91439f 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -19,7 +19,6 @@ import io.legado.app.utils.* class AboutFragment : PreferenceFragmentCompat() { - private val licenseUrl = "https://github.com/gedoor/legado/blob/master/LICENSE" private val qqGroups = linkedMapOf( Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"), Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"), @@ -50,14 +49,14 @@ class AboutFragment : PreferenceFragmentCompat() { override fun onPreferenceTreeClick(preference: Preference?): Boolean { when (preference?.key) { "contributors" -> openUrl(R.string.contributors_url) - "update_log" -> showUpdateLog() + "update_log" -> show("updateLog.md") "check_update" -> checkUpdate() - "mail" -> requireContext().sendMail("kunfei.ge@gmail.com") + "mail" -> requireContext().sendMail(getString(R.string.email)) "sourceRuleSummary" -> openUrl(R.string.source_rule_url) "git" -> openUrl(R.string.this_github_url) "home_page" -> openUrl(R.string.home_page_url) - "license" -> requireContext().openUrl(licenseUrl) - "disclaimer" -> showDisclaimer() + "license" -> openUrl(R.string.license_url) + "disclaimer" -> show("disclaimer.md") "qq" -> showQqGroups() "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "crashLog" -> showCrashLogs() @@ -72,14 +71,9 @@ class AboutFragment : PreferenceFragmentCompat() { requireContext().openUrl(getString(addressID)) } - private fun showUpdateLog() { - val log = String(requireContext().assets.open("updateLog.md").readBytes()) - showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) - } - - private fun showDisclaimer() { - val disclaimer = String(requireContext().assets.open("disclaimer.md").readBytes()) - showDialogFragment(TextDialog(disclaimer, TextDialog.Mode.MD)) + private fun show(FileName: String) { + val mdText = String(requireContext().assets.open(FileName).readBytes()) + showDialogFragment(TextDialog(mdText, TextDialog.Mode.MD)) } private fun checkUpdate() { diff --git a/app/src/main/res/values/non_translat.xml b/app/src/main/res/values/non_translat.xml index a60fa193b..fc0439271 100644 --- a/app/src/main/res/values/non_translat.xml +++ b/app/src/main/res/values/non_translat.xml @@ -2,12 +2,13 @@ bookshelf_px 开源阅读 + kunfei.ge@gmail.com https://alanskycn.gitee.io/teachme/ https://github.com/gedoor/legado https://github.com/gedoor/legado/graphs/contributors - https://gedoor.github.io/MyBookshelf/disclaimer.html https://gedoor.github.io/MyBookshelf/ + https://github.com/gedoor/legado/blob/master/LICENSE https://github.com/gedoor/legado/releases/latest https://api.github.com/repos/gedoor/legado/releases/latest https://t.me/legado_channels diff --git a/app/src/main/res/xml/about.xml b/app/src/main/res/xml/about.xml index e961053bd..50df45820 100644 --- a/app/src/main/res/xml/about.xml +++ b/app/src/main/res/xml/about.xml @@ -43,7 +43,7 @@ From eb845ea7b93bce6949168a9bf0e11744457f5be5 Mon Sep 17 00:00:00 2001 From: Xwite <82232510+Xwite@users.noreply.github.com> Date: Sun, 23 Jan 2022 17:48:40 +0800 Subject: [PATCH 4/5] Update index.js --- app/src/main/assets/web/rssSource/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/assets/web/rssSource/index.js b/app/src/main/assets/web/rssSource/index.js index 19f80d090..95a80a588 100644 --- a/app/src/main/assets/web/rssSource/index.js +++ b/app/src/main/assets/web/rssSource/index.js @@ -78,7 +78,6 @@ function rule2json() { Object.keys(RuleJSON).forEach(key => { RuleJSON[key] = $('#' + key).value; }); - //类型转换 RuleJSON.lastUpdateTime = new Date().getTime(); RuleJSON.customOrder = RuleJSON.customOrder == '' ? 0 : parseInt(RuleJSON.customOrder); RuleJSON.articleStyle = RuleJSON.articleStyle == '' ? 0 : parseInt(RuleJSON.articleStyle); From 6461deecdd4eb4d78230c694af2e4a84c942f9d1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Jan 2022 10:30:33 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/web/rssSource/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/assets/web/rssSource/index.js b/app/src/main/assets/web/rssSource/index.js index 95a80a588..0be9448a1 100644 --- a/app/src/main/assets/web/rssSource/index.js +++ b/app/src/main/assets/web/rssSource/index.js @@ -84,7 +84,7 @@ function rule2json() { RuleJSON.enabled = RuleJSON.enabled == '' || String(RuleJSON.enabled).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; RuleJSON.enableJs = RuleJSON.enableJs == '' || String(RuleJSON.enableJs).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; RuleJSON.loadWithBaseUrl = RuleJSON.loadWithBaseUrl == '' || String(RuleJSON.loadWithBaseUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; - RuleJSON.singleUrl = RuleJSON.singleUrl == '' || String(RuleJSON.singleUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; + RuleJSON.singleUrl = String(RuleJSON.singleUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; return RuleJSON; } // 将源对象填充到源表单