MCCMS: update image host detection (#14567)

This commit is contained in:
stevenyomi 2022-12-16 08:27:51 +08:00 committed by GitHub
parent 9a241c76ee
commit 62d5ec3721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -11,11 +11,10 @@ import javax.crypto.spec.SecretKeySpec
object DecryptInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
val host = request.url.host
val response = chain.proceed(request)
val key = when {
"bcebos.com" in host -> key1
"103.107.190.121" in host -> key2
val key = when (request.url.topPrivateDomain()) {
"bcebos.com" -> key1
null -> key2
else -> return response
}
val data = decrypt(response.body!!.bytes(), key)

View File

@ -6,7 +6,7 @@ import generator.ThemeSourceGenerator
class MCCMSGenerator : ThemeSourceGenerator {
override val themeClass = "MCCMS"
override val themePkg = "mccms"
override val baseVersionCode = 4
override val baseVersionCode = 5
override val sources = listOf(
SingleLang(
name = "Haoman6", baseUrl = "https://www.haoman6.com", lang = "zh",