<w>torproject</w>
<w>uidh</w>
<w>uids</w>
+ <w>ultraprivacy</w>
<w>uname</w>
<w>uncheck</w>
<w>undelete</w>
--- /dev/null
+[Adblock Plus 2.0]
+! Version: 1
+! Title: UltraPrivacy
+! Last modified: 25 Jul 2018 20:41 UTC
+! Expires: 90 days (update frequency)
+! Homepage: https://www.stoutner.com/privacy-browser/blocklists/ultraprivacy/
+! Licence: GPLv3+ http://www.gnu.org/licenses/gpl-3.0.html
+!
+! I can't imagine that anything that includes `analytics` is good for your privacy. https://redmine.stoutner.com/issues/312.
+analytics
Switch easyPrivacySwitch = view.findViewById(R.id.domain_settings_easyprivacy_switch);
Switch fanboysAnnoyanceSwitch = view.findViewById(R.id.domain_settings_fanboys_annoyance_list_switch);
Switch fanboysSocialBlockingSwitch = view.findViewById(R.id.domain_settings_fanboys_social_blocking_list_switch);
+ Switch ultraPrivacySwitch = view.findViewById(R.id.domain_settings_ultraprivacy_switch);
Switch blockAllThirdPartyRequestsSwitch = view.findViewById(R.id.domain_settings_block_all_third_party_requests_switch);
Spinner userAgentSpinner = view.findViewById(R.id.domain_settings_user_agent_spinner);
EditText customUserAgentEditText = view.findViewById(R.id.domain_settings_custom_user_agent_edittext);
boolean easyPrivacyEnabled = easyPrivacySwitch.isChecked();
boolean fanboysAnnoyanceEnabled = fanboysAnnoyanceSwitch.isChecked();
boolean fanboysSocialBlockingEnabled = fanboysSocialBlockingSwitch.isChecked();
+ boolean ultraPrivacyEnabled = ultraPrivacySwitch.isChecked();
boolean blockAllThirdPartyRequests = blockAllThirdPartyRequestsSwitch.isChecked();
int userAgentPosition = userAgentSpinner.getSelectedItemPosition();
int fontSizePosition = fontSizeSpinner.getSelectedItemPosition();
if (savedSslCertificateRadioButton.isChecked()) { // The current certificate is being used.
// Update the database except for the certificate.
domainsDatabaseHelper.updateDomainExceptCertificate(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled,
- domStorageEnabled, formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, blockAllThirdPartyRequests, userAgentName, fontSizeInt,
- swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate);
+ domStorageEnabled, formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests,
+ userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate);
} else if (currentWebsiteCertificateRadioButton.isChecked()) { // The certificate is being updated with the current website certificate.
// Get the current website SSL certificate.
SslCertificate currentWebsiteSslCertificate = MainWebViewActivity.sslCertificate;
// Update the database.
domainsDatabaseHelper.updateDomainWithCertificate(currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled, domStorageEnabled,
- formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, blockAllThirdPartyRequests, userAgentName, fontSizeInt, swipeToRefreshInt,
- nightModeInt, displayWebpageImagesInt, pinnedSslCertificate, issuedToCommonName, issuedToOrganization, issuedToOrganizationalUnit, issuedByCommonName, issuedByOrganization,
- issuedByOrganizationalUnit, startDateLong, endDateLong);
+ formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests, userAgentName, fontSizeInt,
+ swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate, issuedToCommonName, issuedToOrganization, issuedToOrganizationalUnit, issuedByCommonName,
+ issuedByOrganization, issuedByOrganizationalUnit, startDateLong, endDateLong);
} else { // No certificate is selected.
// Update the database, with PINNED_SSL_CERTIFICATE set to false.
domainsDatabaseHelper.updateDomainExceptCertificate(currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled, domStorageEnabled,
- formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, blockAllThirdPartyRequests, userAgentName, fontSizeInt, swipeToRefreshInt,
- nightModeInt, displayWebpageImagesInt,false);
+ formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests, userAgentName, fontSizeInt,
+ swipeToRefreshInt, nightModeInt, displayWebpageImagesInt,false);
}
}
public static String easyPrivacyVersion;
public static String fanboysAnnoyanceVersion;
public static String fanboysSocialVersion;
+ public static String ultraPrivacyVersion;
// The request items are public static so they can be accessed by `BlockListHelper`, `RequestsArrayAdapter`, and `ViewRequestsDialog`. They are also used in `onCreate()`.
public static List<String[]> resourceRequests;
private boolean easyPrivacyEnabled;
private boolean fanboysAnnoyanceListEnabled;
private boolean fanboysSocialBlockingListEnabled;
+ private boolean ultraPrivacyEnabled;
// `privacyBrowserRuntime` is used in `onCreate()`, `onOptionsItemSelected()`, and `applyAppSettings()`.
private Runtime privacyBrowserRuntime;
final ArrayList<List<String[]>> easyPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/easyprivacy.txt");
final ArrayList<List<String[]>> fanboysAnnoyanceList = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-annoyance.txt");
final ArrayList<List<String[]>> fanboysSocialList = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-social.txt");
+ final ArrayList<List<String[]>> ultraPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/ultraprivacy.txt");
// Store the list versions.
easyListVersion = easyList.get(0).get(0)[0];
easyPrivacyVersion = easyPrivacy.get(0).get(0)[0];
fanboysAnnoyanceVersion = fanboysAnnoyanceList.get(0).get(0)[0];
fanboysSocialVersion = fanboysSocialList.get(0).get(0)[0];
+ ultraPrivacyVersion = ultraPrivacy.get(0).get(0)[0];
mainWebView.setWebViewClient(new WebViewClient() {
// `shouldOverrideUrlLoading` makes this `WebView` the default handler for URLs inside the app, so that links are not kicked out to other apps.
return emptyWebResourceResponse;
}
+ // Check UltraPrivacy if it is enabled.
+ if (ultraPrivacyEnabled) {
+ if (blockListHelper.isBlocked(currentDomain, url, isThirdPartyRequest, ultraPrivacy)) {
+ // The resource request was blocked. Return an empty web resource response.
+ return emptyWebResourceResponse;
+ }
+
+ // If the whitelist result is not null, the request has been allowed by UltraPrivacy.
+ if (whiteListResultStringArray != null) {
+ // Add a whitelist entry to the resource requests array.
+ resourceRequests.add(whiteListResultStringArray);
+
+ // The resource request has been allowed by UltraPrivacy. `return null` loads the requested resource.
+ return null;
+ }
+ }
+
// Check EasyList if it is enabled.
if (easyListEnabled) {
if (blockListHelper.isBlocked(currentDomain, url, isThirdPartyRequest, easyList)) {
MenuItem easyPrivacyMenuItem = menu.findItem(R.id.easyprivacy);
MenuItem fanboysAnnoyanceListMenuItem = menu.findItem(R.id.fanboys_annoyance_list);
MenuItem fanboysSocialBlockingListMenuItem = menu.findItem(R.id.fanboys_social_blocking_list);
+ MenuItem ultraPrivacyMenuItem = menu.findItem(R.id.ultraprivacy);
MenuItem blockAllThirdParyRequestsMenuItem = menu.findItem(R.id.block_all_third_party_requests);
MenuItem fontSizeMenuItem = menu.findItem(R.id.font_size);
MenuItem swipeToRefreshMenuItem = menu.findItem(R.id.swipe_to_refresh);
easyPrivacyMenuItem.setChecked(easyPrivacyEnabled);
fanboysAnnoyanceListMenuItem.setChecked(fanboysAnnoyanceListEnabled);
fanboysSocialBlockingListMenuItem.setChecked(fanboysSocialBlockingListEnabled);
+ ultraPrivacyMenuItem.setChecked(ultraPrivacyEnabled);
blockAllThirdParyRequestsMenuItem.setChecked(blockAllThirdPartyRequests);
swipeToRefreshMenuItem.setChecked(swipeRefreshLayout.isEnabled());
displayImagesMenuItem.setChecked(mainWebView.getSettings().getLoadsImagesAutomatically());
mainWebView.reload();
return true;
+ case R.id.ultraprivacy:
+ // Toggle the UltraPrivacy status.
+ ultraPrivacyEnabled = !ultraPrivacyEnabled;
+
+ // Update the menu checkbox.
+ menuItem.setChecked(ultraPrivacyEnabled);
+
+ // Reload the main WebView.
+ mainWebView.reload();
+ return true;
+
case R.id.block_all_third_party_requests:
//Toggle the third-party requests blocker status.
blockAllThirdPartyRequests = !blockAllThirdPartyRequests;
easyPrivacyEnabled = (currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_EASYPRIVACY)) == 1);
fanboysAnnoyanceListEnabled = (currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_FANBOYS_ANNOYANCE_LIST)) == 1);
fanboysSocialBlockingListEnabled = (currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST)) == 1);
+ ultraPrivacyEnabled = (currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_ULTRAPRIVACY)) == 1);
blockAllThirdPartyRequests = (currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.BLOCK_ALL_THIRD_PARTY_REQUESTS)) == 1);
String userAgentName = currentHostDomainSettingsCursor.getString(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.USER_AGENT));
int fontSize = currentHostDomainSettingsCursor.getInt(currentHostDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE));
easyPrivacyEnabled = sharedPreferences.getBoolean("easyprivacy", true);
fanboysAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboy_annoyance_list", true);
fanboysSocialBlockingListEnabled = sharedPreferences.getBoolean("fanboy_social_blocking_list", true);
+ ultraPrivacyEnabled = sharedPreferences.getBoolean("ultraprivacy", true);
blockAllThirdPartyRequests = sharedPreferences.getBoolean("block_all_third_party_requests", false);
// Set `javaScriptEnabled` to be `true` if `night_mode` is `true`.
TextView versionEasyPrivacyTextView = tabLayout.findViewById(R.id.about_version_easyprivacy);
TextView versionFanboyAnnoyanceTextView = tabLayout.findViewById(R.id.about_version_fanboy_annoyance);
TextView versionFanboySocialTextView = tabLayout.findViewById(R.id.about_version_fanboy_social);
+ TextView versionUltraPrivacyTextView = tabLayout.findViewById(R.id.about_version_ultraprivacy);
TextView certificateIssuerDNTextView = tabLayout.findViewById(R.id.about_version_certificate_issuer_dn);
TextView certificateSubjectDNTextView = tabLayout.findViewById(R.id.about_version_certificate_subject_dn);
TextView certificateStartDateTextView = tabLayout.findViewById(R.id.about_version_certificate_start_date);
String easyPrivacyLabel = getString(R.string.easyprivacy_label) + " ";
String fanboyAnnoyanceLabel = getString(R.string.fanboy_annoyance_label) + " ";
String fanboySocialLabel = getString(R.string.fanboy_social_label) + " ";
+ String ultraPrivacyLabel = getString(R.string.ultraprivacy_label) + " ";
String issuerDNLabel = getString(R.string.issuer_dn) + " ";
String subjectDNLabel = getString(R.string.subject_dn) + " ";
String startDateLabel = getString(R.string.start_date) + " ";
SpannableStringBuilder easyPrivacyStringBuilder = new SpannableStringBuilder(easyPrivacyLabel + MainWebViewActivity.easyPrivacyVersion);
SpannableStringBuilder fanboyAnnoyanceStringBuilder = new SpannableStringBuilder(fanboyAnnoyanceLabel + MainWebViewActivity.fanboysAnnoyanceVersion);
SpannableStringBuilder fanboySocialStringBuilder = new SpannableStringBuilder(fanboySocialLabel + MainWebViewActivity.fanboysSocialVersion);
+ SpannableStringBuilder ultraPrivacyStringBuilder = new SpannableStringBuilder(ultraPrivacyLabel + MainWebViewActivity.ultraPrivacyVersion);
// Create the `blueColorSpan` variable.
ForegroundColorSpan blueColorSpan;
easyPrivacyStringBuilder.setSpan(blueColorSpan, easyPrivacyLabel.length(), easyPrivacyStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
fanboyAnnoyanceStringBuilder.setSpan(blueColorSpan, fanboyAnnoyanceLabel.length(), fanboyAnnoyanceStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
fanboySocialStringBuilder.setSpan(blueColorSpan, fanboySocialLabel.length(), fanboySocialStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+ ultraPrivacyStringBuilder.setSpan(blueColorSpan, ultraPrivacyLabel.length(), ultraPrivacyStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
// Display the strings in the text boxes.
versionNumberTextView.setText(version);
versionEasyPrivacyTextView.setText(easyPrivacyStringBuilder);
versionFanboyAnnoyanceTextView.setText(fanboyAnnoyanceStringBuilder);
versionFanboySocialTextView.setText(fanboySocialStringBuilder);
+ versionUltraPrivacyTextView.setText(ultraPrivacyStringBuilder);
// Build.VERSION.SECURITY_PATCH is only available for SDK_INT >= 23.
if (Build.VERSION.SDK_INT >= 23) {
ImageView fanboysAnnoyanceListImageView = domainSettingsView.findViewById(R.id.domain_settings_fanboys_annoyance_list_imageview);
Switch fanboysSocialBlockingListSwitch = domainSettingsView.findViewById(R.id.domain_settings_fanboys_social_blocking_list_switch);
ImageView fanboysSocialBlockingListImageView = domainSettingsView.findViewById(R.id.domain_settings_fanboys_social_blocking_list_imageview);
+ Switch ultraPrivacySwitch = domainSettingsView.findViewById(R.id.domain_settings_ultraprivacy_switch);
+ ImageView ultraPrivacyImageView = domainSettingsView.findViewById(R.id.domain_settings_ultraprivacy_imageview);
Switch blockAllThirdPartyRequestsSwitch = domainSettingsView.findViewById(R.id.domain_settings_block_all_third_party_requests_switch);
ImageView blockAllThirdPartyRequestsImageView = domainSettingsView.findViewById(R.id.domain_settings_block_all_third_party_requests_imageview);
final Spinner userAgentSpinner = domainSettingsView.findViewById(R.id.domain_settings_user_agent_spinner);
int easyPrivacyEnabledInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_EASYPRIVACY));
int fanboysAnnoyanceListInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_FANBOYS_ANNOYANCE_LIST));
int fanboysSocialBlockingListInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST));
+ int ultraPrivacyEnabledInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.ENABLE_ULTRAPRIVACY));
int blockAllThirdPartyRequestsInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.BLOCK_ALL_THIRD_PARTY_REQUESTS));
final String currentUserAgentName = domainCursor.getString(domainCursor.getColumnIndex(DomainsDatabaseHelper.USER_AGENT));
int fontSizeInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE));
}
}
+ // Set the UltraPrivacy status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (ultraPrivacyEnabledInt == 1) { // UltraPrivacy is on.
+ // Turn the switch on.
+ ultraPrivacySwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_dark));
+ } else {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_light));
+ }
+ } else { // EasyPrivacy is off.
+ // Turn the switch off.
+ ultraPrivacySwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_dark));
+ } else {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_light));
+ }
+ }
+
// Set the third-party resource blocking status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
if (blockAllThirdPartyRequestsInt == 1) { // Blocking all third-party requests is on.
// Turn the switch on.
}
});
+ // Set the UltraPrivacy switch listener.
+ ultraPrivacySwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
+ // Update the icon.
+ if (isChecked) { // UltraPrivacy is on.
+ // Set the icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_dark));
+ } else {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_light));
+ }
+ } else { // UltraPrivacy is off.
+ // Set the icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_dark));
+ } else {
+ ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_light));
+ }
+ }
+ });
+
// Set the block all third-party requests switch listener.
blockAllThirdPartyRequestsSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
// Update the icon.
final Preference easyPrivacyPreference = findPreference("easyprivacy");
final Preference fanboyAnnoyanceListPreference = findPreference("fanboy_annoyance_list");
final Preference fanboySocialBlockingListPreference = findPreference("fanboy_social_blocking_list");
+ final Preference ultraPrivacyPreference = findPreference("ultraprivacy");
final Preference blockAllThirdPartyRequestsPreference = findPreference("block_all_third_party_requests");
final Preference proxyThroughOrbotPreference = findPreference("proxy_through_orbot");
final Preference torHomepagePreference = findPreference("tor_homepage");
}
}
+ // Set the UltraPrivacy icon.
+ if (savedPreferences.getBoolean("ultraprivacy", true)) {
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_dark);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_dark);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_light);
+ }
+ }
+
// Set the block all third-party requests icon.
if (savedPreferences.getBoolean("block_all_third_party_requests", false)) {
if (MainWebViewActivity.darkTheme) {
}
break;
+ case "ultraprivacy":
+ // Update the icon.
+ if (sharedPreferences.getBoolean("ultraprivacy", true)) {
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_dark);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_dark);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_light);
+ }
+ }
+ break;
+
case "block_all_third_party_requests":
// Update the icon.
if (sharedPreferences.getBoolean("block_all_third_party_requests", false)) {
package com.stoutner.privacybrowser.helpers;
import android.content.res.AssetManager;
-import android.net.Uri;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import android.preference.PreferenceManager;
public class DomainsDatabaseHelper extends SQLiteOpenHelper {
- private static final int SCHEMA_VERSION = 7;
+ private static final int SCHEMA_VERSION = 8;
private static final String DOMAINS_DATABASE = "domains.db";
private static final String DOMAINS_TABLE = "domains";
public static final String ENABLE_EASYLIST = "enableeasylist";
public static final String ENABLE_EASYPRIVACY = "enableeasyprivacy";
public static final String ENABLE_FANBOYS_ANNOYANCE_LIST = "enablefanboysannoyancelist";
- public static final String BLOCK_ALL_THIRD_PARTY_REQUESTS = "blockallthirdpartyrequests";
public static final String ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST = "enablefanboyssocialblockinglist";
+ public static final String ENABLE_ULTRAPRIVACY = "enableultraprivacy";
+ public static final String BLOCK_ALL_THIRD_PARTY_REQUESTS = "blockallthirdpartyrequests";
public static final String USER_AGENT = "useragent";
public static final String FONT_SIZE = "fontsize";
public static final String SWIPE_TO_REFRESH = "swipetorefresh";
ENABLE_EASYPRIVACY + " BOOLEAN, " +
ENABLE_FANBOYS_ANNOYANCE_LIST + " BOOLEAN, " +
ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST + " BOOLEAN, " +
+ ENABLE_ULTRAPRIVACY + " BOOLEAN, " +
BLOCK_ALL_THIRD_PARTY_REQUESTS + " BOOLEAN, " +
USER_AGENT + " TEXT, " +
FONT_SIZE + " INTEGER, " +
case 6:
// Add the block all third-party requests column.
domainsDatabase.execSQL("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + BLOCK_ALL_THIRD_PARTY_REQUESTS + " BOOLEAN");
+
+ // Upgrade from schema version 7.
+ case 7:
+ // Add the UltraPrivacy column.
+ domainsDatabase.execSQL("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + ENABLE_ULTRAPRIVACY + " BOOLEAN");
+
+ // Enable it for all existing rows.
+ domainsDatabase.execSQL("UPDATE " + DOMAINS_TABLE + " SET " + ENABLE_ULTRAPRIVACY + " = " + 1);
}
}
boolean easyPrivacyEnabled = sharedPreferences.getBoolean("easyprivacy", true);
boolean fanboyAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboy_annoyance_list", true);
boolean fanboySocialBlockingListEnabled = sharedPreferences.getBoolean("fanboy_social_blocking_list", true);
+ boolean ultraPrivacyEnabled = sharedPreferences.getBoolean("ultraprivacy", true);
boolean blockAllThirdPartyRequests = sharedPreferences.getBoolean("block_all_third_party_requests", false);
// Create entries for the database fields. The ID is created automatically. The pinned SSL certificate information is not created unless added by the user.
domainContentValues.put(ENABLE_EASYPRIVACY, easyPrivacyEnabled);
domainContentValues.put(ENABLE_FANBOYS_ANNOYANCE_LIST, fanboyAnnoyanceListEnabled);
domainContentValues.put(ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST, fanboySocialBlockingListEnabled);
+ domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacyEnabled);
domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests);
domainContentValues.put(USER_AGENT, "System default user agent");
domainContentValues.put(FONT_SIZE, 0);
public void updateDomainExceptCertificate(int databaseId, String domainName, boolean javaScriptEnabled, boolean firstPartyCookiesEnabled, boolean thirdPartyCookiesEnabled, boolean domStorageEnabled,
boolean formDataEnabled, boolean easyListEnabled, boolean easyPrivacyEnabled, boolean fanboysAnnoyanceEnabled, boolean fanboysSocialBlockingEnabled,
- boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int displayImages, boolean pinnedSslCertificate) {
+ boolean ultraPrivacyEnabled, boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int displayImages,
+ boolean pinnedSslCertificate) {
// Store the domain data in a `ContentValues`.
ContentValues domainContentValues = new ContentValues();
domainContentValues.put(ENABLE_EASYPRIVACY, easyPrivacyEnabled);
domainContentValues.put(ENABLE_FANBOYS_ANNOYANCE_LIST, fanboysAnnoyanceEnabled);
domainContentValues.put(ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST, fanboysSocialBlockingEnabled);
+ domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacyEnabled);
domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests);
domainContentValues.put(USER_AGENT, userAgent);
domainContentValues.put(FONT_SIZE, fontSize);
public void updateDomainWithCertificate(int databaseId, String domainName, boolean javaScriptEnabled, boolean firstPartyCookiesEnabled, boolean thirdPartyCookiesEnabled, boolean domStorageEnabled,
boolean formDataEnabled, boolean easyListEnabled, boolean easyPrivacyEnabled, boolean fanboysAnnoyanceEnabled, boolean fanboysSocialBlockingEnabled,
- boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int displayImages, boolean pinnedSslCertificate,
- String sslIssuedToCommonName, String sslIssuedToOrganization, String sslIssuedToOrganizationalUnit, String sslIssuedByCommonName, String sslIssuedByOrganization,
- String sslIssuedByOrganizationalUnit, long sslStartDate, long sslEndDate) {
+ boolean ultraPrivacyEnabled, boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int displayImages,
+ boolean pinnedSslCertificate, String sslIssuedToCommonName, String sslIssuedToOrganization, String sslIssuedToOrganizationalUnit, String sslIssuedByCommonName,
+ String sslIssuedByOrganization, String sslIssuedByOrganizationalUnit, long sslStartDate, long sslEndDate) {
// Store the domain data in a `ContentValues`.
ContentValues domainContentValues = new ContentValues();
domainContentValues.put(ENABLE_EASYPRIVACY, easyPrivacyEnabled);
domainContentValues.put(ENABLE_FANBOYS_ANNOYANCE_LIST, fanboysAnnoyanceEnabled);
domainContentValues.put(ENABLE_FANBOYS_SOCIAL_BLOCKING_LIST, fanboysSocialBlockingEnabled);
+ domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacyEnabled);
domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests);
domainContentValues.put(USER_AGENT, userAgent);
domainContentValues.put(FONT_SIZE, fontSize);
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
+ <TextView
+ android:id="@+id/about_version_ultraprivacy"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+
<!-- Package Signature. -->
<TextView
android:layout_height="wrap_content"
android:textSize="18sp" />
</LinearLayout>
+ <!-- UltraPrivacy. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/domain_settings_ultraprivacy_imageview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_vertical"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_ultraprivacy_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/ultraprivacy"
+ android:textColor="?android:textColorPrimary"
+ android:textSize="18sp" />
+ </LinearLayout>
+
<!-- Block All Third Party Requests. -->
<LinearLayout
android:layout_height="wrap_content"
android:checkable="true"
app:showAsAction="never" />
+ <item
+ android:id="@+id/ultraprivacy"
+ android:title="@string/ultraprivacy"
+ android:orderInCategory="850"
+ android:checkable="true"
+ app:showAsAction="never" />
+
<item
android:id="@+id/block_all_third_party_requests"
android:title="@string/options_block_all_third_party_requests"
- android:orderInCategory="850"
+ android:orderInCategory="860"
android:checkable="true"
app:showAsAction="never" />
</menu>
<string name="fanboys_annoyance_list_summary">Block annoying popups and links. Includes Fanboy’s social blocking lists.</string>
<string name="fanboys_social_blocking_list">Fanboy’s social blocking list</string>
<string name="fanboys_social_blocking_list_summary">Blocks third-party social media content.</string>
+ <string name="ultraprivacy">UltraPrivacy</string>
+ <string name="ultraprivacy_summary">UltraPrivacy blocks trackers that EasyPrivacy doesn’t because doing so can break websites.</string>
<string name="block_all_third_party_requests">Block all third-party requests</string>
<string name="block_all_third_party_requests_summary">Blocking all third-party requests increases privacy, but it breaks many websites.</string>
<string name="tor">Tor</string>
<string name="easyprivacy_label">EasyPrivacy:</string>
<string name="fanboy_annoyance_label">Fanboy’s Annoyance List:</string>
<string name="fanboy_social_label">Fanboy’s Social Blocking List:</string>
+ <string name="ultraprivacy_label">UltraPrivacy:</string>
<string name="package_signature">Package Signature</string>
<string name="issuer_dn">Issuer DN:</string>
<string name="subject_dn">Subject DN:</string>
android:summary="@string/fanboys_social_blocking_list_summary"
android:defaultValue="true" />
+ <SwitchPreference
+ android:key="ultraprivacy"
+ android:title="@string/ultraprivacy"
+ android:summary="@string/ultraprivacy_summary"
+ android:defaultValue="true" />
+
<SwitchPreference
android:key="block_all_third_party_requests"
android:title="@string/block_all_third_party_requests"