Eyeo Adblock for Cromite: use cromite.org as the source of the default lists

Welcome screen: changed urls to better explain privacy policies (#466 #594)
This commit is contained in:
Carmelo Messina
2024-10-09 17:14:30 +02:00
parent 0ef3b49fd2
commit d3f961d080
5 changed files with 171 additions and 43 deletions
+23 -5
View File
@@ -42,7 +42,7 @@ deactivation of all pop-ups (default disabled)
.../java/res/layout/adblock_custom_item.xml | 14 +-
.../layout/adblock_filter_lists_list_item.xml | 15 +
...ences.xml => eyeo_adblock_preferences.xml} | 39 +-
.../components/adblock/AdblockController.java | 51 +-
.../components/adblock/AdblockController.java | 53 +-
.../AdblockAllowedDomainsFragment.java | 7 +-
.../AdblockCustomFilterListsFragment.java | 32 +-
.../AdblockCustomFiltersFragment.java | 7 +-
@@ -98,7 +98,7 @@ deactivation of all pop-ups (default disabled)
.../adblock/core/subscription/subscription.cc | 18 +
.../adblock/core/subscription/subscription.h | 3 +
.../subscription_collection_impl.cc | 1 +
.../core/subscription/subscription_config.cc | 24 +-
.../core/subscription/subscription_config.cc | 26 +-
.../core/subscription/subscription_config.h | 6 +-
.../subscription_downloader_impl.cc | 21 +-
.../subscription_persistent_metadata.h | 1 +
@@ -129,7 +129,7 @@ deactivation of all pop-ups (default disabled)
.../blink/renderer/core/css/style_engine.h | 1 +
.../renderer/core/exported/web_document.cc | 15 +-
.../definitions/adblock_private.d.ts | 14 +
119 files changed, 6723 insertions(+), 1309 deletions(-)
119 files changed, 6725 insertions(+), 1311 deletions(-)
create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.html
create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.ts
rename components/adblock/android/java/res/xml/{adblock_preferences.xml => eyeo_adblock_preferences.xml} (56%)
@@ -1105,7 +1105,7 @@ new file mode 100644
+ <div class="cr-secondary-text">
+ Snippets are pieces of JavaScript code, injected by the Adblock Plus, that execute within the context of a website and combat advanced ads that circumvent ordinary blocking.
+ The functionality is ONLY allowed for the list
+ <a href="https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt">abp-filters-anti-cv.txt</a>
+ <a href="https://www.cromite.org/filters/abp-filters-anti-cv.txt">abp-filters-anti-cv.txt</a>
+ which is activated by this setting.
+ <br><a href="https://gitlab.com/eyeo/anti-cv/abp-filters-anti-cv">Open ABP anti-circumvention filter list repo</a>
+ <br><a href="https://developers.eyeo.com/snippets/snippets-overview">Open ABP Snippets Overview</a>
@@ -1964,7 +1964,7 @@ diff --git a/components/adblock/android/adblock_strings.grd b/components/adblock
+ <message name="IDS_ADBLOCK_SETTINGS_PRIVILEGED_FILTERS_ENABLED_SUMMARY" desc="">
+ Snippets are pieces of JavaScript code, injected by the Adblock Plus, that execute within the context of a website and combat advanced ads that circumvent ordinary blocking.
+The functionality is ONLY allowed for the list
+https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt
+https://www.cromite.org/filters/abp-filters-anti-cv.txt
+which is activated by this setting.
+ </message>
+ <message name="IDS_ADBLOCK_SETTINGS_OPEN_REPO_URL_TEXT" desc="">
@@ -2146,6 +2146,15 @@ rename to components/adblock/android/java/res/xml/eyeo_adblock_preferences.xml
diff --git a/components/adblock/android/java/src/org/chromium/components/adblock/AdblockController.java b/components/adblock/android/java/src/org/chromium/components/adblock/AdblockController.java
--- a/components/adblock/android/java/src/org/chromium/components/adblock/AdblockController.java
+++ b/components/adblock/android/java/src/org/chromium/components/adblock/AdblockController.java
@@ -50,7 +50,7 @@ public final class AdblockController extends FilteringConfiguration {
super("adblock");
try {
mAcceptableAds =
- new URL("https://easylist-downloads.adblockplus.org/exceptionrules.txt");
+ new URL("about:blank");
} catch (java.net.MalformedURLException e) {
mAcceptableAds = null;
}
@@ -73,6 +73,10 @@ public final class AdblockController extends FilteringConfiguration {
private String mTitle;
private String mVersion = "";
@@ -4998,6 +5007,15 @@ diff --git a/components/adblock/core/subscription/subscription_collection_impl.c
diff --git a/components/adblock/core/subscription/subscription_config.cc b/components/adblock/core/subscription/subscription_config.cc
--- a/components/adblock/core/subscription/subscription_config.cc
+++ b/components/adblock/core/subscription/subscription_config.cc
@@ -24,7 +24,7 @@ namespace {
int g_port_for_testing = 0;
std::string GetHost() {
- GURL url("https://easylist-downloads.adblockplus.org");
+ GURL url("https://www.cromite.org/filters/");
if (!g_port_for_testing) {
return url.spec();
}
@@ -239,17 +239,23 @@ const std::vector<KnownSubscriptionInfo>& config::GetKnownSubscriptions() {
SubscriptionFirstRunBehavior::SubscribeIfLocaleMatch,
SubscriptionPrivilegedFilterStatus::Forbidden},
+37 -38
View File
@@ -20,11 +20,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../firstrun/ToSAndUMAFirstRunFragment.java | 335 +++++++++++++++++
.../firstrun/TosAndUmaFragmentView.java | 336 ++++++++++++++++++
.../browser/locale/LocaleManagerDelegate.java | 5 +-
.../strings/android_chrome_strings.grd | 24 +-
15 files changed, 911 insertions(+), 110 deletions(-)
.../Welcome-screen.grdp | 27 ++
15 files changed, 915 insertions(+), 109 deletions(-)
create mode 100644 chrome/android/java/res/layout/fre_tosanduma.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/firstrun/TosAndUmaFragmentView.java
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Welcome-screen.grdp
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
@@ -177,7 +178,7 @@ new file mode 100644
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="@string/fre_accept_continue"
+ android:text="@string/fre_continue"
+ android:animateLayoutChanges="true"
+ style="@style/FreAcceptTosButton" />
+
@@ -759,13 +760,13 @@ new file mode 100644
+ private void updateTosText() {
+ List<SpanInfo> spans = new LinkedList<SpanInfo>();
+
+ spans.add(buildPrivacyPolicyLink("1", R.string.adblock_wiki_url));
+ spans.add(buildPrivacyPolicyLink("1", R.string.privacy_link1));
+
+ spans.add(buildPrivacyPolicyLink("2", R.string.adblock_updater_privacy_policy_url));
+ spans.add(buildPrivacyPolicyLink("2", R.string.privacy_link2));
+
+ spans.add(buildPrivacyPolicyLink("3", R.string.auto_updates_wiki_url));
+ spans.add(buildPrivacyPolicyLink("3", R.string.privacy_link3));
+
+ spans.add(buildPrivacyPolicyLink("4", R.string.bromite_updater_privacy_policy_url));
+ spans.add(buildPrivacyPolicyLink("4", R.string.privacy_link4));
+
+ String tosString = getString(R.string.bromite_fre_footer_privacy_policy);
+
@@ -1251,38 +1252,36 @@ diff --git a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/L
}
/** @see LocaleManager#onUserSearchEngineChoice */
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -3634,7 +3634,29 @@ To change this setting, <ph name="BEGIN_LINK">BEGIN_LINK</ph>delete the Chrome d
<ph name="APP_NAME">%1$s<ex>Google Maps</ex></ph> will open in Chrome. By continuing, you agree to the <ph name="BEGIN_LINK1">&lt;LINK1&gt;</ph>Google Terms of Service<ph name="END_LINK1">&lt;/LINK1&gt;</ph>, and the <ph name="BEGIN_LINK2">&lt;LINK2&gt;</ph>Google Chrome and ChromeOS Additional Terms of Service<ph name="END_LINK2">&lt;/LINK2&gt;</ph>. The <ph name="BEGIN_LINK3">&lt;LINK3&gt;</ph>Privacy Policy<ph name="END_LINK3">&lt;/LINK3&gt;</ph> also applies.
</message>
<message name="IDS_FRE_ACCEPT_CONTINUE" desc="Text for first page accept and continue button [CHAR_LIMIT=20]">
- Accept &amp; continue
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Welcome-screen.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Welcome-screen.grdp
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Welcome-screen.grdp
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grit-part>
+ <message name="IDS_FRE_CONTINUE" desc="Text for first page accept and continue button [CHAR_LIMIT=20]">
+ Continue
+ </message>
+ <message name="IDS_ADBLOCK_UPDATER_PRIVACY_POLICY_URL" desc="URL for privacy policy for the ad block updater" translateable="false">
+ https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages
+ </message>
+ <message name="IDS_BROMITE_UPDATER_PRIVACY_POLICY_URL" desc="URL for privacy policy for the Bromite auto updater" translateable="false">
+ https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages
+ </message>
+ <message name="IDS_BROMITE_FRE_FOOTER_PRIVACY_POLICY" desc="Message explaining the privacy policy of the file hosting service provider for adblock updates and Bromite app automatic updates">
+ <ph name="BEGIN_PRIVACY_LINK1">&lt;PRIVACY_LINK1&gt;</ph>Automatic ad block filters updates<ph name="END_PRIVACY_LINK1">&lt;/PRIVACY_LINK1&gt;</ph> are subject to the <ph name="BEGIN_PRIVACY_LINK2">&lt;PRIVACY_LINK2&gt;</ph>GitHub Privacy statement<ph name="END_PRIVACY_LINK2">&lt;/PRIVACY_LINK2&gt;</ph>; they cannot be disabled.
+ The following checkbox controls instead <ph name="BEGIN_PRIVACY_LINK3">&lt;PRIVACY_LINK3&gt;</ph>automatic app updates<ph name="END_PRIVACY_LINK3">&lt;/PRIVACY_LINK3&gt;</ph> which are also subject to the <ph name="BEGIN_PRIVACY_LINK4">&lt;PRIVACY_LINK4&gt;</ph>GitHub Privacy statement<ph name="END_PRIVACY_LINK4">&lt;/PRIVACY_LINK4&gt;</ph>.
+ </message>
+ <message name="IDS_AUTO_UPDATER_CHECK" desc="Message for the checkbox for automatic Bromite updates">
+ </message>
+ <message name="IDS_AUTO_UPDATER_CHECK" desc="Message for the checkbox for automatic Bromite updates">
+ Automatic checks for Bromite app updates
+ </message>
+ <message name="IDS_UPDATER_PRIVACY_POLICY_URL" desc="URL for GitHub privacy statement" translateable="false">
+ </message>
+
+ <message name="IDS_BROMITE_FRE_FOOTER_PRIVACY_POLICY" desc="Message explaining the privacy policy of the file hosting service provider for adblock updates and Bromite app automatic updates">
+ <ph name="BEGIN_PRIVACY_LINK1">&lt;PRIVACY_LINK1&gt;</ph>Automatic ad block filters updates<ph name="END_PRIVACY_LINK1">&lt;/PRIVACY_LINK1&gt;</ph> are subject to the <ph name="BEGIN_PRIVACY_LINK2">&lt;PRIVACY_LINK2&gt;</ph>Cromite Privacy statement<ph name="END_PRIVACY_LINK2">&lt;/PRIVACY_LINK2&gt;</ph>.
+The following checkbox controls instead <ph name="BEGIN_PRIVACY_LINK3">&lt;PRIVACY_LINK3&gt;</ph>automatic app updates<ph name="END_PRIVACY_LINK3">&lt;/PRIVACY_LINK3&gt;</ph> which are subject to the <ph name="BEGIN_PRIVACY_LINK4">&lt;PRIVACY_LINK4&gt;</ph>GitHub Privacy statement<ph name="END_PRIVACY_LINK4">&lt;/PRIVACY_LINK4&gt;</ph>.
+ </message>
+
+ <message name="IDS_PRIVACY_LINK1" desc="URL for Bromite wiki page about ad blocking" translateable="false">
+ https://github.com/uazo/cromite/blob/master/docs/ADBLOCKING.md
+ </message>
+ <message name="IDS_PRIVACY_LINK2" desc="URL for privacy policy for the ad block updater" translateable="false">
+ https://github.com/uazo/cromite/blob/master/docs/PRIVACY_POLICY.md
+ </message>
+ <message name="IDS_PRIVACY_LINK3" desc="URL for Bromite wiki page about automatic updates" translateable="false">
+ https://github.com/uazo/cromite/blob/master/docs/AUTOMATIC_UPDATES.md
+ </message>
+ <message name="IDS_PRIVACY_LINK4" desc="URL for privacy policy for the Bromite auto updater" translateable="false">
+ https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages
+ </message>
+ <message name="IDS_ADBLOCK_WIKI_URL" desc="URL for Bromite wiki page about ad blocking" translateable="false">
+ https://github.com/uazo/cromite/wiki/AdBlocking
+ </message>
+ <message name="IDS_AUTO_UPDATES_WIKI_URL" desc="URL for Bromite wiki page about automatic updates" translateable="false">
+ https://github.com/uazo/cromite/wiki/AutomaticUpdates
</message>
<message name="IDS_FRE_WELCOME" desc="Text for greeting the user on Chrome First Run">
Welcome to Chrome
+ </message>
+</grit-part>
--
+40
View File
@@ -0,0 +1,40 @@
# Cromite AdBlock engine
## Modified version of Adblock plus integrated in cromite
Cromite uses a modified version of adblock plus.
Some adblock plus rules cannot be used:
- removed support for header and csp filter option
- removed support for json-override, simulate-event-poc, simulate-mouse-event snippets
- allowed the use of override-property-read by eliminating the possibility of specifying a number as an argument (except 0 and 1)
- removed support for sitekey
Some improvements have been included:
- Added dns CNAME support
- Block of WebSockets and WebTransport urls
- Block of service workers fetchs
All default filters are downloaded from www.cromite.org/filters urls. You can enter your lists via the settings: http url redirection is prohibited.
### Update mechanism
The Cromite AdBlock Update Service checks every day if new filters are published.
www.cromite.org does not record any logs.
## Legacy bromite adblock engine
Since v77 Bromite uses [Chromium subresource filter](https://github.com/chromium/chromium/tree/master/components/subresource_filter).
This engine does not currently support CSS rules; as a result some sites will show ads.
In cromite it is disabled by default.
### Update mechanism
The Bromite AdBlock Update Service checks at startup (after 5 seconds) and periodically (every week) if new filters are published.
### Original Bromite AdBlock engine
The ad-blocking engine of Bromite till v76 was an improved version of the original engine of [NoChromo](https://forum.xda-developers.com/android/apps-games/app-nochromo-w)
+8
View File
@@ -0,0 +1,8 @@
Cromite update notifications are enabled by default since version `94.0.4606.109`.
## How to enable or disable
You can enable or disable update notifications via Settings -> About Cromite.
When this setting is enabled the [Cromite GitHub releases](https://github.com/uazo/cromite/releases) will be checked every 3 days and user will be notified if a new update is available.
No cookies are used when interacting with the releases page, please refer to the [GitHub Privacy Statement](https://docs.github.com/en/github/site-policy/github-privacy-statement)
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
install_rclone() {
wget https://github.com/rclone/rclone/releases/download/v1.64.0/rclone-v1.64.0-linux-amd64.zip
unzip rclone-v1.64.0-linux-amd64.zip
rm rclone-v1.64.0-linux-amd64.zip
# mkdir -p ~/.config/rclone
# echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
}
test -d rclone-v1.64.0-linux-amd64 || install_rclone
export rclone=rclone-v1.64.0-linux-amd64/rclone
rm -rf filters || true
mkdir filters
while true
do
pushd filters
KO=0
curl -O https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/abpindo+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/abpvn+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/bulgarian_list+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/dandelion_sprouts_nordic_filters+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistczechslovak+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/israellist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistitaly+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistlithuania+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistpolish+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistportuguese+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easylistspanish+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/indianlist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/koreanlist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/latvianlist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/liste_ar+liste_fr+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/liste_fr+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/rolist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/i_dont_care_about_cookies.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/fanboy-notifications.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/easyprivacy.txt || KO=1
curl -O https://easylist-downloads.adblockplus.org/fanboy-social.txt || KO=1
NOW=$(date +"%Y-%m-%dT%H:%M:%S%z")
echo Last Update $NOW > LAST-UPDATE.txt
popd
$rclone sync filters ftp:www.cromite.org/filters --log-level INFO
$rclone sync filters ftp:www.cromite.org/filters --log-level INFO
echo "You can stop now"
sleep 1h
done