From 90915c688348fcd1cc5d49794e72719abc9a2c86 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Tue, 8 Nov 2022 15:56:10 +0330 Subject: [PATCH] Tachidesk: bypass DoH (#14184) * Tachidesk: Bypass DoH * bump version * fix imports --- src/all/tachidesk/build.gradle | 2 +- .../kanade/tachiyomi/extension/all/tachidesk/Tachidesk.kt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/all/tachidesk/build.gradle b/src/all/tachidesk/build.gradle index 64f3253a7..fb36074a9 100644 --- a/src/all/tachidesk/build.gradle +++ b/src/all/tachidesk/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Tachidesk' pkgNameSuffix = 'all.tachidesk' extClass = '.Tachidesk' - extVersionCode = 6 + extVersionCode = 7 } dependencies { diff --git a/src/all/tachidesk/src/eu/kanade/tachiyomi/extension/all/tachidesk/Tachidesk.kt b/src/all/tachidesk/src/eu/kanade/tachiyomi/extension/all/tachidesk/Tachidesk.kt index db912c32b..09920b6bf 100644 --- a/src/all/tachidesk/src/eu/kanade/tachiyomi/extension/all/tachidesk/Tachidesk.kt +++ b/src/all/tachidesk/src/eu/kanade/tachiyomi/extension/all/tachidesk/Tachidesk.kt @@ -21,7 +21,9 @@ import eu.kanade.tachiyomi.source.online.HttpSource import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import okhttp3.Credentials +import okhttp3.Dns import okhttp3.Headers +import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response import rx.Observable @@ -43,6 +45,11 @@ class Tachidesk : ConfigurableSource, UnmeteredSource, HttpSource() { private val json: Json by injectLazy() + override val client: OkHttpClient = + network.client.newBuilder() + .dns(Dns.SYSTEM) // don't use DNS over HTTPS as it breaks IP addressing + .build() + override fun headersBuilder(): Headers.Builder = Headers.Builder().apply { if (basePassword.isNotEmpty() && baseLogin.isNotEmpty()) { val credentials = Credentials.basic(baseLogin, basePassword)