From 2cfde4e2eb41c5a02c066042229ad85562e8642d Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Fri, 15 Sep 2023 18:59:01 +0000 Subject: [PATCH] Manhuaren: fix browse and chapter images (#17960) --- src/zh/manhuaren/build.gradle | 2 +- .../extension/zh/manhuaren/Manhuaren.kt | 29 +++++++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/zh/manhuaren/build.gradle b/src/zh/manhuaren/build.gradle index 3a4f53fdb..5a8474ca2 100644 --- a/src/zh/manhuaren/build.gradle +++ b/src/zh/manhuaren/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Manhuaren' pkgNameSuffix = 'zh.manhuaren' extClass = '.Manhuaren' - extVersionCode = 13 + extVersionCode = 14 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/manhuaren/src/eu/kanade/tachiyomi/extension/zh/manhuaren/Manhuaren.kt b/src/zh/manhuaren/src/eu/kanade/tachiyomi/extension/zh/manhuaren/Manhuaren.kt index 3340d7431..38aa8df49 100644 --- a/src/zh/manhuaren/src/eu/kanade/tachiyomi/extension/zh/manhuaren/Manhuaren.kt +++ b/src/zh/manhuaren/src/eu/kanade/tachiyomi/extension/zh/manhuaren/Manhuaren.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.zh.manhuaren import android.text.format.DateFormat import android.util.Base64 +import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage @@ -103,7 +104,7 @@ class Manhuaren : HttpSource() { } private fun generateLastUsedTime(): String { - return ((Date().time / 1000).toInt() * 1000).toString() + return ((Date().time / 1000) * 1000).toString() } private fun encrypt(message: String): String { @@ -130,30 +131,12 @@ class Manhuaren : HttpSource() { .uppercase() val keysMap = ArrayList>().apply { - add( - HashMap().apply { - put("key", encrypt(imei)) - put("keyType", "0") - }, - ) - add( - HashMap().apply { - put("key", encrypt("mac: $mac")) - put("keyType", "1") - }, - ) add( HashMap().apply { put("key", encrypt(androidId)) // https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID put("keyType", "2") }, ) - add( - HashMap().apply { - put("key", encrypt(simSerialNumber)) // https://developer.android.com/reference/android/telephony/TelephonyManager#getSimSerialNumber() - put("keyType", "3") - }, - ) add( HashMap().apply { put("key", encrypt(UUID.randomUUID().toString())) @@ -531,6 +514,14 @@ class Manhuaren : HttpSource() { override fun imageUrlParse(response: Response) = throw UnsupportedOperationException("This method should not be called!") + override fun imageRequest(page: Page): Request { + val newHeaders = headersBuilder() + .set("Referer", "http://www.dm5.com/dm5api/") + .build() + + return GET(page.imageUrl!!, newHeaders) + } + override fun getFilterList() = FilterList( SortFilter( "状态",