From bdfb91744d0af53fd6a5e0fc9a1646f27502bc90 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 29 Jul 2020 17:21:51 +0800 Subject: [PATCH] =?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/build.gradle | 4 ++++ app/src/main/java/io/legado/app/help/AppConfig.kt | 2 ++ app/src/main/java/io/legado/app/help/SourceHelp.kt | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 26acce2d3..b0e542d8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,6 +85,10 @@ android { applicationId "io.legado.play" manifestPlaceholders = [APP_CHANNEL_VALUE: "google"] } + coolApk { + dimension "version" + manifestPlaceholders = [APP_CHANNEL_VALUE: "coolApk"] + } } compileOptions { // Flag to enable support for the new language APIs diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 43d4e8ac3..0c4851f61 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -137,5 +137,7 @@ object AppConfig { val readBodyToLh: Boolean get() = App.INSTANCE.getPrefBoolean(PreferKey.readBodyToLh, true) val isGooglePlay: Boolean get() = App.INSTANCE.channel == "google" + + val isCoolApk: Boolean get() = App.INSTANCE.channel == "coolApk" } diff --git a/app/src/main/java/io/legado/app/help/SourceHelp.kt b/app/src/main/java/io/legado/app/help/SourceHelp.kt index 85955559b..46d4c83d6 100644 --- a/app/src/main/java/io/legado/app/help/SourceHelp.kt +++ b/app/src/main/java/io/legado/app/help/SourceHelp.kt @@ -48,7 +48,7 @@ object SourceHelp { private fun is18Plus(url: String?): Boolean { url ?: return false - if (AppConfig.isGooglePlay) return false + if (!AppConfig.isCoolApk) return false val baseUrl = NetworkUtils.getBaseUrl(url) baseUrl ?: return false try {