Switch from OpenNIC to Cloudflare DNS

This commit is contained in:
Tad 2018-05-03 07:38:32 -04:00
parent a1a7ca9351
commit ee6788df1e
8 changed files with 119 additions and 67 deletions

View File

@ -1,17 +1,19 @@
From 3bf0b445f16aa7daa4981e70a7d5dc6c6ea530ea Mon Sep 17 00:00:00 2001 From 511b38c6a2807417893d5c21cbc27335bf6bead7 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us> From: Tad <tad@spotco.us>
Date: Tue, 19 Dec 2017 17:00:40 -0500 Date: Thu, 3 May 2018 07:35:30 -0400
Subject: [PATCH] Change fallback and tethering DNS servers to OpenNIC AnyCast Subject: [PATCH] Change fallback, tethering, and test DNS servers to
Cloudflare
Change-Id: Ib550fad74bb95272c067a02a5da18a80e6ec1e87 Change-Id: I8031cce58003a45d9b6947ecdcc4d642ef192f52
--- ---
core/res/res/values/config.xml | 2 +- core/res/res/values/config.xml | 2 +-
packages/SettingsLib/res/values/strings.xml | 4 ++-- packages/SettingsLib/res/values/strings.xml | 4 ++--
services/core/java/com/android/server/connectivity/Tethering.java | 4 ++-- .../com/android/server/connectivity/NetworkDiagnostics.java | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-) .../core/java/com/android/server/connectivity/Tethering.java | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index c29ff3c90a9..f7cbb5780ff 100755 index c29ff3c90a9..49f6c04a5e7 100755
--- a/core/res/res/values/config.xml --- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml
@@ -1608,7 +1608,7 @@ @@ -1608,7 +1608,7 @@
@ -19,12 +21,12 @@ index c29ff3c90a9..f7cbb5780ff 100755
<!-- IP address of the dns server to use if nobody else suggests one --> <!-- IP address of the dns server to use if nobody else suggests one -->
- <string name="config_default_dns_server" translatable="false">8.8.8.8</string> - <string name="config_default_dns_server" translatable="false">8.8.8.8</string>
+ <string name="config_default_dns_server" translatable="false">185.121.177.177</string> + <string name="config_default_dns_server" translatable="false">1.0.0.1</string>
<!-- The default mobile provisioning apn. Empty by default, maybe overridden by <!-- The default mobile provisioning apn. Empty by default, maybe overridden by
an mcc/mnc specific config.xml --> an mcc/mnc specific config.xml -->
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index f9bd24ba69f..12b6f7cb700 100644 index f9bd24ba69f..67ef212f795 100644
--- a/packages/SettingsLib/res/values/strings.xml --- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml +++ b/packages/SettingsLib/res/values/strings.xml
@@ -837,9 +837,9 @@ @@ -837,9 +837,9 @@
@ -32,15 +34,31 @@ index f9bd24ba69f..12b6f7cb700 100644
<string name="wifi_ip_address_hint" translatable="false">192.168.1.128</string> <string name="wifi_ip_address_hint" translatable="false">192.168.1.128</string>
<!-- Hint text for DNS --> <!-- Hint text for DNS -->
- <string name="wifi_dns1_hint" translatable="false">8.8.8.8</string> - <string name="wifi_dns1_hint" translatable="false">8.8.8.8</string>
+ <string name="wifi_dns1_hint" translatable="false">185.121.177.177</string> + <string name="wifi_dns1_hint" translatable="false">1.0.0.1</string>
<!-- Hint text for DNS --> <!-- Hint text for DNS -->
- <string name="wifi_dns2_hint" translatable="false">8.8.4.4</string> - <string name="wifi_dns2_hint" translatable="false">8.8.4.4</string>
+ <string name="wifi_dns2_hint" translatable="false">169.239.202.202</string> + <string name="wifi_dns2_hint" translatable="false">1.1.1.1</string>
<!-- Hint text for the gateway --> <!-- Hint text for the gateway -->
<string name="wifi_gateway_hint" translatable="false">192.168.1.1</string> <string name="wifi_gateway_hint" translatable="false">192.168.1.1</string>
<!-- Hint text for network prefix length --> <!-- Hint text for network prefix length -->
diff --git a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
index 5f9efe704f7..ea308ca231b 100644
--- a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
+++ b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
@@ -84,9 +84,9 @@ import libcore.io.IoUtils;
public class NetworkDiagnostics {
private static final String TAG = "NetworkDiagnostics";
- private static final InetAddress TEST_DNS4 = NetworkUtils.numericToInetAddress("8.8.8.8");
+ private static final InetAddress TEST_DNS4 = NetworkUtils.numericToInetAddress("1.0.0.1");
private static final InetAddress TEST_DNS6 = NetworkUtils.numericToInetAddress(
- "2001:4860:4860::8888");
+ "2606:4700:4700::1111");
// For brevity elsewhere.
private static final long now() {
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index f0cf0d98882..07157873169 100644 index f0cf0d98882..9240f5ffdfd 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java --- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -181,8 +181,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering @@ -181,8 +181,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
@ -49,11 +67,11 @@ index f0cf0d98882..07157873169 100644
private String[] mDefaultDnsServers; private String[] mDefaultDnsServers;
- private static final String DNS_DEFAULT_SERVER1 = "8.8.8.8"; - private static final String DNS_DEFAULT_SERVER1 = "8.8.8.8";
- private static final String DNS_DEFAULT_SERVER2 = "8.8.4.4"; - private static final String DNS_DEFAULT_SERVER2 = "8.8.4.4";
+ private static final String DNS_DEFAULT_SERVER1 = "185.121.177.177"; + private static final String DNS_DEFAULT_SERVER1 = "1.0.0.1";
+ private static final String DNS_DEFAULT_SERVER2 = "169.239.202.202"; + private static final String DNS_DEFAULT_SERVER2 = "1.1.1.1";
private final StateMachine mTetherMasterSM; private final StateMachine mTetherMasterSM;
private final UpstreamNetworkMonitor mUpstreamNetworkMonitor; private final UpstreamNetworkMonitor mUpstreamNetworkMonitor;
-- --
2.15.1 2.17.0

View File

@ -0,0 +1,75 @@
From e22081347f0878d93ef0f7ddc21df8ef15ebdec3 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Thu, 3 May 2018 07:28:57 -0400
Subject: [PATCH] Change fallback, tethering, and test DNS servers to
Cloudflare
Change-Id: I698295711c3409f01394dce7268461518dfa0064
---
core/res/res/values/config.xml | 2 +-
packages/SettingsLib/res/values/strings.xml | 4 ++--
.../com/android/server/connectivity/NetworkDiagnostics.java | 4 ++--
.../server/connectivity/tethering/TetheringConfiguration.java | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 3ce8959a983..3b1ae251fad 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1651,7 +1651,7 @@
<bool name="config_bluetooth_default_profiles">true</bool>
<!-- IP address of the dns server to use if nobody else suggests one -->
- <string name="config_default_dns_server" translatable="false">8.8.8.8</string>
+ <string name="config_default_dns_server" translatable="false">1.0.0.1</string>
<!-- The default mobile provisioning apn. Empty by default, maybe overridden by
an mcc/mnc specific config.xml -->
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index bd884a3c972..c8fe7e54d9b 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -921,9 +921,9 @@
<!-- Hint text for the IP address -->
<string name="wifi_ip_address_hint" translatable="false">192.168.1.128</string>
<!-- Hint text for DNS -->
- <string name="wifi_dns1_hint" translatable="false">8.8.8.8</string>
+ <string name="wifi_dns1_hint" translatable="false">1.0.0.1</string>
<!-- Hint text for DNS -->
- <string name="wifi_dns2_hint" translatable="false">8.8.4.4</string>
+ <string name="wifi_dns2_hint" translatable="false">1.1.1.1</string>
<!-- Hint text for the gateway -->
<string name="wifi_gateway_hint" translatable="false">192.168.1.1</string>
<!-- Hint text for network prefix length -->
diff --git a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
index 85d1d1ef1d7..6681109ea4a 100644
--- a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
+++ b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
@@ -85,9 +85,9 @@ import libcore.io.IoUtils;
public class NetworkDiagnostics {
private static final String TAG = "NetworkDiagnostics";
- private static final InetAddress TEST_DNS4 = NetworkUtils.numericToInetAddress("8.8.8.8");
+ private static final InetAddress TEST_DNS4 = NetworkUtils.numericToInetAddress("1.0.0.1");
private static final InetAddress TEST_DNS6 = NetworkUtils.numericToInetAddress(
- "2001:4860:4860::8888");
+ "2606:4700:4700::1111");
// For brevity elsewhere.
private static final long now() {
diff --git a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
index acbc10b9dc4..6dd661bfdb8 100644
--- a/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
+++ b/services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
@@ -65,7 +65,7 @@ public class TetheringConfiguration {
"192.168.48.2", "192.168.48.254", "192.168.49.2", "192.168.49.254",
};
- private final String[] DEFAULT_IPV4_DNS = {"8.8.4.4", "8.8.8.8"};
+ private final String[] DEFAULT_IPV4_DNS = {"1.0.0.1", "1.1.1.1"};
public final String[] tetherableUsbRegexs;
public final String[] tetherableWifiRegexs;
--
2.17.0

View File

@ -1,43 +0,0 @@
From 050ab097e1cc3253af8926342371b6025d1ea162 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Mon, 12 Feb 2018 02:52:08 -0500
Subject: [PATCH] Change fallback DNS servers to OpenNIC AnyCast
Change-Id: Ib0e3f665be73e5b87d6e4da24f73190a17e334d9
---
core/res/res/values/config.xml | 2 +-
packages/SettingsLib/res/values/strings.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 3ce8959a983..00548fbc2f6 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1651,7 +1651,7 @@
<bool name="config_bluetooth_default_profiles">true</bool>
<!-- IP address of the dns server to use if nobody else suggests one -->
- <string name="config_default_dns_server" translatable="false">8.8.8.8</string>
+ <string name="config_default_dns_server" translatable="false">185.121.177.177</string>
<!-- The default mobile provisioning apn. Empty by default, maybe overridden by
an mcc/mnc specific config.xml -->
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index bd884a3c972..ee4db8723a4 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -921,9 +921,9 @@
<!-- Hint text for the IP address -->
<string name="wifi_ip_address_hint" translatable="false">192.168.1.128</string>
<!-- Hint text for DNS -->
- <string name="wifi_dns1_hint" translatable="false">8.8.8.8</string>
+ <string name="wifi_dns1_hint" translatable="false">185.121.177.177</string>
<!-- Hint text for DNS -->
- <string name="wifi_dns2_hint" translatable="false">8.8.4.4</string>
+ <string name="wifi_dns2_hint" translatable="false">169.239.202.202</string>
<!-- Hint text for the gateway -->
<string name="wifi_gateway_hint" translatable="false">192.168.1.1</string>
<!-- Hint text for network prefix length -->
--
2.16.1

View File

@ -71,7 +71,7 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o
awk -i inplace '!/def_backup_transport/' overlay/common/frameworks/base/packages/SettingsProvider/res/values/defaults.xml; awk -i inplace '!/def_backup_transport/' overlay/common/frameworks/base/packages/SettingsProvider/res/values/defaults.xml;
sed -i 's|config_mms_user_agent">LineageOS|config_mms_user_agent">Android-Mms/2.0|' overlay/common/frameworks/base/core/res/res/values/config.xml; sed -i 's|config_mms_user_agent">LineageOS|config_mms_user_agent">Android-Mms/2.0|' overlay/common/frameworks/base/core/res/res/values/config.xml;
sed -i 's/config_storage_manager_settings_enabled">true/config_storage_manager_settings_enabled">false/' overlay/common/packages/apps/Settings/res/values/config.xml; sed -i 's/config_storage_manager_settings_enabled">true/config_storage_manager_settings_enabled">false/' overlay/common/packages/apps/Settings/res/values/config.xml;
sed -i 's/config_enableRecoveryUpdater">false/config_enableRecoveryUpdater">true/' overlay/common/packages/apps/Settings/res/values/config.xml; #sed -i 's/config_enableRecoveryUpdater">false/config_enableRecoveryUpdater">true/' overlay/common/packages/apps/Settings/res/values/config.xml;
enter "vendor/cmsdk"; enter "vendor/cmsdk";
sed -i 's/config_enableAppSuggestOverlay" translatable="false">true/config_enableAppSuggestOverlay" translatable="false">false/' cm/res/res/values/config.xml; sed -i 's/config_enableAppSuggestOverlay" translatable="false">true/config_enableAppSuggestOverlay" translatable="false">false/' cm/res/res/values/config.xml;

View File

@ -82,7 +82,7 @@ sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired
patch -p1 < $patches"android_frameworks_base/0001-Reduced_Resolution.patch"; #Allow reducing resolution to save power TODO: Add 800x480 patch -p1 < $patches"android_frameworks_base/0001-Reduced_Resolution.patch"; #Allow reducing resolution to save power TODO: Add 800x480
patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch"; #Allow packages to spoof their signature (MicroG) patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch"; #Allow packages to spoof their signature (MicroG)
patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0006-OpenNIC.patch"; #Change fallback and tethering DNS servers to OpenNIC AnyCast patch -p1 < $patches"android_frameworks_base/0006-Cloudflare.patch"; #Switch to Cloudflare DNS
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig; rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;

View File

@ -79,7 +79,7 @@ awk -i inplace '!/def_backup_transport/' overlay/common/frameworks/base/packages
sed -i 's|config_mms_user_agent">LineageOS|config_mms_user_agent">Android-Mms/2.0|' overlay/common/frameworks/base/core/res/res/values/config.xml; sed -i 's|config_mms_user_agent">LineageOS|config_mms_user_agent">Android-Mms/2.0|' overlay/common/frameworks/base/core/res/res/values/config.xml;
sed -i 's/def_stats_collection">true/def_stats_collection">false/' overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; sed -i 's/def_stats_collection">true/def_stats_collection">false/' overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml;
sed -i 's/config_storage_manager_settings_enabled">true/config_storage_manager_settings_enabled">false/' overlay/common/packages/apps/Settings/res/values/config.xml; sed -i 's/config_storage_manager_settings_enabled">true/config_storage_manager_settings_enabled">false/' overlay/common/packages/apps/Settings/res/values/config.xml;
sed -i 's/config_enableRecoveryUpdater">false/config_enableRecoveryUpdater">true/' overlay/common/packages/apps/Settings/res/values/config.xml; #sed -i 's/config_enableRecoveryUpdater">false/config_enableRecoveryUpdater">true/' overlay/common/packages/apps/Settings/res/values/config.xml;
cd $base; cd $base;
echo "Default settings changed!"; echo "Default settings changed!";

View File

@ -79,7 +79,7 @@ sed -i 's/com.android.messaging/org.smssecure.smssecure/' core/res/res/values/co
sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml; sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml;
patch -p1 < $patches"android_frameworks_base/0002-Signature_Spoofing.patch"; #Allow packages to spoof their signature (microG) patch -p1 < $patches"android_frameworks_base/0002-Signature_Spoofing.patch"; #Allow packages to spoof their signature (microG)
patch -p1 < $patches"android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key patch -p1 < $patches"android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0004-OpenNIC.patch"; #Change fallback and tethering DNS servers to OpenNIC AnyCast patch -p1 < $patches"android_frameworks_base/0004-Cloudflare.patch"; #Switch to Cloudflare DNS
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_frameworks_base/Copperhead/0005-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA) if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_frameworks_base/Copperhead/0005-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig; rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;

8
TODO
View File

@ -3,7 +3,7 @@ Last updated: 2018-04-29
High Priority (Release blockers) High Priority (Release blockers)
Build Build
- Automate incremental update generation - Automate incremental update generation
- Replace HOSTS file with DNS66 - Replace HOSTS file with a minimal one, and ship DNS66
Project Project
- Create cryptocurrency addresses - Create cryptocurrency addresses
- Setup Stripe - Setup Stripe
@ -49,12 +49,12 @@ Low Priority
- Documentation - Documentation
- Expose more options - Expose more options
Longterm - These are in no particular order and aren't necessarily going to happen Longterm
Build Build
- Add automated testing/verification of edits - Add automated testing/verification of edits
- Replace all the bash scripts with Python - Replace all the bash scripts with Python
- Replace the deblobber with a program in Golang - Replace the deblobber with a program in Golang
- Switch to AOSP and create clean trees for all of the major/popular devices - Switch to AOSP and create clean trees for all of the major devices
Linux Patches Linux Patches
- Automate pulling of CVE patches from Android and Qualcomm bulletins - Automate pulling of CVE patches from Android and Qualcomm bulletins
- Get more CVE patches, especially for 3.4 - Get more CVE patches, especially for 3.4
@ -65,6 +65,8 @@ Longterm - These are in no particular order and aren't necessarily going to happ
- Create an Mobile Device Manager solution - Create an Mobile Device Manager solution
- Create our own device - Create our own device
- General auditing of everything - General auditing of everything
- Partner with various projects
- Purchase one of each supported device
Website Website
- Create a 'Video Tutorials' page - Create a 'Video Tutorials' page