Change default DNS server
This commit is contained in:
parent
36cf67660d
commit
59b52e26d6
2 changed files with 8 additions and 6 deletions
|
@ -14,6 +14,8 @@ import static org.webrtc.ApplicationContextProvider.getApplicationContext;
|
||||||
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
|
||||||
|
import org.minidns.util.InetAddressUtil;
|
||||||
|
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.Inet6Address;
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
@ -95,18 +97,18 @@ public class DnsRootServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Inet4Address getRandomIpv4RootServer(Random random) {
|
public static Inet4Address getRandomIpv4RootServer(Random random) {
|
||||||
if (getApplicationContext().getString(R.string.default_dns_server_ipv4).equals("176.9.93.198")) {
|
if (getApplicationContext().getString(R.string.default_dns_server_ipv4).equals("194.242.2.2")) {
|
||||||
return IPV4_ROOT_SERVERS[random.nextInt(IPV4_ROOT_SERVERS.length)];
|
return IPV4_ROOT_SERVERS[random.nextInt(IPV4_ROOT_SERVERS.length)];
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return InetAddressUtil.ipv4From(eu.siacs.conversations.Conversations.getContext().getString(R.string.default_dns_server_ipv4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Inet6Address getRandomIpv6RootServer(Random random) {
|
public static Inet6Address getRandomIpv6RootServer(Random random) {
|
||||||
if (getApplicationContext().getString(R.string.default_dns_server_ipv6).equals("[2a01:4f8:151:34aa::198]")) {
|
if (getApplicationContext().getString(R.string.default_dns_server_ipv6).equals("[2a07:e340::2]")) {
|
||||||
return IPV6_ROOT_SERVERS[random.nextInt(IPV6_ROOT_SERVERS.length)];
|
return IPV6_ROOT_SERVERS[random.nextInt(IPV6_ROOT_SERVERS.length)];
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return InetAddressUtil.ipv6From(eu.siacs.conversations.Conversations.getContext().getString(R.string.default_dns_server_ipv6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,6 @@
|
||||||
<bool name="show_nav_bar">true</bool>
|
<bool name="show_nav_bar">true</bool>
|
||||||
<bool name="enforce_dane">false</bool>
|
<bool name="enforce_dane">false</bool>
|
||||||
<string name="default_chat_requests">spam</string>
|
<string name="default_chat_requests">spam</string>
|
||||||
<string name="default_dns_server_ipv4">176.9.93.198</string>
|
<string name="default_dns_server_ipv4">194.242.2.2</string>
|
||||||
<string name="default_dns_server_ipv6">[2a01:4f8:151:34aa::198]</string>
|
<string name="default_dns_server_ipv6">[2a07:e340::2]</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue