9anime: fix decryption
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
||||
extName = '9anime'
|
||||
pkgNameSuffix = 'en.nineanime'
|
||||
extClass = '.NineAnime'
|
||||
extVersionCode = 17
|
||||
extVersionCode = 18
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -281,9 +281,9 @@ class NineAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
screen.addPreference(videoLanguagePref)
|
||||
}
|
||||
|
||||
private fun encodeVrf(id: String) = encode(encrypt(cipher(encode(id))))
|
||||
private fun encodeVrf(id: String) = encode(encrypt(cipher(encode(id), cipherKey)))
|
||||
|
||||
private fun decodeVrf(text: String) = decode(cipher(decrypt(text)))
|
||||
private fun decodeVrf(text: String) = decode(cipher(decrypt(text), decipherKey))
|
||||
|
||||
private fun encrypt(input: String): String {
|
||||
if (input.any { it.code > 255 }) throw Exception("illegal characters!")
|
||||
@ -310,7 +310,7 @@ class NineAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
return output
|
||||
}
|
||||
|
||||
private fun cipher(input: String): String {
|
||||
private fun cipher(input: String, cipherKey: String): String {
|
||||
val arr = IntArray(256) { it }
|
||||
|
||||
var u = 0
|
||||
@ -376,4 +376,5 @@ class NineAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
|
||||
private const val nineAnimeKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
private const val cipherKey = "oZH6q4X4VAIHk0Ol"
|
||||
// credit goes to https://github.com/consumet/consumet.ts
|
||||
private const val decipherKey = "hlPeNwkncH0fq9so"
|
||||
// thanks to the community for finding these keys, and 9anime pls don't change them again
|
||||
|
Reference in New Issue
Block a user