Updating ad server list, removing unnecessary code in adblock

This commit is contained in:
Anthony Restaino 2016-08-06 17:41:00 -04:00
parent d5c8479a41
commit 4539536eb5
2 changed files with 356 additions and 35 deletions

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,6 @@ public class AdBlock {
private static final String EMPTY = "";
private final Set<String> mBlockedDomainsList = new HashSet<>();
private boolean mBlockAds;
private static final Locale mLocale = Locale.getDefault();
@Inject PreferenceManager mPreferenceManager;
@ -67,7 +66,7 @@ public class AdBlock {
asset.open(BLOCKED_DOMAINS_LIST_FILE_NAME)));
String line;
while ((line = reader.readLine()) != null) {
mBlockedDomainsList.add(line.trim().toLowerCase(mLocale));
mBlockedDomainsList.add(line.trim());
}
} catch (IOException e) {
Log.wtf(TAG, "Reading blocked domains list from file '"
@ -99,7 +98,7 @@ public class AdBlock {
return false;
}
boolean isOnBlacklist = mBlockedDomainsList.contains(domain.toLowerCase(mLocale));
boolean isOnBlacklist = mBlockedDomainsList.contains(domain);
if (isOnBlacklist) {
Log.d(TAG, "URL '" + url + "' is an ad");
}