2022-04-05 20:41:01 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Tad <tad@spotco.us>
|
2022-05-14 22:17:02 -04:00
|
|
|
Date: Mon, 24 Jun 2019 21:27:35 +0530
|
2022-04-05 20:41:01 -04:00
|
|
|
Subject: [PATCH] Add more 'Private DNS' options
|
|
|
|
|
|
|
|
This adds thirteen DNS providers as available presets.
|
|
|
|
|
|
|
|
Credit: CalyxOS
|
|
|
|
- Chirayu Desai <chirayudesai1@gmail.com>
|
2022-05-14 22:17:02 -04:00
|
|
|
https://review.calyxos.org/c/CalyxOS/platform_packages_modules_Connectivity/+/9588
|
2022-04-05 20:41:01 -04:00
|
|
|
|
2022-05-14 22:17:02 -04:00
|
|
|
Change-Id: I4e51da9d8fe08d1c4a287808f4464c0338b40334
|
2022-04-05 20:41:01 -04:00
|
|
|
---
|
2022-05-14 22:17:02 -04:00
|
|
|
.../net/ConnectivitySettingsManager.java | 170 ++++++++++++++++++
|
|
|
|
.../server/connectivity/DnsManager.java | 78 ++++++++
|
|
|
|
2 files changed, 248 insertions(+)
|
2022-04-05 20:41:01 -04:00
|
|
|
|
2022-05-14 22:17:02 -04:00
|
|
|
diff --git a/framework/src/android/net/ConnectivitySettingsManager.java b/framework/src/android/net/ConnectivitySettingsManager.java
|
2023-06-09 16:19:07 -04:00
|
|
|
index 9c8d08fb1..27263d2a4 100644
|
2022-05-14 22:17:02 -04:00
|
|
|
--- a/framework/src/android/net/ConnectivitySettingsManager.java
|
|
|
|
+++ b/framework/src/android/net/ConnectivitySettingsManager.java
|
|
|
|
@@ -351,6 +351,84 @@ public class ConnectivitySettingsManager {
|
2022-04-05 20:41:01 -04:00
|
|
|
*/
|
2022-05-14 22:17:02 -04:00
|
|
|
public static final int PRIVATE_DNS_MODE_OFF = ConnectivitySettingsUtils.PRIVATE_DNS_MODE_OFF;
|
|
|
|
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_ADGUARD =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_ADGUARD;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_APPLIEDPRIVACY =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_APPLIEDPRIVACY;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_CLEANBROWSING =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_CLEANBROWSING;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_CIRA =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_CIRA;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_CZNIC =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_CZNIC;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_CLOUDFLARE =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_CLOUDFLARE;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_GOOGLE =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_GOOGLE;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_MULLVAD =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_MULLVAD;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_QUADNINE =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_QUADNINE;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_RESTENA =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_RESTENA;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_SWITCH =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_SWITCH;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_TWNIC =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_TWNIC;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final int PRIVATE_DNS_MODE_UNCENSOREDDNS =
|
|
|
|
+ ConnectivitySettingsUtils.PRIVATE_DNS_MODE_UNCENSOREDDNS;
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
/**
|
2022-05-14 22:17:02 -04:00
|
|
|
* One of the private DNS modes that indicates the private DNS mode is automatic, which
|
|
|
|
* will try to use the current DNS as private DNS.
|
|
|
|
@@ -366,10 +444,89 @@ public class ConnectivitySettingsManager {
|
|
|
|
public static final int PRIVATE_DNS_MODE_PROVIDER_HOSTNAME =
|
|
|
|
ConnectivitySettingsUtils.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
|
|
|
|
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_ADGUARD = "dns.adguard.com";
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2022-05-14 22:17:02 -04:00
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_APPLIEDPRIVACY = "dot1.applied-privacy.net";
|
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_CIRA = "protected.canadianshield.cira.ca";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_CZNIC = "odvr.nic.cz";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_CLEANBROWSING = "security-filter-dns.cleanbrowsing.org";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_CLOUDFLARE = "security.cloudflare-dns.com";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_GOOGLE = "dns.google";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_MULLVAD = "adblock.doh.mullvad.net";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_QUADNINE = "dns.quad9.net";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_RESTENA = "kaitain.restena.lu";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_SWITCH = "dns.switch.ch";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_TWNIC = "101.101.101.101";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
2022-04-05 20:41:01 -04:00
|
|
|
+ /**
|
|
|
|
+ * @hide
|
|
|
|
+ */
|
2023-06-05 15:47:21 -04:00
|
|
|
+ public static final String PRIVATE_DNS_SPECIFIER_UNCENSOREDDNS = "anycast.censurfridns.dk";
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+
|
|
|
|
/** @hide */
|
|
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
|
|
@IntDef(value = {
|
|
|
|
PRIVATE_DNS_MODE_OFF,
|
|
|
|
+ PRIVATE_DNS_MODE_ADGUARD,
|
|
|
|
+ PRIVATE_DNS_MODE_APPLIEDPRIVACY,
|
|
|
|
+ PRIVATE_DNS_MODE_CLEANBROWSING,
|
|
|
|
+ PRIVATE_DNS_MODE_CIRA,
|
|
|
|
+ PRIVATE_DNS_MODE_CZNIC,
|
|
|
|
+ PRIVATE_DNS_MODE_CLOUDFLARE,
|
|
|
|
+ PRIVATE_DNS_MODE_GOOGLE,
|
|
|
|
+ PRIVATE_DNS_MODE_MULLVAD,
|
|
|
|
+ PRIVATE_DNS_MODE_QUADNINE,
|
|
|
|
+ PRIVATE_DNS_MODE_RESTENA,
|
|
|
|
+ PRIVATE_DNS_MODE_SWITCH,
|
|
|
|
+ PRIVATE_DNS_MODE_TWNIC,
|
|
|
|
+ PRIVATE_DNS_MODE_UNCENSOREDDNS,
|
|
|
|
PRIVATE_DNS_MODE_OPPORTUNISTIC,
|
|
|
|
PRIVATE_DNS_MODE_PROVIDER_HOSTNAME,
|
|
|
|
})
|
|
|
|
@@ -798,6 +955,19 @@ public class ConnectivitySettingsManager {
|
|
|
|
public static void setPrivateDnsDefaultMode(@NonNull Context context,
|
|
|
|
@NonNull @PrivateDnsMode int mode) {
|
|
|
|
if (!(mode == PRIVATE_DNS_MODE_OFF
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_ADGUARD
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_APPLIEDPRIVACY
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_CLEANBROWSING
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_CIRA
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_CZNIC
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_CLOUDFLARE
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_GOOGLE
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_MULLVAD
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_QUADNINE
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_RESTENA
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_SWITCH
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_TWNIC
|
|
|
|
+ || mode == PRIVATE_DNS_MODE_UNCENSOREDDNS
|
|
|
|
|| mode == PRIVATE_DNS_MODE_OPPORTUNISTIC
|
|
|
|
|| mode == PRIVATE_DNS_MODE_PROVIDER_HOSTNAME)) {
|
|
|
|
throw new IllegalArgumentException("Invalid private dns mode");
|
|
|
|
diff --git a/service/src/com/android/server/connectivity/DnsManager.java b/service/src/com/android/server/connectivity/DnsManager.java
|
|
|
|
index 1493cae79..2a5058c3c 100644
|
|
|
|
--- a/service/src/com/android/server/connectivity/DnsManager.java
|
|
|
|
+++ b/service/src/com/android/server/connectivity/DnsManager.java
|
|
|
|
@@ -23,8 +23,34 @@ import static android.net.ConnectivitySettingsManager.DNS_RESOLVER_SUCCESS_THRES
|
|
|
|
import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_DEFAULT_MODE;
|
|
|
|
import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE;
|
|
|
|
import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_OFF;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_ADGUARD;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_APPLIEDPRIVACY;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_CLEANBROWSING;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_CIRA;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_CZNIC;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_CLOUDFLARE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_GOOGLE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_MULLVAD;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_QUADNINE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_RESTENA;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_SWITCH;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_TWNIC;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_UNCENSOREDDNS;
|
|
|
|
import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
|
|
|
|
import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_ADGUARD;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_APPLIEDPRIVACY;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_CLEANBROWSING;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_CIRA;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_CZNIC;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_CLOUDFLARE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_GOOGLE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_MULLVAD;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_QUADNINE;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_RESTENA;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_SWITCH;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_TWNIC;
|
|
|
|
+import static android.net.ConnectivitySettingsManager.PRIVATE_DNS_SPECIFIER_UNCENSOREDDNS;
|
|
|
|
import static android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener.VALIDATION_RESULT_FAILURE;
|
|
|
|
import static android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener.VALIDATION_RESULT_SUCCESS;
|
2022-04-05 20:41:01 -04:00
|
|
|
|
2022-05-14 22:17:02 -04:00
|
|
|
@@ -141,6 +167,58 @@ public class DnsManager {
|
2022-04-05 20:41:01 -04:00
|
|
|
return new PrivateDnsConfig(specifier, null);
|
|
|
|
}
|
|
|
|
|
2022-05-14 22:17:02 -04:00
|
|
|
+ if (PRIVATE_DNS_MODE_ADGUARD == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_ADGUARD, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_APPLIEDPRIVACY == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_APPLIEDPRIVACY, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_CLEANBROWSING == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_CLEANBROWSING, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_CIRA == mode) {
|
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_CIRA, null);
|
2022-04-05 20:41:01 -04:00
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_CZNIC == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_CZNIC, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_CLOUDFLARE == mode) {
|
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_CLOUDFLARE, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_GOOGLE == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_GOOGLE, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_MULLVAD == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_MULLVAD, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_QUADNINE == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_QUADNINE, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_RESTENA == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_RESTENA, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_SWITCH == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_SWITCH, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_TWNIC == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_TWNIC, null);
|
|
|
|
+ }
|
2022-05-14 22:17:02 -04:00
|
|
|
+
|
|
|
|
+ if (PRIVATE_DNS_MODE_UNCENSOREDDNS == mode) {
|
2022-04-05 20:41:01 -04:00
|
|
|
+ return new PrivateDnsConfig(PRIVATE_DNS_SPECIFIER_UNCENSOREDDNS, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
return new PrivateDnsConfig(useTls);
|
|
|
|
}
|
|
|
|
|