Skip to content

Commit 7232206

Browse files
committed
app: release 1.14.1
1 parent 4e0ee9a commit 7232206

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "org.itxtech.daedalus"
1111
minSdkVersion 21
1212
targetSdkVersion 28
13-
versionCode 19
14-
versionName "1.14.0"
13+
versionCode 20
14+
versionName "1.14.1"
1515

1616
buildConfigField "String", "BUILD_TIME", "\"${System.currentTimeMillis()}\""
1717
buildConfigField "String", "GIT_COMMIT", "\"${gitCommit}\""

app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
125125
this.notification = builder;
126126
}
127127

128-
DNSServerHelper.buildCache();
129128
Daedalus.initRuleResolver();
130129

131130
if (this.mThread == null) {
@@ -232,6 +231,7 @@ private InetAddress addDnsServer(Builder builder, String format, byte[] ipv6Temp
232231
@Override
233232
public void run() {
234233
try {
234+
DNSServerHelper.buildCache();
235235
Builder builder = new Builder()
236236
.setSession("Daedalus")
237237
.setConfigureIntent(PendingIntent.getActivity(this, 0,
@@ -250,6 +250,7 @@ public void run() {
250250
} else {
251251
builder.addAllowedApplication(app);
252252
}
253+
Logger.debug("Added app to list: " + app);
253254
} catch (PackageManager.NameNotFoundException e) {
254255
Logger.error("Package Not Found:" + app);
255256
}

app/src/main/java/org/itxtech/daedalus/util/server/DNSServerHelper.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,24 @@
2626
* (at your option) any later version.
2727
*/
2828
public class DNSServerHelper {
29-
private static HashMap<String, Integer> portCache = null;
30-
public static HashMap<String, List<InetAddress>> domainCache = null;
29+
private static HashMap<String, Integer> portCache = new HashMap<>();
30+
public static HashMap<String, List<InetAddress>> domainCache = new HashMap<>();
3131

3232
public static void clearCache() {
33-
portCache = null;
34-
domainCache = null;
33+
portCache = new HashMap<>();
34+
domainCache = new HashMap<>();
3535
}
3636

3737
public static void buildCache() {
3838
domainCache = new HashMap<>();
39+
portCache = new HashMap<>();
40+
3941
if (ProviderPicker.getDnsQueryMethod() >= ProviderPicker.DNS_QUERY_METHOD_HTTPS_IETF &&
4042
!Daedalus.getPrefs().getBoolean("settings_dont_build_doh_cache", false)) {
4143
buildDomainCache(getAddressById(getPrimary()));
4244
buildDomainCache(getAddressById(getSecondary()));
4345
}
4446

45-
portCache = new HashMap<>();
4647
for (DNSServer server : Daedalus.DNS_SERVERS) {
4748
portCache.put(server.getAddress(), server.getPort());
4849
}

0 commit comments

Comments
 (0)