diff --git a/build/patches/Eyeo-Adblock-for-Cromite.patch b/build/patches/Eyeo-Adblock-for-Cromite.patch index a4cec610..a1c37cb3 100644 --- a/build/patches/Eyeo-Adblock-for-Cromite.patch +++ b/build/patches/Eyeo-Adblock-for-Cromite.patch @@ -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 +
+ 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 -+ abp-filters-anti-cv.txt ++ abp-filters-anti-cv.txt + which is activated by this setting. +
Open ABP anti-circumvention filter list repo +
Open ABP Snippets Overview @@ -1964,7 +1964,7 @@ diff --git a/components/adblock/android/adblock_strings.grd b/components/adblock + + 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. + + @@ -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& config::GetKnownSubscriptions() { SubscriptionFirstRunBehavior::SubscribeIfLocaleMatch, SubscriptionPrivilegedFilterStatus::Forbidden}, diff --git a/build/patches/Welcome-screen.patch b/build/patches/Welcome-screen.patch index 7a187ca7..9f3502a0 100644 --- a/build/patches/Welcome-screen.patch +++ b/build/patches/Welcome-screen.patch @@ -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 spans = new LinkedList(); + -+ 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, BEGIN_LINKdelete the Chrome d - %1$sGoogle Maps will open in Chrome. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Google Chrome and ChromeOS Additional Terms of Service</LINK2>. The <LINK3>Privacy Policy</LINK3> also applies. - - -- Accept & 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 @@ ++ ++ ++ + Continue -+ -+ -+ https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages -+ -+ -+ https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages -+ -+ -+ <PRIVACY_LINK1>Automatic ad block filters updates</PRIVACY_LINK1> are subject to the <PRIVACY_LINK2>GitHub Privacy statement</PRIVACY_LINK2>; they cannot be disabled. -+ The following checkbox controls instead <PRIVACY_LINK3>automatic app updates</PRIVACY_LINK3> which are also subject to the <PRIVACY_LINK4>GitHub Privacy statement</PRIVACY_LINK4>. -+ -+ ++ ++ + Automatic checks for Bromite app updates -+ -+ ++ ++ ++ ++ <PRIVACY_LINK1>Automatic ad block filters updates</PRIVACY_LINK1> are subject to the <PRIVACY_LINK2>Cromite Privacy statement</PRIVACY_LINK2>. ++The following checkbox controls instead <PRIVACY_LINK3>automatic app updates</PRIVACY_LINK3> which are subject to the <PRIVACY_LINK4>GitHub Privacy statement</PRIVACY_LINK4>. ++ ++ ++ ++ https://github.com/uazo/cromite/blob/master/docs/ADBLOCKING.md ++ ++ ++ https://github.com/uazo/cromite/blob/master/docs/PRIVACY_POLICY.md ++ ++ ++ https://github.com/uazo/cromite/blob/master/docs/AUTOMATIC_UPDATES.md ++ ++ + https://docs.github.com/en/github/site-policy/github-privacy-statement#github-pages -+ -+ -+ https://github.com/uazo/cromite/wiki/AdBlocking -+ -+ -+ https://github.com/uazo/cromite/wiki/AutomaticUpdates - - - Welcome to Chrome ++ ++ -- diff --git a/docs/ADBLOCKING.md b/docs/ADBLOCKING.md new file mode 100644 index 00000000..26e1650c --- /dev/null +++ b/docs/ADBLOCKING.md @@ -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) + diff --git a/docs/AUTOMATIC_UPDATES.md b/docs/AUTOMATIC_UPDATES.md new file mode 100644 index 00000000..d1b2e138 --- /dev/null +++ b/docs/AUTOMATIC_UPDATES.md @@ -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) diff --git a/tools/images/update-cromite-org/update.sh b/tools/images/update-cromite-org/update.sh new file mode 100644 index 00000000..6175da0f --- /dev/null +++ b/tools/images/update-cromite-org/update.sh @@ -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 \ No newline at end of file