From a578edb82c15f2038668a58b9d0a23c234066df5 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 5 Jun 2022 09:49:54 -0400 Subject: [PATCH] Update to extensions-lib 1.3 (#11878) --- .github/workflows/build_pull_request.yml | 6 +++--- .github/workflows/build_push.yml | 6 +++--- CONTRIBUTING.md | 2 +- common.gradle | 2 +- gradle/libs.versions.toml | 19 +++++++++++-------- multisrc/build.gradle.kts | 9 ++++++++- .../fmreader/manhwa18/src/Manhwa18.kt | 4 ++-- .../src/FoolSlideCustomizableFactory.kt | 4 ++-- .../madara/neoxscanlator/src/NeoxScanlator.kt | 4 ++-- .../multisrc/bakkin/BakkinReaderX.kt | 4 ++-- .../tachiyomi/multisrc/comicake/ComiCake.kt | 4 ++-- .../eu/kanade/tachiyomi/multisrc/guya/Guya.kt | 4 ++-- .../multisrc/mangadventure/MangAdventure.kt | 4 ++-- .../tachiyomi/extension/all/cubari/Cubari.kt | 4 ++-- .../tachiyomi/extension/all/kavita/Kavita.kt | 12 ++++++------ .../tachiyomi/extension/all/komga/Komga.kt | 7 ++++--- .../tachiyomi/extension/all/mango/Mango.kt | 4 ++-- .../extension/ca/fansubscat/FansubsCat.kt | 4 ++-- .../extension/en/vgperson/Vgperson.kt | 4 ++-- .../extension/en/warforrayuba/WarForRayuba.kt | 4 ++-- .../tachiyomi/extension/ko/jmana/JMana.kt | 4 ++-- .../tachiyomi/extension/ko/newtoki/NewToki.kt | 4 ++-- .../tachiyomi/extension/ko/toonkor/Toonkor.kt | 4 ++-- .../extension/ru/mangaclub/MangaClub.kt | 2 +- src/zh/mangabz/build.gradle | 1 - .../extension/zh/wuqimanga/WuqiManga.kt | 2 +- 26 files changed, 69 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index ea160a11f..7f37a3c20 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -27,7 +27,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files @@ -79,7 +79,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files @@ -117,7 +117,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index c5c211e24..02965c628 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -35,7 +35,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files @@ -87,7 +87,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files @@ -138,7 +138,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 11 distribution: adopt - name: Copy CI files diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9b56cd1b..8ec3383b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -124,7 +124,7 @@ apply from: "$rootDir/common.gradle" | `pkgNameSuffix` | A unique suffix added to `eu.kanade.tachiyomi.extension`. The language and the site name should be enough. Remember your extension code implementation must be placed in this package. | | `extClass` | Points to the class that implements `Source`. You can use a relative path starting with a dot (the package name is the base path). This is used to find and instantiate the source(s). | | `extVersionCode` | The extension version code. This must be a positive integer and incremented with any change to the code. | -| `libVersion` | (Optional, defaults to `1.2`) The version of the [extensions library](https://github.com/tachiyomiorg/extensions-lib) used. | +| `libVersion` | (Optional, defaults to `1.3`) The version of the [extensions library](https://github.com/tachiyomiorg/extensions-lib) used. | | `isNsfw` | (Optional, defaults to `false`) Flag to indicate that a source contains NSFW content. | The extension's version name is generated automatically by concatenating `libVersion` and `extVersionCode`. With the example used above, the version would be `1.2.1`. diff --git a/common.gradle b/common.gradle index fa4222513..5fc2cee05 100644 --- a/common.gradle +++ b/common.gradle @@ -22,7 +22,7 @@ android { targetSdkVersion AndroidConfig.targetSdk applicationIdSuffix pkgNameSuffix versionCode extVersionCode - versionName project.ext.properties.getOrDefault("libVersion", "1.2") + ".$extVersionCode" + versionName project.ext.properties.getOrDefault("libVersion", "1.3") + ".$extVersionCode" setProperty("archivesBaseName", "tachiyomi-$pkgNameSuffix-v$versionName") def readmes = project.projectDir.listFiles({ File file -> file.name.equals("README.md") || diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a0318d1b9..3ef11b451 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,29 +1,32 @@ [versions] -kotlin_version = "1.4.32" -coroutines_version = "1.4.3" +kotlin_version = "1.6.10" +coroutines_version = "1.6.0" +serialization_version = "1.3.2" [libraries] -gradle-agp = { module = "com.android.tools.build:gradle", version = "4.2.1" } +gradle-agp = { module = "com.android.tools.build:gradle", version = "7.1.2" } gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin_version" } gradle-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin_version" } -gradle-kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version = "3.4.0" } +gradle-kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version = "3.6.0" } -tachiyomi-lib = { module = "com.github.tachiyomiorg:extensions-lib", version = "58b2d3a" } +tachiyomi-lib = { module = "com.github.tachiyomiorg:extensions-lib", version = "1.3.1" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin_version" } -kotlin-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version = "1.2.0" } -kotlin-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.2.0" } +kotlin-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization_version" } +kotlin-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_version" } coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines_version" } coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines_version" } injekt-core = { module = "com.github.inorichi.injekt:injekt-core", version = "65b0440" } jsoup = { module = "org.jsoup:jsoup", version = "1.13.1" } +duktape = { module = "com.squareup.duktape:duktape-android", version = "1.4.0" } +quickjs = { module = "app.cash.quickjs:quickjs-android", version = "0.9.2" } okhttp = { module = "com.squareup.okhttp3:okhttp", version = "4.9.1" } rxandroid = { module = "io.reactivex:rxandroid", version = "1.2.1" } rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" } [bundles] -common = ["tachiyomi-lib", "jsoup", "okhttp", "kotlin-stdlib", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json"] +common = ["kotlin-stdlib", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json", "jsoup", "okhttp", "tachiyomi-lib", "duktape", "quickjs"] coroutines = ["coroutines-core", "coroutines-android"] reactivex = ["rxandroid"] diff --git a/multisrc/build.gradle.kts b/multisrc/build.gradle.kts index c76a58361..14644936a 100644 --- a/multisrc/build.gradle.kts +++ b/multisrc/build.gradle.kts @@ -20,6 +20,12 @@ repositories { mavenCentral() } +configurations { + compileOnly { + isCanBeResolved = true + } +} + dependencies { compileOnly(libs.bundles.common) } @@ -28,7 +34,8 @@ tasks { val generateExtensions by registering { doLast { val isWindows = System.getProperty("os.name").toString().toLowerCase().contains("win") - var classPath = (configurations.debugCompileOnly.get().asFileTree.toList() + + var classPath = ( + configurations.compileOnly.get().asFileTree.toList() + listOf( configurations.androidApis.get().asFileTree.first().absolutePath, // android.jar path "$projectDir/build/intermediates/aar_main_jar/debug/classes.jar" // jar made from this module diff --git a/multisrc/overrides/fmreader/manhwa18/src/Manhwa18.kt b/multisrc/overrides/fmreader/manhwa18/src/Manhwa18.kt index 2d2b48930..3001a7cff 100644 --- a/multisrc/overrides/fmreader/manhwa18/src/Manhwa18.kt +++ b/multisrc/overrides/fmreader/manhwa18/src/Manhwa18.kt @@ -77,8 +77,8 @@ class Manhwa18 : FMReader("Manhwa18", "https://manhwa18.com", "en") { name = element.attr("title") date_upload = SimpleDateFormat("dd/MM/yyyy", Locale.US).parse( - element.select(".chapter-time").text().substringAfter(" - ") - )?.time ?: 0L + element.select(".chapter-time").text().substringAfter(" - ") + )?.time ?: 0L chapter_number = element.attr("time").substringAfterLast(' ').toFloatOrNull() ?: -1f } } diff --git a/multisrc/overrides/foolslide/foolslidecustomizable/src/FoolSlideCustomizableFactory.kt b/multisrc/overrides/foolslide/foolslidecustomizable/src/FoolSlideCustomizableFactory.kt index 36640e2eb..0d1999663 100644 --- a/multisrc/overrides/foolslide/foolslidecustomizable/src/FoolSlideCustomizableFactory.kt +++ b/multisrc/overrides/foolslide/foolslidecustomizable/src/FoolSlideCustomizableFactory.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.extension.all.foolslidecustomizable import android.widget.Toast import androidx.preference.EditTextPreference import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.multisrc.foolslide.FoolSlide import eu.kanade.tachiyomi.source.SourceFactory @@ -42,7 +42,7 @@ class FoolSlideCustomizable : FoolSlide("FoolSlide Customizable", "", "other") { companion object { private const val DEFAULT_BASEURL = "https://127.0.0.1" private const val BASE_URL_PREF_TITLE = "Example URL: https://domain.com/path_to/directory/" - private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}" + private val BASE_URL_PREF = "overrideBaseUrl_v${AppInfo.getVersionName()}" private const val BASE_URL_PREF_SUMMARY = "Connect to a designated FoolSlide server" private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting." } diff --git a/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt b/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt index 9e0df5ee4..4206c3a31 100644 --- a/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt +++ b/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt @@ -5,7 +5,7 @@ import android.content.SharedPreferences import android.widget.Toast import androidx.preference.EditTextPreference import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET @@ -274,7 +274,7 @@ class NeoxScanlator : private const val REFERER = "https://google.com/" private const val DEFAULT_BASE_URL = "https://neoxscans.net" - private val BASE_URL_PREF_KEY = "base_url_${BuildConfig.VERSION_NAME}" + private val BASE_URL_PREF_KEY = "base_url_${AppInfo.getVersionName()}" private const val BASE_URL_PREF_TITLE = "URL da fonte" private const val BASE_URL_PREF_SUMMARY = "Para uso temporário. Quando você atualizar a " + "extensão, esta configuração será apagada." diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bakkin/BakkinReaderX.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bakkin/BakkinReaderX.kt index 94a344634..64a584902 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bakkin/BakkinReaderX.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bakkin/BakkinReaderX.kt @@ -4,7 +4,7 @@ import android.app.Application import android.os.Build import androidx.preference.ListPreference import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.ConfigurableSource @@ -31,7 +31,7 @@ abstract class BakkinReaderX( private val userAgent = "Mozilla/5.0 (" + "Android ${Build.VERSION.RELEASE}; Mobile) " + - "Tachiyomi/${BuildConfig.VERSION_NAME}" + "Tachiyomi/${AppInfo.getVersionName()}" protected val preferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000)!! diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/comicake/ComiCake.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/comicake/ComiCake.kt index 32ea95e7b..12bc68983 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/comicake/ComiCake.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/comicake/ComiCake.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.multisrc.comicake import android.os.Build -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.model.FilterList @@ -34,7 +34,7 @@ abstract class ComiCake( private val userAgent = "Mozilla/5.0 (" + "Android ${Build.VERSION.RELEASE}; Mobile) " + - "Tachiyomi/${BuildConfig.VERSION_NAME}" + "Tachiyomi/${AppInfo.getVersionName()}" override fun headersBuilder() = Headers.Builder().apply { add("User-Agent", userAgent) diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/Guya.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/Guya.kt index 7bb1ae9cd..4b02697f2 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/Guya.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/Guya.kt @@ -5,7 +5,7 @@ import android.content.SharedPreferences import android.os.Build import androidx.preference.ListPreference import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservableSuccess @@ -40,7 +40,7 @@ abstract class Guya( "User-Agent", "(Android ${Build.VERSION.RELEASE}; " + "${Build.MANUFACTURER} ${Build.MODEL}) " + - "Tachiyomi/${BuildConfig.VERSION_NAME} ${Build.ID}" + "Tachiyomi/${AppInfo.getVersionName()} ${Build.ID}" ) private val scanlators: ScanlatorStore = ScanlatorStore() diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangadventure/MangAdventure.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangadventure/MangAdventure.kt index b7ce6b1dc..5e5ba6edb 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangadventure/MangAdventure.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangadventure/MangAdventure.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.multisrc.mangadventure import android.net.Uri import android.os.Build.VERSION -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.model.FilterList @@ -36,7 +36,7 @@ abstract class MangAdventure( /** A user agent representing Tachiyomi. */ private val userAgent = "Mozilla/5.0 " + "(Android ${VERSION.RELEASE}; Mobile) " + - "Tachiyomi/${BuildConfig.VERSION_NAME}" + "Tachiyomi/${AppInfo.getVersionName()}" /** The URI of the site's API. */ private val apiUri by lazy { diff --git a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt index 46a611cdc..11fef9e4c 100644 --- a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt +++ b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.extension.all.cubari import android.app.Application import android.os.Build -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.model.FilterList @@ -42,7 +42,7 @@ open class Cubari(override val lang: String) : HttpSource() { "User-Agent", "(Android ${Build.VERSION.RELEASE}; " + "${Build.MANUFACTURER} ${Build.MODEL}) " + - "Tachiyomi/${BuildConfig.VERSION_NAME} " + + "Tachiyomi/${AppInfo.getVersionName()} " + Build.ID ) } diff --git a/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt b/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt index 3d44f6804..5f6dde2f4 100644 --- a/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt +++ b/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt @@ -7,7 +7,7 @@ import android.util.Log import android.widget.Toast import androidx.preference.EditTextPreference import androidx.preference.MultiSelectListPreference -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.extension.all.kavita.dto.AuthenticationDto import eu.kanade.tachiyomi.extension.all.kavita.dto.ChapterDto import eu.kanade.tachiyomi.extension.all.kavita.dto.MangaFormat @@ -859,13 +859,13 @@ class Kavita(private val suffix: String = "") : ConfigurableSource, HttpSource() override fun headersBuilder(): Headers.Builder { if (jwtToken.isEmpty()) throw LoginErrorException("401 Error\nOPDS address got modified or is incorrect") return Headers.Builder() - .add("User-Agent", "Tachiyomi Kavita v${BuildConfig.VERSION_NAME}") + .add("User-Agent", "Tachiyomi Kavita v${AppInfo.getVersionName()}") .add("Content-Type", "application/json") .add("Authorization", "Bearer $jwtToken") } private fun setupLoginHeaders(): Headers.Builder { return Headers.Builder() - .add("User-Agent", "Tachiyomi Kavita v${BuildConfig.VERSION_NAME}") + .add("User-Agent", "Tachiyomi Kavita v${AppInfo.getVersionName()}") .add("Content-Type", "application/json") .add("Authorization", "Bearer $jwtToken") } @@ -1147,13 +1147,13 @@ class Kavita(private val suffix: String = "") : ConfigurableSource, HttpSource() .parseAs() Log.e( LOG_TAG, - "Extension version: code=${BuildConfig.VERSION_CODE} name=${BuildConfig.VERSION_NAME}" + + "Extension version: code=${AppInfo.getVersionCode()} name=${AppInfo.getVersionName()}" + " - - Kavita version: ${serverInfoDto.kavitaVersion}" ) // this is not a real error. Using this so it gets printed in dump logs if there's any error } catch (e: EmptyRequestBody) { - Log.e(LOG_TAG, "Extension version: code=${BuildConfig.VERSION_CODE} - name=${BuildConfig.VERSION_NAME}") + Log.e(LOG_TAG, "Extension version: code=${AppInfo.getVersionCode()} - name=${AppInfo.getVersionName()}") } catch (e: Exception) { - Log.e(LOG_TAG, "Tachiyomi version: code=${BuildConfig.VERSION_CODE} - name=${BuildConfig.VERSION_NAME}", e) + Log.e(LOG_TAG, "Tachiyomi version: code=${AppInfo.getVersionCode()} - name=${AppInfo.getVersionName()}", e) } try { // Load Filters // Genres diff --git a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt index c0a30a8c2..c496be4a2 100644 --- a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt +++ b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt @@ -5,7 +5,7 @@ import android.content.SharedPreferences import android.text.InputType import android.util.Log import android.widget.Toast -import eu.kanade.tachiyomi.extension.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.extension.all.komga.dto.AuthorDto import eu.kanade.tachiyomi.extension.all.komga.dto.BookDto import eu.kanade.tachiyomi.extension.all.komga.dto.CollectionDto @@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.extension.all.komga.dto.SeriesDto import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.ConfigurableSource +import eu.kanade.tachiyomi.source.UnmeteredSource import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage @@ -44,7 +45,7 @@ import java.text.SimpleDateFormat import java.util.Date import java.util.Locale -open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { +open class Komga(suffix: String = "") : ConfigurableSource, UnmeteredSource, HttpSource() { override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/api/v1/series?page=${page - 1}&deleted=false", headers) @@ -396,7 +397,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { override fun headersBuilder(): Headers.Builder = Headers.Builder() - .add("User-Agent", "TachiyomiKomga/${BuildConfig.VERSION_NAME}") + .add("User-Agent", "TachiyomiKomga/${AppInfo.getVersionName()}") private val preferences: SharedPreferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000) diff --git a/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt b/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt index 7cbd79e59..8c1d30508 100644 --- a/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt +++ b/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt @@ -4,7 +4,7 @@ import android.app.Application import android.content.SharedPreferences import android.text.InputType import android.widget.Toast -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservableSuccess @@ -212,7 +212,7 @@ class Mango : ConfigurableSource, HttpSource() { override fun headersBuilder(): Headers.Builder = Headers.Builder() - .add("User-Agent", "Tachiyomi Mango v${BuildConfig.VERSION_NAME}") + .add("User-Agent", "Tachiyomi Mango v${AppInfo.getVersionName()}") private val preferences: SharedPreferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000) diff --git a/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt b/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt index 658580c9a..1b6881c1d 100644 --- a/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt +++ b/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.extension.ca.fansubscat -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.model.FilterList @@ -37,7 +37,7 @@ class FansubsCat : HttpSource() { override val supportsLatest = true override fun headersBuilder(): Headers.Builder = Headers.Builder() - .add("User-Agent", "Tachiyomi/FansubsCat/${BuildConfig.VERSION_NAME}") + .add("User-Agent", "Tachiyomi/FansubsCat/${AppInfo.getVersionName()}") override val client: OkHttpClient = network.client diff --git a/src/en/vgperson/src/eu/kanade/tachiyomi/extension/en/vgperson/Vgperson.kt b/src/en/vgperson/src/eu/kanade/tachiyomi/extension/en/vgperson/Vgperson.kt index be6565542..fb7f19531 100644 --- a/src/en/vgperson/src/eu/kanade/tachiyomi/extension/en/vgperson/Vgperson.kt +++ b/src/en/vgperson/src/eu/kanade/tachiyomi/extension/en/vgperson/Vgperson.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.vgperson import android.os.Build.VERSION -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.model.FilterList @@ -29,7 +29,7 @@ class Vgperson : ParsedHttpSource() { private val userAgent = "Mozilla/5.0 " + "(Android ${VERSION.RELEASE}; Mobile) " + - "Tachiyomi/${BuildConfig.VERSION_NAME}" + "Tachiyomi/${AppInfo.getVersionName()}" override fun headersBuilder() = Headers.Builder().apply { add("User-Agent", userAgent) diff --git a/src/en/warforrayuba/src/eu/kanade/tachiyomi/extension/en/warforrayuba/WarForRayuba.kt b/src/en/warforrayuba/src/eu/kanade/tachiyomi/extension/en/warforrayuba/WarForRayuba.kt index 9db8d8765..236070013 100644 --- a/src/en/warforrayuba/src/eu/kanade/tachiyomi/extension/en/warforrayuba/WarForRayuba.kt +++ b/src/en/warforrayuba/src/eu/kanade/tachiyomi/extension/en/warforrayuba/WarForRayuba.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.warforrayuba import android.os.Build -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.PageDto import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.RoundDto import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor @@ -47,7 +47,7 @@ class WarForRayuba : HttpSource() { "User-Agent", "(Android ${Build.VERSION.RELEASE}; " + "${Build.MANUFACTURER} ${Build.MODEL}) " + - "Tachiyomi/${BuildConfig.VERSION_NAME} " + + "Tachiyomi/${AppInfo.getVersionName()} " + Build.ID ) }.build() diff --git a/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt b/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt index 162f8c470..7878b9a74 100644 --- a/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt +++ b/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.extension.ko.jmana import android.app.Application import android.content.SharedPreferences import android.widget.Toast -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.FilterList @@ -201,7 +201,7 @@ class JMana : ConfigurableSource, ParsedHttpSource() { const val DETAIL_DESCRIPTION = "설명 : " const val DEFAULT_BASEURL = "https://jmana1.net" private const val BASE_URL_PREF_TITLE = "Override BaseUrl" - private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}" + private val BASE_URL_PREF = "overrideBaseUrl_v${AppInfo.getVersionName()}" private const val BASE_URL_PREF_SUMMARY = "For temporary uses. Update extension will erase this setting." private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting." } diff --git a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt index 858e02f66..40c2ac858 100644 --- a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt +++ b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.app.Application import android.content.SharedPreferences import android.widget.Toast -import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.source.ConfigurableSource @@ -375,7 +375,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting." private const val BASE_URL_PREF_TITLE = "Override BaseUrl" - private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}" + private val BASE_URL_PREF = "overrideBaseUrl_v${AppInfo.getVersionName()}" private const val BASE_URL_PREF_SUMMARY = "For temporary uses. Update extension will erase this setting." // Setting: Experimental Latest Fetcher diff --git a/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt b/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt index 3e003bec7..dbaff9e21 100644 --- a/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt +++ b/src/ko/toonkor/src/eu/kanade/tachiyomi/extension/ko/toonkor/Toonkor.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.extension.ko.toonkor import android.app.Application import android.content.SharedPreferences import android.util.Base64 -import eu.kanade.tachiyomi.BuildConfig +import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.Filter @@ -28,7 +28,7 @@ class Toonkor : ConfigurableSource, ParsedHttpSource() { private val defaultBaseUrl = "https://tkor.dog" - private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}" + private val BASE_URL_PREF = "overrideBaseUrl_v${AppInfo.getVersionName()}" override val baseUrl by lazy { getPrefBaseUrl() } diff --git a/src/ru/mangaclub/src/eu/kanade/tachiyomi/extension/ru/mangaclub/MangaClub.kt b/src/ru/mangaclub/src/eu/kanade/tachiyomi/extension/ru/mangaclub/MangaClub.kt index 85f9d075d..59feeddfe 100644 --- a/src/ru/mangaclub/src/eu/kanade/tachiyomi/extension/ru/mangaclub/MangaClub.kt +++ b/src/ru/mangaclub/src/eu/kanade/tachiyomi/extension/ru/mangaclub/MangaClub.kt @@ -104,7 +104,7 @@ class MangaClub : ParsedHttpSource() { } description = "Читайте описание через WebView" genre = document.select("div.info a[href*=tags]").joinToString(", ") { - it.text().replaceFirst(it.text().first(), it.text().first().toUpperCase()).trim() + it.text().replaceFirstChar { it.toUpperCase() }.trim() } } diff --git a/src/zh/mangabz/build.gradle b/src/zh/mangabz/build.gradle index 8fb2288d5..ae4a86fb4 100644 --- a/src/zh/mangabz/build.gradle +++ b/src/zh/mangabz/build.gradle @@ -1,4 +1,3 @@ - apply plugin: 'com.android.application' apply plugin: 'kotlin-android' diff --git a/src/zh/wuqimanga/src/eu/kanade/tachiyomi/extension/zh/wuqimanga/WuqiManga.kt b/src/zh/wuqimanga/src/eu/kanade/tachiyomi/extension/zh/wuqimanga/WuqiManga.kt index 08d0f8fb2..4de12df7f 100644 --- a/src/zh/wuqimanga/src/eu/kanade/tachiyomi/extension/zh/wuqimanga/WuqiManga.kt +++ b/src/zh/wuqimanga/src/eu/kanade/tachiyomi/extension/zh/wuqimanga/WuqiManga.kt @@ -139,7 +139,7 @@ class WuqiManga : ParsedHttpSource(), ConfigurableSource { val html = document.html() val packed = Regex("eval(.*?)\\n").find(html)?.groups?.get(1)?.value val result = Duktape.create().use { - it.evaluate(packed) as String + it.evaluate(packed!!) as String } val re2 = Regex("""\{.*\}""") val imgJsonStr = re2.find(result)?.groups?.get(0)?.value