ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.3k stars 267 forks source link

Universal ad-block patch #1417

Open SodaWithoutSparkles opened 1 year ago

SodaWithoutSparkles commented 1 year ago

Application

All apps with ads served from domains other than their content domains. Examples include:

Issue

There are many apps with ads. Some of them still works with ads domain blocked. Some of them tries to query the ad domain extensively after it was blocked. This patch should block the ad domain from queried, but does not need to handle the extensive loading issue.

Patch

Block ad domains like

All subdomains have to be blocked as well, like googleads.g.doubleclick.net

This patch could be called universal-domain-based-adblock or block-ad-domains or similar

Motivation

This could cover many apps with a single patch, just need a further patch if this patch makes the app load muchhhhhh longer or has other premium options to unlock.

Acknowledgements

SCPF-Bot commented 1 year ago

ReVanced/revanced-patches-template#1943

SodaWithoutSparkles commented 1 year ago

This attempts at blocking much more than google ads. Maybe also include a blocklist.

oSumAtrIX commented 1 year ago

Low level requests libraries can be hooked reflectively to achieve this via cold patching apps.

NoelJacob commented 1 year ago

Can dns blocking achieve this?

oSumAtrIX commented 1 year ago

No.

SodaWithoutSparkles commented 1 year ago

Can dns blocking achieve this?

In theory, yes. I got the inspiration from Pi-hole. But using only DNS blocking is very limited, so this method is not recommended

topminipie commented 11 months ago

I suggest a slightly different approach. Block ads using Android app activity/service blocking rather than blocking internet traffic (domains). As for me, this is a more universal way than removing links from the code. The signatures (Android Activity/Service) of many trackers are already known and there are clearly fewer of them than the domains of popular advertising networks. (https://etip.exodus-privacy.eu.org/trackers/all) One patch for all applications.

Example: Google AdMob: com.google.ads.|com.google.android.gms.ads|com.google.android.ads.|com.google.unity.ads.|com.google.android.gms.admob|com.google.firebase.firebase_ads.

Google Analytics: com.google.android.apps.analytics.|com.google.android.gms.analytics.|com.google.analytics.

Google CrashLytics: io.fabric.|com.crashlytics.|com.google.firebase.crashlytics|com.google.firebase.crash.|io.invertase.firebase.crashlytics.

Google Firebase Analytics: com.google.firebase.analytics.|com.google.android.gms.measurement.|com.google.firebase.firebase_analytics.

Google Tag Manager: com.google.tagmanager|com.google.android.gms.tagmanager.

Branch: io.branch.

etc...