Manhuadui - update decryption (#4072)

This commit is contained in:
Mike 2020-08-10 04:13:21 -04:00 committed by GitHub
parent b891ee94be
commit f1a82b76ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Manhuadui' extName = 'Manhuadui'
pkgNameSuffix = 'zh.manhuadui' pkgNameSuffix = 'zh.manhuadui'
extClass = '.Manhuadui' extClass = '.Manhuadui'
extVersionCode = 10 extVersionCode = 11
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -26,6 +26,11 @@ class Manhuadui : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val imageServer = arrayOf("https://mhcdn.manhuazj.com", "https://res.333dm.com", "https://res02.333dm.com") private val imageServer = arrayOf("https://mhcdn.manhuazj.com", "https://res.333dm.com", "https://res02.333dm.com")
companion object {
private const val DECRYPTION_KEY = "1739ZAQ54321bbG1"
private const val DECRYPTION_IV = "ABCDEF1G344321bb"
}
override fun popularMangaSelector() = "li.list-comic" override fun popularMangaSelector() = "li.list-comic"
override fun searchMangaSelector() = popularMangaSelector() override fun searchMangaSelector() = popularMangaSelector()
override fun latestUpdatesSelector() = popularMangaSelector() override fun latestUpdatesSelector() = popularMangaSelector()
@ -112,12 +117,9 @@ class Manhuadui : ParsedHttpSource() {
// ref: https://jueyue.iteye.com/blog/1830792 // ref: https://jueyue.iteye.com/blog/1830792
private fun decryptAES(value: String): String? { private fun decryptAES(value: String): String? {
val key = "1739ZAQ12345bbG1"
val iv = "ABCDEF1G341234bb"
return try { return try {
val secretKey = SecretKeySpec(key.toByteArray(), "AES") val secretKey = SecretKeySpec(DECRYPTION_KEY.toByteArray(), "AES")
val ivParams = IvParameterSpec(iv.toByteArray()) val ivParams = IvParameterSpec(DECRYPTION_IV.toByteArray())
val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding") val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding")
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParams) cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParams)