diff --git a/src/en/allanime/build.gradle b/src/en/allanime/build.gradle index d0bbe68187..9193cf51f3 100644 --- a/src/en/allanime/build.gradle +++ b/src/en/allanime/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'AllAnime' pkgNameSuffix = 'en.allanime' extClass = '.AllAnime' - extVersionCode = 28 + extVersionCode = 29 libVersion = '13' } diff --git a/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt b/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt index 347031f6ea..322eed5634 100644 --- a/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt +++ b/src/en/allanime/src/eu/kanade/tachiyomi/animeextension/en/allanime/AllAnime.kt @@ -311,19 +311,7 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() { ) videoJson.data.episode.sourceUrls.forEach { video -> - val videoUrl = if (video.sourceUrl.startsWith("##")) { - AllAnimeDecryptor.decryptAllAnime( - "1234567890123456789", - video.sourceUrl.substringAfter("##"), - ) - } else if (video.sourceUrl.startsWith("#")) { - AllAnimeDecryptor.decryptAllAnime( - "allanimenews", - video.sourceUrl.substringAfter("#"), - ) - } else { - video.sourceUrl - } + val videoUrl = video.sourceUrl.decryptSource() val matchingMapping = mappings.firstOrNull { (altHoster, urlMatches) -> altHosterSelection.contains(altHoster) && videoUrl.containsAny(urlMatches) @@ -435,6 +423,16 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() { return json.decodeFromString(responseBody) } + private fun String.decryptSource(): String { + return if (this.startsWith("-")) { + this.substringAfterLast('-').chunked(2) + .map { it.toInt(16).toByte() } + .toByteArray().map { + (it.toInt() xor 56).toChar() + }.joinToString("") + } else this + } + private fun prioritySort(pList: List>): List