Add "Njalla" dns provider (#7908)

* Add "Njalla" dns provider

Details ~~Tho there is none~~: https://dns.njal.la/

* Lint
This commit is contained in:
AntsyLich 2022-08-31 21:23:02 +06:00 committed by GitHub
parent 90c08303fa
commit d85af2fec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -19,6 +19,7 @@ const val PREF_DOH_360 = 7
const val PREF_DOH_QUAD101 = 8 const val PREF_DOH_QUAD101 = 8
const val PREF_DOH_MULLVAD = 9 const val PREF_DOH_MULLVAD = 9
const val PREF_DOH_CONTROLD = 10 const val PREF_DOH_CONTROLD = 10
const val PREF_DOH_NJALLA = 11
fun OkHttpClient.Builder.dohCloudflare() = dns( fun OkHttpClient.Builder.dohCloudflare() = dns(
DnsOverHttps.Builder().client(build()) DnsOverHttps.Builder().client(build())
@ -156,3 +157,18 @@ fun OkHttpClient.Builder.dohControlD() = dns(
) )
.build(), .build(),
) )
/*
* Njalla
*
* Non logging and uncensored
*/
fun OkHttpClient.Builder.dohNajalla() = dns(
DnsOverHttps.Builder().client(build())
.url("https://dns.njal.la/dns-query".toHttpUrl())
.bootstrapDnsHosts(
InetAddress.getByName("95.215.19.53"),
InetAddress.getByName("2001:67c:2354:2::53"),
)
.build(),
)

View File

@ -49,6 +49,7 @@ class NetworkHelper(context: Context) {
PREF_DOH_QUAD101 -> builder.dohQuad101() PREF_DOH_QUAD101 -> builder.dohQuad101()
PREF_DOH_MULLVAD -> builder.dohMullvad() PREF_DOH_MULLVAD -> builder.dohMullvad()
PREF_DOH_CONTROLD -> builder.dohControlD() PREF_DOH_CONTROLD -> builder.dohControlD()
PREF_DOH_NJALLA -> builder.dohNajalla()
} }
return builder return builder

View File

@ -25,6 +25,7 @@ import eu.kanade.tachiyomi.network.PREF_DOH_CONTROLD
import eu.kanade.tachiyomi.network.PREF_DOH_DNSPOD import eu.kanade.tachiyomi.network.PREF_DOH_DNSPOD
import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE import eu.kanade.tachiyomi.network.PREF_DOH_GOOGLE
import eu.kanade.tachiyomi.network.PREF_DOH_MULLVAD import eu.kanade.tachiyomi.network.PREF_DOH_MULLVAD
import eu.kanade.tachiyomi.network.PREF_DOH_NJALLA
import eu.kanade.tachiyomi.network.PREF_DOH_QUAD101 import eu.kanade.tachiyomi.network.PREF_DOH_QUAD101
import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9 import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
@ -200,6 +201,7 @@ class SettingsAdvancedController(
"Quad 101", "Quad 101",
"Mullvad", "Mullvad",
"Control D", "Control D",
"Njalla",
) )
entryValues = arrayOf( entryValues = arrayOf(
"-1", "-1",
@ -213,6 +215,7 @@ class SettingsAdvancedController(
PREF_DOH_QUAD101.toString(), PREF_DOH_QUAD101.toString(),
PREF_DOH_MULLVAD.toString(), PREF_DOH_MULLVAD.toString(),
PREF_DOH_CONTROLD.toString(), PREF_DOH_CONTROLD.toString(),
PREF_DOH_NJALLA.toString(),
) )
defaultValue = "-1" defaultValue = "-1"
summary = "%s" summary = "%s"