mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Revert "Added custom DNS resolver option"
This reverts commit 6b90d0e166.
This commit is contained in:
@@ -20,7 +20,6 @@ package eu.faircode.email;
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.DnsResolver;
|
||||
import android.net.LinkProperties;
|
||||
@@ -30,7 +29,6 @@ import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.minidns.DnsClient;
|
||||
import org.minidns.dnsmessage.DnsMessage;
|
||||
@@ -312,20 +310,10 @@ public class DnsHelper {
|
||||
}
|
||||
|
||||
static InetAddress getByName(Context context, String host) throws UnknownHostException {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean custom_dns = prefs.getBoolean("custom_dns", false);
|
||||
if (!custom_dns)
|
||||
return InetAddress.getByName(host);
|
||||
|
||||
return getAllByName(context, host)[0];
|
||||
}
|
||||
|
||||
static InetAddress[] getAllByName(Context context, String host) throws UnknownHostException {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean custom_dns = prefs.getBoolean("custom_dns", false);
|
||||
if (!custom_dns)
|
||||
return InetAddress.getAllByName(host);
|
||||
|
||||
List<InetAddress> result = new ArrayList<>();
|
||||
|
||||
boolean[] has46 = ConnectionHelper.has46(context);
|
||||
|
||||
Reference in New Issue
Block a user