mirror of https://github.com/M66B/FairEmail.git
Check DBL for suspicious links
This commit is contained in:
parent
771ff11ba8
commit
24bc078cf8
|
@ -162,6 +162,10 @@ public class DnsBlockList {
|
|||
return (hasDomain ? false : null);
|
||||
}
|
||||
|
||||
static Boolean isJunk(Context context, String domain) {
|
||||
return isJunk(context, domain, false, BLOCK_LISTS);
|
||||
}
|
||||
|
||||
private static boolean isJunk(Context context, String host, boolean numeric, List<BlockList> blocklists) {
|
||||
synchronized (cache) {
|
||||
CacheEntry entry = cache.get(host);
|
||||
|
|
|
@ -403,6 +403,31 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
|||
tvSuspicious.setVisibility(Helper.isSingleScript(host) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG &&
|
||||
tvSuspicious.getVisibility() != View.VISIBLE) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("host", host);
|
||||
|
||||
new SimpleTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean onExecute(Context context, Bundle args) throws Throwable {
|
||||
String host = args.getString("host");
|
||||
return DnsBlockList.isJunk(context, host);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, Boolean blocklist) {
|
||||
if (blocklist != null && blocklist)
|
||||
tvSuspicious.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
// Ignored
|
||||
}
|
||||
}.execute(this, args, "link:blocklist");
|
||||
}
|
||||
|
||||
grpDifferent.setVisibility(
|
||||
host == null || thost == null || host.equalsIgnoreCase(thost)
|
||||
? View.GONE : View.VISIBLE);
|
||||
|
|
Loading…
Reference in New Issue