diff --git a/app/src/main/java/org/itxtech/daedalus/provider/HttpsProvider.java b/app/src/main/java/org/itxtech/daedalus/provider/HttpsProvider.java index e3fed27..b9b7a80 100644 --- a/app/src/main/java/org/itxtech/daedalus/provider/HttpsProvider.java +++ b/app/src/main/java/org/itxtech/daedalus/provider/HttpsProvider.java @@ -45,13 +45,13 @@ abstract public class HttpsProvider extends Provider { private static final String TAG = "HttpsProvider"; - protected final WhqList whqList = new WhqList(); + final WhqList whqList = new WhqList(); - public HttpsProvider(ParcelFileDescriptor descriptor, DaedalusVpnService service) { + HttpsProvider(ParcelFileDescriptor descriptor, DaedalusVpnService service) { super(descriptor, service); } - protected OkHttpClient getHttpClient(String accept) { + OkHttpClient getHttpClient(String accept) { return new OkHttpClient.Builder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(10, TimeUnit.SECONDS) diff --git a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java index b1ec42b..62af8b8 100644 --- a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java +++ b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java @@ -28,8 +28,8 @@ import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Set; /** * Daedalus Project @@ -126,6 +126,7 @@ public int onStartCommand(Intent intent, int flags, int startId) { this.notification = builder; } + DNSServerHelper.buildCache(); Daedalus.initRuleResolver(); if (this.mThread == null) { @@ -234,7 +235,6 @@ private InetAddress addDnsServer(Builder builder, String format, byte[] ipv6Temp @Override public void run() { try { - DNSServerHelper.buildCache(); Builder builder = new Builder() .setSession("Daedalus") .setConfigureIntent(PendingIntent.getActivity(this, 0, @@ -242,9 +242,9 @@ public void run() { PendingIntent.FLAG_ONE_SHOT)); //Set App Filter - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Daedalus.getPrefs().getBoolean("settings_app_filter_switch", false)) { - Set apps = Daedalus.getPrefs().getStringSet("filterAppObjects", null); - if (apps != null) { + if (Daedalus.getPrefs().getBoolean("settings_app_filter_switch", false)) { + ArrayList apps = Daedalus.configurations.getAppObjects(); + if (apps.size() > 0) { boolean mode = Daedalus.getPrefs().getBoolean("settings_app_filter_mode_switch", false); for (String app : apps) { try {