@ -36,10 +36,15 @@ class ZoroExtractor(private val client: OkHttpClient) {
|
||||
val srcRes = newClient.newCall(GET(SOURCES_URL + id, cache = cacheControl))
|
||||
.execute()
|
||||
.body!!.string()
|
||||
|
||||
val key = newClient.newCall(GET("https://raw.githubusercontent.com/consumet/rapidclown/main/key.txt"))
|
||||
.execute()
|
||||
.body!!.string()
|
||||
|
||||
if ("\"encrypted\":false" 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