AppFilter: it is FAKE before

This commit is contained in:
PeratX 2019-07-16 19:26:25 +08:00
parent d50d3d1460
commit 9fcb707061
2 changed files with 8 additions and 8 deletions

View File

@ -45,13 +45,13 @@ abstract public class HttpsProvider extends Provider {
private static final String TAG = "HttpsProvider"; 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); super(descriptor, service);
} }
protected OkHttpClient getHttpClient(String accept) { OkHttpClient getHttpClient(String accept) {
return new OkHttpClient.Builder() return new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS) .connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS) .readTimeout(10, TimeUnit.SECONDS)

View File

@ -28,8 +28,8 @@ import java.net.Inet4Address;
import java.net.Inet6Address; import java.net.Inet6Address;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Set;
/** /**
* Daedalus Project * Daedalus Project
@ -126,6 +126,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
this.notification = builder; this.notification = builder;
} }
DNSServerHelper.buildCache();
Daedalus.initRuleResolver(); Daedalus.initRuleResolver();
if (this.mThread == null) { if (this.mThread == null) {
@ -234,7 +235,6 @@ public class DaedalusVpnService extends VpnService implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
DNSServerHelper.buildCache();
Builder builder = new Builder() Builder builder = new Builder()
.setSession("Daedalus") .setSession("Daedalus")
.setConfigureIntent(PendingIntent.getActivity(this, 0, .setConfigureIntent(PendingIntent.getActivity(this, 0,
@ -242,9 +242,9 @@ public class DaedalusVpnService extends VpnService implements Runnable {
PendingIntent.FLAG_ONE_SHOT)); PendingIntent.FLAG_ONE_SHOT));
//Set App Filter //Set App Filter
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Daedalus.getPrefs().getBoolean("settings_app_filter_switch", false)) { if (Daedalus.getPrefs().getBoolean("settings_app_filter_switch", false)) {
Set<String> apps = Daedalus.getPrefs().getStringSet("filterAppObjects", null); ArrayList<String> apps = Daedalus.configurations.getAppObjects();
if (apps != null) { if (apps.size() > 0) {
boolean mode = Daedalus.getPrefs().getBoolean("settings_app_filter_mode_switch", false); boolean mode = Daedalus.getPrefs().getBoolean("settings_app_filter_mode_switch", false);
for (String app : apps) { for (String app : apps) {
try { try {