mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 22:35:22 +01:00
Add Quad9 DOH provider (#6638)
* add quad9 as new doh provider * add ipv6 addresses to google doh * revert changes to import
This commit is contained in:
parent
9120e82517
commit
d8c8d7c588
@ -12,6 +12,7 @@ import java.net.InetAddress
|
|||||||
const val PREF_DOH_CLOUDFLARE = 1
|
const val PREF_DOH_CLOUDFLARE = 1
|
||||||
const val PREF_DOH_GOOGLE = 2
|
const val PREF_DOH_GOOGLE = 2
|
||||||
const val PREF_DOH_ADGUARD = 3
|
const val PREF_DOH_ADGUARD = 3
|
||||||
|
const val PREF_DOH_QUAD9 = 4
|
||||||
|
|
||||||
fun OkHttpClient.Builder.dohCloudflare() = dns(
|
fun OkHttpClient.Builder.dohCloudflare() = dns(
|
||||||
DnsOverHttps.Builder().client(build())
|
DnsOverHttps.Builder().client(build())
|
||||||
@ -35,7 +36,9 @@ fun OkHttpClient.Builder.dohGoogle() = dns(
|
|||||||
.url("https://dns.google/dns-query".toHttpUrl())
|
.url("https://dns.google/dns-query".toHttpUrl())
|
||||||
.bootstrapDnsHosts(
|
.bootstrapDnsHosts(
|
||||||
InetAddress.getByName("8.8.4.4"),
|
InetAddress.getByName("8.8.4.4"),
|
||||||
InetAddress.getByName("8.8.8.8")
|
InetAddress.getByName("8.8.8.8"),
|
||||||
|
InetAddress.getByName("2001:4860:4860::8888"),
|
||||||
|
InetAddress.getByName("2001:4860:4860::8844"),
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
@ -52,3 +55,15 @@ fun OkHttpClient.Builder.dohAdGuard() = dns(
|
|||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun OkHttpClient.Builder.dohQuad9() = dns(
|
||||||
|
DnsOverHttps.Builder().client(build())
|
||||||
|
.url("https://dns.quad9.net/dns-query".toHttpUrl())
|
||||||
|
.bootstrapDnsHosts(
|
||||||
|
InetAddress.getByName("9.9.9.9"),
|
||||||
|
InetAddress.getByName("149.112.112.112"),
|
||||||
|
InetAddress.getByName("2620:fe::fe"),
|
||||||
|
InetAddress.getByName("2620:fe::9"),
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
@ -41,6 +41,7 @@ class NetworkHelper(context: Context) {
|
|||||||
PREF_DOH_CLOUDFLARE -> builder.dohCloudflare()
|
PREF_DOH_CLOUDFLARE -> builder.dohCloudflare()
|
||||||
PREF_DOH_GOOGLE -> builder.dohGoogle()
|
PREF_DOH_GOOGLE -> builder.dohGoogle()
|
||||||
PREF_DOH_ADGUARD -> builder.dohAdGuard()
|
PREF_DOH_ADGUARD -> builder.dohAdGuard()
|
||||||
|
PREF_DOH_QUAD9 -> builder.dohAdGuard()
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder
|
return builder
|
||||||
|
@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.network.NetworkHelper
|
|||||||
import eu.kanade.tachiyomi.network.PREF_DOH_ADGUARD
|
import eu.kanade.tachiyomi.network.PREF_DOH_ADGUARD
|
||||||
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
|
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
|
||||||
import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE
|
import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE
|
||||||
|
import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.setting.database.ClearDatabaseController
|
import eu.kanade.tachiyomi.ui.setting.database.ClearDatabaseController
|
||||||
@ -168,12 +169,14 @@ class SettingsAdvancedController : SettingsController() {
|
|||||||
"Cloudflare",
|
"Cloudflare",
|
||||||
"Google",
|
"Google",
|
||||||
"AdGuard",
|
"AdGuard",
|
||||||
|
"Quad9",
|
||||||
)
|
)
|
||||||
entryValues = arrayOf(
|
entryValues = arrayOf(
|
||||||
"-1",
|
"-1",
|
||||||
PREF_DOH_CLOUDFLARE.toString(),
|
PREF_DOH_CLOUDFLARE.toString(),
|
||||||
PREF_DOH_GOOGLE.toString(),
|
PREF_DOH_GOOGLE.toString(),
|
||||||
PREF_DOH_ADGUARD.toString(),
|
PREF_DOH_ADGUARD.toString(),
|
||||||
|
PREF_DOH_QUAD9.toString(),
|
||||||
)
|
)
|
||||||
defaultValue = "-1"
|
defaultValue = "-1"
|
||||||
summary = "%s"
|
summary = "%s"
|
||||||
|
Loading…
Reference in New Issue
Block a user