@ -5,7 +5,7 @@ ext {
|
||||
extName = 'DopeBox'
|
||||
pkgNameSuffix = 'en.dopebox'
|
||||
extClass = '.DopeBox'
|
||||
extVersionCode = 14
|
||||
extVersionCode = 15
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ import android.app.Application
|
||||
import android.content.SharedPreferences
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor
|
||||
import eu.kanade.tachiyomi.animeextension.en.dopebox.extractors.DopeBoxExtractor
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
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.Video
|
||||
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.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
|
@ -47,13 +47,17 @@ class DopeBoxExtractor(private val client: OkHttpClient) {
|
||||
)
|
||||
.execute()
|
||||
.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
|
||||
// "Salted__" at the start of encrypted data, thanks openssl
|
||||
// if its not encrypted, then return it
|
||||
if ("\"sources\":\"U2FsdGVk" !in srcRes) return srcRes
|
||||
if (!srcRes.contains("{\"sources\":")) return null
|
||||
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)
|
||||
return end
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
object Decryptor {
|
||||
|
||||
fun decrypt(encodedData: String, js: String): String? {
|
||||
fun decrypt(encodedData: String, remoteKey: String): String? {
|
||||
val saltedData = Base64.decode(encodedData, Base64.DEFAULT)
|
||||
val salt = saltedData.copyOfRange(8, 16)
|
||||
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 keySpec = SecretKeySpec(key, "AES")
|
||||
val ivSpec = IvParameterSpec(iv)
|
||||
|
Reference in New Issue
Block a user