Skip to content

Commit

Permalink
app: release 1.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Jul 16, 2019
1 parent 4e0ee9a commit 7232206
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.itxtech.daedalus"
minSdkVersion 21
targetSdkVersion 28
versionCode 19
versionName "1.14.0"
versionCode 20
versionName "1.14.1"

buildConfigField "String", "BUILD_TIME", "\"${System.currentTimeMillis()}\""
buildConfigField "String", "GIT_COMMIT", "\"${gitCommit}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
this.notification = builder;
}

DNSServerHelper.buildCache();
Daedalus.initRuleResolver();

if (this.mThread == null) {
Expand Down Expand Up @@ -232,6 +231,7 @@ 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,
Expand All @@ -250,6 +250,7 @@ public void run() {
} else {
builder.addAllowedApplication(app);
}
Logger.debug("Added app to list: " + app);
} catch (PackageManager.NameNotFoundException e) {
Logger.error("Package Not Found:" + app);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@
* (at your option) any later version.
*/
public class DNSServerHelper {
private static HashMap<String, Integer> portCache = null;
public static HashMap<String, List<InetAddress>> domainCache = null;
private static HashMap<String, Integer> portCache = new HashMap<>();
public static HashMap<String, List<InetAddress>> domainCache = new HashMap<>();

public static void clearCache() {
portCache = null;
domainCache = null;
portCache = new HashMap<>();
domainCache = new HashMap<>();
}

public static void buildCache() {
domainCache = new HashMap<>();
portCache = new HashMap<>();

if (ProviderPicker.getDnsQueryMethod() >= ProviderPicker.DNS_QUERY_METHOD_HTTPS_IETF &&
!Daedalus.getPrefs().getBoolean("settings_dont_build_doh_cache", false)) {
buildDomainCache(getAddressById(getPrimary()));
buildDomainCache(getAddressById(getSecondary()));
}

portCache = new HashMap<>();
for (DNSServer server : Daedalus.DNS_SERVERS) {
portCache.put(server.getAddress(), server.getPort());
}
Expand Down

0 comments on commit 7232206

Please sign in to comment.