Remove unused rxandroid dependency

This commit is contained in:
arkon 2023-08-26 10:30:26 -04:00
parent 6d9a8a30e9
commit 13dc54df70
6 changed files with 41 additions and 38 deletions

View File

@ -194,7 +194,7 @@ dependencies {
implementation(androidx.bundles.workmanager) implementation(androidx.bundles.workmanager)
// RxJava // RxJava
implementation(libs.bundles.reactivex) implementation(libs.rxjava)
implementation(libs.flowreactivenetwork) implementation(libs.flowreactivenetwork)
// Networking // Networking

View File

@ -11,8 +11,8 @@
-keep,allowoptimization class kotlin.time.** { public protected *; } -keep,allowoptimization class kotlin.time.** { public protected *; }
-keep,allowoptimization class okhttp3.** { public protected *; } -keep,allowoptimization class okhttp3.** { public protected *; }
-keep,allowoptimization class okio.** { public protected *; } -keep,allowoptimization class okio.** { public protected *; }
-keep,allowoptimization class rx.** { public protected *; }
-keep,allowoptimization class org.jsoup.** { 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 app.cash.quickjs.** { public protected *; }
-keep,allowoptimization class uy.kohesive.injekt.** { public protected *; } -keep,allowoptimization class uy.kohesive.injekt.** { public protected *; }

View File

@ -6,20 +6,19 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import rx.Observable import rx.Observable
@Suppress("OverridingDeprecatedMember")
class StubSource( class StubSource(
override val id: Long, override val id: Long,
override val lang: String, override val lang: String,
override val name: String, override val name: String,
) : Source { ) : Source {
val isInvalid: Boolean = name.isBlank() || lang.isBlank() private val isInvalid: Boolean = name.isBlank() || lang.isBlank()
override suspend fun getMangaDetails(manga: SManga): SManga { override suspend fun getMangaDetails(manga: SManga): SManga {
throw SourceNotInstalledException() 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<SManga> { override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
return Observable.error(SourceNotInstalledException()) return Observable.error(SourceNotInstalledException())
} }
@ -28,7 +27,7 @@ class StubSource(
throw SourceNotInstalledException() 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<List<SChapter>> { override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
return Observable.error(SourceNotInstalledException()) return Observable.error(SourceNotInstalledException())
} }
@ -37,7 +36,7 @@ class StubSource(
throw SourceNotInstalledException() 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<List<Page>> { override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
return Observable.error(SourceNotInstalledException()) return Observable.error(SourceNotInstalledException())
} }

View File

@ -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" android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2"
google-services-gradle = "com.google.gms:google-services:4.3.15" 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" rxjava = "io.reactivex:rxjava:1.3.8"
flowreactivenetwork = "ru.beryukhov:flowreactivenetwork:1.0.4" 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" kotlinter = "org.jmailen.gradle:kotlinter-gradle:3.13.0"
[bundles] [bundles]
reactivex = ["rxandroid", "rxjava"]
okhttp = ["okhttp-core", "okhttp-logging", "okhttp-dnsoverhttps"] okhttp = ["okhttp-core", "okhttp-logging", "okhttp-dnsoverhttps"]
js-engine = ["quickjs-android"] js-engine = ["quickjs-android"]
sqlite = ["sqlite-framework", "sqlite-ktx", "sqlite-android"] sqlite = ["sqlite-framework", "sqlite-ktx", "sqlite-android"]

View File

@ -24,13 +24,44 @@ interface Source {
val lang: String val lang: String
get() = "" 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<SChapter> {
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<Page> {
return fetchPageList(chapter).awaitSingle()
}
/** /**
* Returns an observable with the updated details for a manga. * Returns an observable with the updated details for a manga.
* *
* @param manga the manga to update. * @param manga the manga to update.
*/ */
@Deprecated( @Deprecated(
"Use the 1.x API instead", "Use the non-RxJava API instead",
ReplaceWith("getMangaDetails"), ReplaceWith("getMangaDetails"),
) )
fun fetchMangaDetails(manga: SManga): Observable<SManga> = throw IllegalStateException("Not used") fun fetchMangaDetails(manga: SManga): Observable<SManga> = throw IllegalStateException("Not used")
@ -41,7 +72,7 @@ interface Source {
* @param manga the manga to update. * @param manga the manga to update.
*/ */
@Deprecated( @Deprecated(
"Use the 1.x API instead", "Use the non-RxJava API instead",
ReplaceWith("getChapterList"), ReplaceWith("getChapterList"),
) )
fun fetchChapterList(manga: SManga): Observable<List<SChapter>> = throw IllegalStateException("Not used") fun fetchChapterList(manga: SManga): Observable<List<SChapter>> = throw IllegalStateException("Not used")
@ -53,33 +84,8 @@ interface Source {
* @param chapter the chapter. * @param chapter the chapter.
*/ */
@Deprecated( @Deprecated(
"Use the 1.x API instead", "Use the non-RxJava API instead",
ReplaceWith("getPageList"), ReplaceWith("getPageList"),
) )
fun fetchPageList(chapter: SChapter): Observable<List<Page>> = Observable.empty() fun fetchPageList(chapter: SChapter): Observable<List<Page>> = 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<SChapter> {
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<Page> {
return fetchPageList(chapter).awaitSingle()
}
} }