DMARC viewer improvements

This commit is contained in:
M66B 2023-11-13 17:11:15 +01:00
parent 77f75011ca
commit 67527c6513
8 changed files with 16 additions and 17 deletions

View File

@ -490,7 +490,7 @@
android:description="@string/title_advanced_dmarc_viewer"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">

View File

@ -497,7 +497,7 @@
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">

View File

@ -496,7 +496,7 @@
android:description="@string/title_advanced_dmarc_viewer"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">

View File

@ -496,7 +496,7 @@
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">

View File

@ -491,7 +491,7 @@
android:description="@string/title_advanced_dmarc_viewer"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">

View File

@ -300,7 +300,7 @@ public class ActivityDmarc extends ActivityBase {
continue;
if (ConnectionHelper.inSubnet(text, net[0], prefix)) {
valid = allow;
because = ip + " in " + p.first;
because = (allow ? '+' : '-') + ip + " in " + p.first;
}
} else if ("a".equals(ip) || ip.startsWith("a:")) {
String domain = (ip.startsWith("a:")
@ -321,13 +321,13 @@ public class ActivityDmarc extends ActivityBase {
if (prefix == null) {
if (text.equals(a.response)) {
valid = allow;
because = ip + " in " + domain;
because = (allow ? '+' : '-') + ip + " in " + domain;
break;
}
} else {
if (ConnectionHelper.inSubnet(text, a.response, prefix)) {
valid = allow;
because = ip + " in " + domain + "/" + prefix;
because = (allow ? '+' : '-') + ip + " in " + domain + "/" + prefix;
break;
}
}
@ -354,13 +354,13 @@ public class ActivityDmarc extends ActivityBase {
if (prefix == null) {
if (text.equals(a.response)) {
valid = allow;
because = ip + " in " + domain;
because = (allow ? '+' : '-') + ip + " in " + domain;
break;
}
} else {
if (ConnectionHelper.inSubnet(text, a.response, prefix)) {
valid = allow;
because = ip + " in " + domain + "/" + prefix;
because = (allow ? '+' : '-') + ip + " in " + domain + "/" + prefix;
break;
}
}
@ -372,7 +372,7 @@ public class ActivityDmarc extends ActivityBase {
}
} else if ("ptr".equals(ip) || ip.startsWith("ptr:")) {
valid = false;
because = ip + " ptr not supported";
because = (allow ? '+' : '-') + ip + " ptr not supported";
}
if (valid != null)
break;
@ -502,13 +502,11 @@ public class ActivityDmarc extends ActivityBase {
spf = lookupSpf(context, lastDomain, extra);
for (Pair<String, DnsHelper.DnsRecord> p : spf) {
ssb.append(p.first).append(' ')
.append(p.second.response).append("\n");
if (start == null) {
.append(p.second.response).append("\n\n");
if (start == null)
start = ssb.length();
ssb.append("\n");
}
}
ssb.append('\n').append(extra);
ssb.append(extra);
if (start != null) {
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), start, ssb.length(), 0);
ssb.append("\n");

View File

@ -17,6 +17,7 @@
<string name="app_cake_required">Minimum required storage space: %1$s</string>
<string name="app_updated">Last update: %1$s</string>
<string name="app_download">Downloaded from: %1$s</string>
<string name="app_dmarc" translatable="false">DMARC</string>
<string name="channel_service">Monitor</string>
<string name="channel_send">Send</string>

View File

@ -490,7 +490,7 @@
android:description="@string/title_advanced_dmarc_viewer"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="DMARC"
android:label="@string/app_dmarc"
android:launchMode="singleInstance"
android:resizeableActivity="true">