From f1a82b76ffe60ec32d4236ead8ea7c173a8a08d7 Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Mon, 10 Aug 2020 04:13:21 -0400 Subject: [PATCH] Manhuadui - update decryption (#4072) --- src/zh/manhuadui/build.gradle | 2 +- .../tachiyomi/extension/zh/manhuadui/Manhuadui.kt | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/zh/manhuadui/build.gradle b/src/zh/manhuadui/build.gradle index 21478f119..60fa007fa 100644 --- a/src/zh/manhuadui/build.gradle +++ b/src/zh/manhuadui/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Manhuadui' pkgNameSuffix = 'zh.manhuadui' extClass = '.Manhuadui' - extVersionCode = 10 + extVersionCode = 11 libVersion = '1.2' } diff --git a/src/zh/manhuadui/src/eu/kanade/tachiyomi/extension/zh/manhuadui/Manhuadui.kt b/src/zh/manhuadui/src/eu/kanade/tachiyomi/extension/zh/manhuadui/Manhuadui.kt index cd98cfa91..9b8e91b9d 100644 --- a/src/zh/manhuadui/src/eu/kanade/tachiyomi/extension/zh/manhuadui/Manhuadui.kt +++ b/src/zh/manhuadui/src/eu/kanade/tachiyomi/extension/zh/manhuadui/Manhuadui.kt @@ -26,6 +26,11 @@ class Manhuadui : ParsedHttpSource() { override val supportsLatest = true 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 searchMangaSelector() = popularMangaSelector() override fun latestUpdatesSelector() = popularMangaSelector() @@ -112,12 +117,9 @@ class Manhuadui : ParsedHttpSource() { // ref: https://jueyue.iteye.com/blog/1830792 private fun decryptAES(value: String): String? { - val key = "1739ZAQ12345bbG1" - val iv = "ABCDEF1G341234bb" - return try { - val secretKey = SecretKeySpec(key.toByteArray(), "AES") - val ivParams = IvParameterSpec(iv.toByteArray()) + val secretKey = SecretKeySpec(DECRYPTION_KEY.toByteArray(), "AES") + val ivParams = IvParameterSpec(DECRYPTION_IV.toByteArray()) val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding") cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParams)