diff --git a/src/es/catharsisworld/build.gradle b/src/es/catharsisworld/build.gradle index 7f487f447..2446f47d2 100644 --- a/src/es/catharsisworld/build.gradle +++ b/src/es/catharsisworld/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.CatharsisWorld' themePkg = 'mangathemesia' baseUrl = 'https://catharsisworld.com' - overrideVersionCode = 0 + overrideVersionCode = 1 isNsfw = true } diff --git a/src/es/catharsisworld/src/eu/kanade/tachiyomi/extension/es/catharsisworld/CatharsisWorld.kt b/src/es/catharsisworld/src/eu/kanade/tachiyomi/extension/es/catharsisworld/CatharsisWorld.kt index 4bd1808f6..b494ddaf6 100644 --- a/src/es/catharsisworld/src/eu/kanade/tachiyomi/extension/es/catharsisworld/CatharsisWorld.kt +++ b/src/es/catharsisworld/src/eu/kanade/tachiyomi/extension/es/catharsisworld/CatharsisWorld.kt @@ -1,7 +1,14 @@ package eu.kanade.tachiyomi.extension.es.catharsisworld +import android.annotation.SuppressLint import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia import eu.kanade.tachiyomi.network.interceptor.rateLimit +import okhttp3.OkHttpClient +import java.security.SecureRandom +import java.security.cert.X509Certificate +import javax.net.ssl.SSLContext +import javax.net.ssl.TrustManager +import javax.net.ssl.X509TrustManager class CatharsisWorld : MangaThemesia( "Catharsis World", @@ -10,5 +17,24 @@ class CatharsisWorld : MangaThemesia( ) { override val client = super.client.newBuilder() .rateLimit(3) + .ignoreAllSSLErrors() .build() + + private fun OkHttpClient.Builder.ignoreAllSSLErrors(): OkHttpClient.Builder { + val naiveTrustManager = @SuppressLint("CustomX509TrustManager") + object : X509TrustManager { + override fun getAcceptedIssuers(): Array = emptyArray() + override fun checkClientTrusted(certs: Array, authType: String) = Unit + override fun checkServerTrusted(certs: Array, authType: String) = Unit + } + + val insecureSocketFactory = SSLContext.getInstance("TLSv1.2").apply { + val trustAllCerts = arrayOf(naiveTrustManager) + init(null, trustAllCerts, SecureRandom()) + }.socketFactory + + sslSocketFactory(insecureSocketFactory, naiveTrustManager) + hostnameVerifier { _, _ -> true } + return this + } }