diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 37d72d3e65..8ccc2db652 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -194,7 +194,7 @@ dependencies { implementation(androidx.bundles.workmanager) // RxJava - implementation(libs.bundles.reactivex) + implementation(libs.rxjava) implementation(libs.flowreactivenetwork) // Networking diff --git a/app/proguard-android-optimize.txt b/app/proguard-android-optimize.txt index 9f53403165..7072ff7036 100644 --- a/app/proguard-android-optimize.txt +++ b/app/proguard-android-optimize.txt @@ -14,7 +14,7 @@ } -keepclassmembers class * implements android.os.Parcelable { - public static final ** CREATOR; + public static final ** CREATOR; } -keep class androidx.annotation.Keep diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 4679656733..ddb8f83af8 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -11,8 +11,8 @@ -keep,allowoptimization class kotlin.time.** { public protected *; } -keep,allowoptimization class okhttp3.** { public protected *; } -keep,allowoptimization class okio.** { public protected *; } --keep,allowoptimization class rx.** { public protected *; } -keep,allowoptimization class org.jsoup.** { public protected *; } +-keep,allowoptimization class rx.** { public protected *; } -keep,allowoptimization class app.cash.quickjs.** { public protected *; } -keep,allowoptimization class uy.kohesive.injekt.** { public protected *; } diff --git a/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt b/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt index 3fbd021016..38d38ef575 100644 --- a/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt +++ b/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt @@ -6,20 +6,19 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import rx.Observable -@Suppress("OverridingDeprecatedMember") class StubSource( override val id: Long, override val lang: String, override val name: String, ) : Source { - val isInvalid: Boolean = name.isBlank() || lang.isBlank() + private val isInvalid: Boolean = name.isBlank() || lang.isBlank() override suspend fun getMangaDetails(manga: SManga): SManga { throw SourceNotInstalledException() } - @Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getMangaDetails")) + @Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getMangaDetails")) override fun fetchMangaDetails(manga: SManga): Observable { return Observable.error(SourceNotInstalledException()) } @@ -28,7 +27,7 @@ class StubSource( throw SourceNotInstalledException() } - @Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getChapterList")) + @Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList")) override fun fetchChapterList(manga: SManga): Observable> { return Observable.error(SourceNotInstalledException()) } @@ -37,7 +36,7 @@ class StubSource( throw SourceNotInstalledException() } - @Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getPageList")) + @Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getPageList")) override fun fetchPageList(chapter: SChapter): Observable> { return Observable.error(SourceNotInstalledException()) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8992dd8c9e..1cef0edeb6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,6 @@ desugar = "com.android.tools:desugar_jdk_libs:2.0.3" android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2" google-services-gradle = "com.google.gms:google-services:4.3.15" -rxandroid = "io.reactivex:rxandroid:1.2.1" rxjava = "io.reactivex:rxjava:1.3.8" flowreactivenetwork = "ru.beryukhov:flowreactivenetwork:1.0.4" @@ -94,7 +93,6 @@ voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", vers kotlinter = "org.jmailen.gradle:kotlinter-gradle:3.13.0" [bundles] -reactivex = ["rxandroid", "rxjava"] okhttp = ["okhttp-core", "okhttp-logging", "okhttp-dnsoverhttps"] js-engine = ["quickjs-android"] sqlite = ["sqlite-framework", "sqlite-ktx", "sqlite-android"] diff --git a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/Source.kt b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/Source.kt index 5f5dd57ee8..15747af982 100644 --- a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/Source.kt +++ b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/Source.kt @@ -24,13 +24,44 @@ interface Source { val lang: String get() = "" + /** + * Get the updated details for a manga. + * + * @param manga the manga to update. + */ + @Suppress("DEPRECATION") + suspend fun getMangaDetails(manga: SManga): SManga { + return fetchMangaDetails(manga).awaitSingle() + } + + /** + * Get all the available chapters for a manga. + * + * @param manga the manga to update. + */ + @Suppress("DEPRECATION") + suspend fun getChapterList(manga: SManga): List { + return fetchChapterList(manga).awaitSingle() + } + + /** + * Get the list of pages a chapter has. Pages should be returned + * in the expected order; the index is ignored. + * + * @param chapter the chapter. + */ + @Suppress("DEPRECATION") + suspend fun getPageList(chapter: SChapter): List { + return fetchPageList(chapter).awaitSingle() + } + /** * Returns an observable with the updated details for a manga. * * @param manga the manga to update. */ @Deprecated( - "Use the 1.x API instead", + "Use the non-RxJava API instead", ReplaceWith("getMangaDetails"), ) fun fetchMangaDetails(manga: SManga): Observable = throw IllegalStateException("Not used") @@ -41,7 +72,7 @@ interface Source { * @param manga the manga to update. */ @Deprecated( - "Use the 1.x API instead", + "Use the non-RxJava API instead", ReplaceWith("getChapterList"), ) fun fetchChapterList(manga: SManga): Observable> = throw IllegalStateException("Not used") @@ -53,33 +84,8 @@ interface Source { * @param chapter the chapter. */ @Deprecated( - "Use the 1.x API instead", + "Use the non-RxJava API instead", ReplaceWith("getPageList"), ) fun fetchPageList(chapter: SChapter): Observable> = Observable.empty() - - /** - * [1.x API] Get the updated details for a manga. - */ - @Suppress("DEPRECATION") - suspend fun getMangaDetails(manga: SManga): SManga { - return fetchMangaDetails(manga).awaitSingle() - } - - /** - * [1.x API] Get all the available chapters for a manga. - */ - @Suppress("DEPRECATION") - suspend fun getChapterList(manga: SManga): List { - return fetchChapterList(manga).awaitSingle() - } - - /** - * [1.x API] Get the list of pages a chapter has. Pages should be returned - * in the expected order; the index is ignored. - */ - @Suppress("DEPRECATION") - suspend fun getPageList(chapter: SChapter): List { - return fetchPageList(chapter).awaitSingle() - } }