diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt b/app/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt index 9a783495c..f5ab389d6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt @@ -13,6 +13,10 @@ const val PREF_DOH_CLOUDFLARE = 1 const val PREF_DOH_GOOGLE = 2 const val PREF_DOH_ADGUARD = 3 const val PREF_DOH_QUAD9 = 4 +const val PREF_DOH_ALIDNS = 5 +const val PREF_DOH_DNSPOD = 6 +const val PREF_DOH_360 = 7 +const val PREF_DOH_QUAD101 = 8 fun OkHttpClient.Builder.dohCloudflare() = dns( DnsOverHttps.Builder().client(build()) @@ -68,3 +72,51 @@ fun OkHttpClient.Builder.dohQuad9() = dns( ) .build(), ) + +fun OkHttpClient.Builder.dohAliDNS() = dns( + DnsOverHttps.Builder().client(build()) + .url("https://dns.alidns.com/dns-query".toHttpUrl()) + .bootstrapDnsHosts( + InetAddress.getByName("223.5.5.5"), + InetAddress.getByName("223.6.6.6"), + InetAddress.getByName("2400:3200::1"), + InetAddress.getByName("2400:3200:baba::1"), + ) + .build(), +) + +fun OkHttpClient.Builder.dohDNSPod() = dns( + DnsOverHttps.Builder().client(build()) + .url("https://doh.pub/dns-query".toHttpUrl()) + .bootstrapDnsHosts( + InetAddress.getByName("1.12.12.12"), + InetAddress.getByName("120.53.53.53"), + ) + .build(), +) + +fun OkHttpClient.Builder.doh360() = dns( + DnsOverHttps.Builder().client(build()) + .url("https://doh.360.cn/dns-query".toHttpUrl()) + .bootstrapDnsHosts( + InetAddress.getByName("101.226.4.6"), + InetAddress.getByName("218.30.118.6"), + InetAddress.getByName("123.125.81.6"), + InetAddress.getByName("140.207.198.6"), + InetAddress.getByName("180.163.249.75"), + InetAddress.getByName("101.199.113.208"), + InetAddress.getByName("36.99.170.86"), + ) + .build(), +) + +fun OkHttpClient.Builder.dohQuad101() = dns( + DnsOverHttps.Builder().client(build()) + .url("https://dns.twnic.tw/dns-query".toHttpUrl()) + .bootstrapDnsHosts( + InetAddress.getByName("101.101.101.101"), + InetAddress.getByName("2001:de4::101"), + InetAddress.getByName("2001:de4::102"), + ) + .build(), +) diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt index c59056daf..ea3106cb8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt @@ -43,6 +43,10 @@ class NetworkHelper(context: Context) { PREF_DOH_GOOGLE -> builder.dohGoogle() PREF_DOH_ADGUARD -> builder.dohAdGuard() PREF_DOH_QUAD9 -> builder.dohQuad9() + PREF_DOH_ALIDNS -> builder.dohAliDNS() + PREF_DOH_DNSPOD -> builder.dohDNSPod() + PREF_DOH_360 -> builder.doh360() + PREF_DOH_QUAD101 -> builder.dohQuad101() } return builder diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index 510252d5d..cd77a21d2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt @@ -17,9 +17,13 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Target import eu.kanade.tachiyomi.data.preference.PreferenceValues import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.network.NetworkHelper +import eu.kanade.tachiyomi.network.PREF_DOH_360 import eu.kanade.tachiyomi.network.PREF_DOH_ADGUARD +import eu.kanade.tachiyomi.network.PREF_DOH_ALIDNS import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE +import eu.kanade.tachiyomi.network.PREF_DOH_DNSPOD import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE +import eu.kanade.tachiyomi.network.PREF_DOH_QUAD101 import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9 import eu.kanade.tachiyomi.ui.base.controller.openInBrowser import eu.kanade.tachiyomi.ui.base.controller.pushController @@ -187,6 +191,10 @@ class SettingsAdvancedController( "Google", "AdGuard", "Quad9", + "AliDNS", + "DNSPod", + "360", + "Quad 101", ) entryValues = arrayOf( "-1", @@ -194,6 +202,10 @@ class SettingsAdvancedController( PREF_DOH_GOOGLE.toString(), PREF_DOH_ADGUARD.toString(), PREF_DOH_QUAD9.toString(), + PREF_DOH_ALIDNS.toString(), + PREF_DOH_DNSPOD.toString(), + PREF_DOH_360.toString(), + PREF_DOH_QUAD101.toString(), ) defaultValue = "-1" summary = "%s"