This commit is contained in:
enimax-anime
2022-12-03 05:10:56 -08:00
committed by GitHub
parent 2f331d4d81
commit 3fa45c763b
4 changed files with 9 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'DopeBox' extName = 'DopeBox'
pkgNameSuffix = 'en.dopebox' pkgNameSuffix = 'en.dopebox'
extClass = '.DopeBox' extClass = '.DopeBox'
extVersionCode = 14 extVersionCode = 15
libVersion = '13' libVersion = '13'
} }

View File

@ -4,7 +4,6 @@ import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.animeextension.en.dopebox.extractors.DopeBoxExtractor import eu.kanade.tachiyomi.animeextension.en.dopebox.extractors.DopeBoxExtractor
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
@ -14,6 +13,7 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.animesource.model.Track import eu.kanade.tachiyomi.animesource.model.Track
import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup

View File

@ -47,13 +47,17 @@ class DopeBoxExtractor(private val client: OkHttpClient) {
) )
.execute() .execute()
.body!!.string() .body!!.string()
val key = newClient.newCall(GET("https://raw.githubusercontent.com/consumet/rapidclown/rabbitstream/key.txt"))
.execute()
.body!!.string()
// encrypted data will start with "U2Fsd..." because they put // encrypted data will start with "U2Fsd..." because they put
// "Salted__" at the start of encrypted data, thanks openssl // "Salted__" at the start of encrypted data, thanks openssl
// if its not encrypted, then return it // if its not encrypted, then return it
if ("\"sources\":\"U2FsdGVk" !in srcRes) return srcRes if ("\"sources\":\"U2FsdGVk" !in srcRes) return srcRes
if (!srcRes.contains("{\"sources\":")) return null if (!srcRes.contains("{\"sources\":")) return null
val encrypted = srcRes.substringAfter("sources\":\"").substringBefore("\"") val encrypted = srcRes.substringAfter("sources\":\"").substringBefore("\"")
val decrypted = Decryptor.decrypt(encrypted, cachedJs) ?: return null val decrypted = Decryptor.decrypt(encrypted, key) ?: return null
val end = srcRes.replace("\"$encrypted\"", decrypted) val end = srcRes.replace("\"$encrypted\"", decrypted)
return end return end
} }

View File

@ -9,11 +9,11 @@ import javax.crypto.spec.SecretKeySpec
object Decryptor { object Decryptor {
fun decrypt(encodedData: String, js: String): String? { fun decrypt(encodedData: String, remoteKey: String): String? {
val saltedData = Base64.decode(encodedData, Base64.DEFAULT) val saltedData = Base64.decode(encodedData, Base64.DEFAULT)
val salt = saltedData.copyOfRange(8, 16) val salt = saltedData.copyOfRange(8, 16)
val ciphertext = saltedData.copyOfRange(16, saltedData.size) val ciphertext = saltedData.copyOfRange(16, saltedData.size)
val password = FindPassword.getPassword(js).toByteArray() val password = remoteKey.toByteArray()
val (key, iv) = GenerateKeyAndIv(password, salt) ?: return null val (key, iv) = GenerateKeyAndIv(password, salt) ?: return null
val keySpec = SecretKeySpec(key, "AES") val keySpec = SecretKeySpec(key, "AES")
val ivSpec = IvParameterSpec(iv) val ivSpec = IvParameterSpec(iv)