CopyManga: Fix missing decrypt password (#9193)

* CopyManga: Allow passing in null for decrypt password.

When we end up with a decrypt password of null (that is, there is no manga-
specific decryption password), fall back to the default password.
Previously, we ended up passing in null instead of a default password.

Also update the default password.

Fixes #9114

* CopyManga: bump extVersionCode.
This commit is contained in:
Mook 2021-09-23 03:06:52 -07:00 committed by GitHub
parent e9a29618d7
commit f26a96c95f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'CopyManga'
pkgNameSuffix = 'zh.copymanga'
extClass = '.CopyManga'
extVersionCode = 15
extVersionCode = 16
}
apply from: "$rootDir/common.gradle"

View File

@ -449,10 +449,10 @@ class CopyManga : ConfigurableSource, HttpSource() {
}
// thanks to unpacker toolsite, http://matthewfl.com/unPacker.html
private fun decryptChapterData(disposableData: String, disposablePass: String? = "hotmanga.aes.key"): String {
private fun decryptChapterData(disposableData: String, disposablePass: String?): String {
val prePart = disposableData.substring(0, 16)
val postPart = disposableData.substring(16, disposableData.length)
val disposablePassByteArray = disposablePass?.toByteArray(Charsets.UTF_8)
val disposablePassByteArray = (disposablePass ?: "xxxmanga.abc.key").toByteArray(Charsets.UTF_8)
val prepartByteArray = prePart.toByteArray(Charsets.UTF_8)
val dataByteArray = hexStringToByteArray(postPart)