app: release 1.14.1

This commit is contained in:
PeratX 2019-07-16 19:44:24 +08:00
parent 4e0ee9a966
commit 7232206618
3 changed files with 10 additions and 8 deletions

View File

@ -10,8 +10,8 @@ android {
applicationId "org.itxtech.daedalus" applicationId "org.itxtech.daedalus"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 19 versionCode 20
versionName "1.14.0" versionName "1.14.1"
buildConfigField "String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"" buildConfigField "String", "BUILD_TIME", "\"${System.currentTimeMillis()}\""
buildConfigField "String", "GIT_COMMIT", "\"${gitCommit}\"" buildConfigField "String", "GIT_COMMIT", "\"${gitCommit}\""

View File

@ -125,7 +125,6 @@ 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) {
@ -232,6 +231,7 @@ 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,
@ -250,6 +250,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
} else { } else {
builder.addAllowedApplication(app); builder.addAllowedApplication(app);
} }
Logger.debug("Added app to list: " + app);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
Logger.error("Package Not Found:" + app); Logger.error("Package Not Found:" + app);
} }

View File

@ -26,23 +26,24 @@ import java.util.List;
* (at your option) any later version. * (at your option) any later version.
*/ */
public class DNSServerHelper { public class DNSServerHelper {
private static HashMap<String, Integer> portCache = null; private static HashMap<String, Integer> portCache = new HashMap<>();
public static HashMap<String, List<InetAddress>> domainCache = null; public static HashMap<String, List<InetAddress>> domainCache = new HashMap<>();
public static void clearCache() { public static void clearCache() {
portCache = null; portCache = new HashMap<>();
domainCache = null; domainCache = new HashMap<>();
} }
public static void buildCache() { public static void buildCache() {
domainCache = new HashMap<>(); domainCache = new HashMap<>();
portCache = new HashMap<>();
if (ProviderPicker.getDnsQueryMethod() >= ProviderPicker.DNS_QUERY_METHOD_HTTPS_IETF && if (ProviderPicker.getDnsQueryMethod() >= ProviderPicker.DNS_QUERY_METHOD_HTTPS_IETF &&
!Daedalus.getPrefs().getBoolean("settings_dont_build_doh_cache", false)) { !Daedalus.getPrefs().getBoolean("settings_dont_build_doh_cache", false)) {
buildDomainCache(getAddressById(getPrimary())); buildDomainCache(getAddressById(getPrimary()));
buildDomainCache(getAddressById(getSecondary())); buildDomainCache(getAddressById(getSecondary()));
} }
portCache = new HashMap<>();
for (DNSServer server : Daedalus.DNS_SERVERS) { for (DNSServer server : Daedalus.DNS_SERVERS) {
portCache.put(server.getAddress(), server.getPort()); portCache.put(server.getAddress(), server.getPort());
} }