AppFilter: update
This commit is contained in:
parent
cb08d9ddeb
commit
1bc68d0c89
@ -40,7 +40,6 @@ import java.util.Objects;
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
public class AppFilterActivity extends AppCompatActivity {
|
public class AppFilterActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private RecyclerViewAdapter adapter;
|
private RecyclerViewAdapter adapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,7 +77,7 @@ public class AppFilterActivity extends AppCompatActivity {
|
|||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AppObject {
|
private static class AppObject {
|
||||||
private String appName;
|
private String appName;
|
||||||
private String appPackageName;
|
private String appPackageName;
|
||||||
private Drawable appIcon;
|
private Drawable appIcon;
|
||||||
@ -111,13 +110,11 @@ public class AppFilterActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
void updateList(ArrayList<AppObject> appObjects) {
|
void updateList(ArrayList<AppObject> appObjects) {
|
||||||
appList = appObjects;
|
appList = appObjects;
|
||||||
|
|
||||||
for (int i = 0; i < appObjects.size(); i++) {
|
for (int i = 0; i < appObjects.size(); i++) {
|
||||||
if (Daedalus.configurations.getAppObjects().contains(appObjects.get(i).appPackageName)) {
|
if (Daedalus.configurations.getAppObjects().contains(appObjects.get(i).appPackageName)) {
|
||||||
checkStatus.put(i, true);
|
checkStatus.put(i, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runOnUiThread(this::notifyDataSetChanged);
|
runOnUiThread(this::notifyDataSetChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +155,7 @@ public class AppFilterActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RecyclerViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
private static class RecyclerViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
private ImageView appIcon;
|
private ImageView appIcon;
|
||||||
private TextView appName;
|
private TextView appName;
|
||||||
private CheckBox appCheck;
|
private CheckBox appCheck;
|
||||||
@ -172,7 +169,6 @@ public class AppFilterActivity extends AppCompatActivity {
|
|||||||
itemView.setOnClickListener(this);
|
itemView.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (appCheck.isChecked()) {
|
if (appCheck.isChecked()) {
|
||||||
|
@ -151,7 +151,6 @@ public class DnsTestFragment extends ToolbarFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private StringBuilder testServer(DnsQuery dnsQuery, Record.TYPE type, AbstractDnsServer server, String domain, StringBuilder testText) {
|
private StringBuilder testServer(DnsQuery dnsQuery, Record.TYPE type, AbstractDnsServer server, String domain, StringBuilder testText) {
|
||||||
Logger.debug("Testing DNS server " + server.getRealName());
|
Logger.debug("Testing DNS server " + server.getRealName());
|
||||||
testText.append(getString(R.string.test_domain)).append(" ").append(domain).append("\n")
|
testText.append(getString(R.string.test_domain)).append(" ").append(domain).append("\n")
|
||||||
|
@ -15,7 +15,7 @@ import org.itxtech.daedalus.service.DaedalusVpnService;
|
|||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
public class ProviderPicker {
|
public abstract class ProviderPicker {
|
||||||
public static final int DNS_QUERY_METHOD_UDP = 0;
|
public static final int DNS_QUERY_METHOD_UDP = 0;
|
||||||
public static final int DNS_QUERY_METHOD_TCP = 1;
|
public static final int DNS_QUERY_METHOD_TCP = 1;
|
||||||
public static final int DNS_QUERY_METHOD_TLS = 2;
|
public static final int DNS_QUERY_METHOD_TLS = 2;
|
||||||
|
@ -91,7 +91,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateUpstreamServers(Context context) {
|
private static void updateUpstreamServers(Context context) {
|
||||||
String[] servers = DnsServersDetector.getServers(context);
|
String[] servers = DnsServersDetector.getServers(context);
|
||||||
if (servers != null) {
|
if (servers != null) {
|
||||||
if (servers.length >= 2 && (aliasPrimary == null || !aliasPrimary.getHostAddress().equals(servers[0])) &&
|
if (servers.length >= 2 && (aliasPrimary == null || !aliasPrimary.getHostAddress().equals(servers[0])) &&
|
||||||
@ -197,6 +197,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
|||||||
stopThread();
|
stopThread();
|
||||||
if (receiver != null) {
|
if (receiver != null) {
|
||||||
unregisterReceiver(receiver);
|
unregisterReceiver(receiver);
|
||||||
|
receiver = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user