From fbf81eb73cb2895bd7a4cf04fed80daafc6f3a46 Mon Sep 17 00:00:00 2001 From: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com> Date: Mon, 31 Aug 2026 23:53:28 +0700 Subject: [PATCH] feat: add LegacySource for lib-16 compatibility --- common/proguard-rules.pro | 11 ++++++ .../keiyoushi/utils/AnimeHttpLegacySource.kt | 26 ++++++++++++++ .../utils/ParsedAnimeHttpLegacySource.kt | 36 +++++++++++++++++++ .../src/main/kotlin/keiyoushi/utils/Source.kt | 16 ++++----- gradle/libs.versions.toml | 2 +- 5 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 core/src/main/kotlin/keiyoushi/utils/AnimeHttpLegacySource.kt create mode 100644 core/src/main/kotlin/keiyoushi/utils/ParsedAnimeHttpLegacySource.kt diff --git a/common/proguard-rules.pro b/common/proguard-rules.pro index 65433f578..c26f598cc 100644 --- a/common/proguard-rules.pro +++ b/common/proguard-rules.pro @@ -50,3 +50,14 @@ -if @kotlinx.serialization.Serializable class ** -keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification class <1> + +# Legacy video API — the app's AnimeHttpSource still declares getVideoList(SEpisode), +# videoListRequest(SEpisode) and videoListParse(Response), but extensions-lib 16 doesn't, +# so R8 sees no library method to match and renames them. The override is then silently +# lost and the app runs its own base implementation instead. +# See keiyoushi.utils.AnimeHttpLegacySource / ParsedAnimeHttpLegacySource. +-keepclassmembers class * extends eu.kanade.tachiyomi.animesource.online.AnimeHttpSource { + *** getVideoList(eu.kanade.tachiyomi.animesource.model.SEpisode, kotlin.coroutines.Continuation); + *** videoListRequest(eu.kanade.tachiyomi.animesource.model.SEpisode); + *** videoListParse(okhttp3.Response); +} diff --git a/core/src/main/kotlin/keiyoushi/utils/AnimeHttpLegacySource.kt b/core/src/main/kotlin/keiyoushi/utils/AnimeHttpLegacySource.kt new file mode 100644 index 000000000..08c47ece1 --- /dev/null +++ b/core/src/main/kotlin/keiyoushi/utils/AnimeHttpLegacySource.kt @@ -0,0 +1,26 @@ +package keiyoushi.utils + +import eu.kanade.tachiyomi.animesource.model.Hoster +import eu.kanade.tachiyomi.animesource.model.Hoster.Companion.toHosterList +import eu.kanade.tachiyomi.animesource.model.SEpisode +import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.awaitSuccess +import okhttp3.Request +import okhttp3.Response + +abstract class AnimeHttpLegacySource : AnimeHttpSource() { + override suspend fun getHosterList(episode: SEpisode): List = getVideoList(episode).toHosterList() + + override fun hosterListParse(response: Response): List = throw UnsupportedOperationException() + + open suspend fun getVideoList(episode: SEpisode): List