Top Related Projects
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
A black hole for Internet advertisements
Curated and well-maintained hostfile to block ads, tracking, cryptomining, and more! Updated regularly. ⚡🔒
YouTube script to add the new Ads list for Pi-hole
Quick Overview
AdAway is an open-source ad blocker for Android devices that uses the hosts file to block ads. It works by redirecting ad server hostnames to a non-routable IP address, effectively preventing ads from loading. AdAway requires root access to function properly.
Pros
- Blocks ads system-wide, not just in browsers
- Customizable with user-defined blacklists and whitelists
- Lightweight and efficient, with minimal impact on device performance
- Regular updates to block new ad servers
Cons
- Requires root access, which may void device warranty
- Can potentially break some apps or websites that rely on ads
- Manual updates needed to keep ad blocking lists current
- May not block all types of ads, especially those served from the same domain as content
Getting Started
- Root your Android device (if not already rooted)
- Download AdAway from the official GitHub releases page or F-Droid
- Install the APK on your rooted Android device
- Open AdAway and grant root permissions when prompted
- Tap on "Download files and apply ad blocking"
- Reboot your device to ensure changes take effect
Note: AdAway is not available on the Google Play Store due to policy restrictions on ad blockers.
Competitor Comparisons
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
Pros of hosts
- More comprehensive blocklist with multiple curated sources
- Platform-agnostic, can be used on various operating systems
- Regular updates and active community contributions
Cons of hosts
- Requires manual installation and updating on devices
- May block legitimate domains, requiring more user intervention
- Less user-friendly for non-technical users
Code comparison
hosts:
0.0.0.0 example.com
0.0.0.0 ads.example.com
AdAway:
<item>example.com</item>
<item>ads.example.com</item>
Key differences
- Implementation: hosts uses a simple hosts file format, while AdAway uses XML for its blocklist.
- Target platform: hosts is platform-agnostic, whereas AdAway is specifically designed for Android devices.
- User interface: AdAway provides a graphical interface for managing blocked domains, while hosts requires manual editing of the hosts file.
- Customization: hosts offers various pre-configured lists, allowing users to choose their preferred level of blocking, while AdAway focuses on a single, curated list.
- Update mechanism: AdAway can automatically update its blocklist within the app, whereas hosts requires manual updates or script automation.
Both projects aim to block unwanted domains, but they cater to different user needs and technical expertise levels. hosts is more versatile but requires more manual intervention, while AdAway offers a more streamlined experience for Android users.
A black hole for Internet advertisements
Pros of Pi-hole
- Network-wide ad blocking for all devices
- Detailed statistics and monitoring capabilities
- Can be run on a dedicated device (e.g., Raspberry Pi)
Cons of Pi-hole
- Requires separate hardware or virtual machine setup
- More complex initial configuration compared to AdAway
Code Comparison
AdAway (Java):
private void applyHostsFile() {
CommandCapture command = new CommandCapture(0, "su", "-c", "mount -o rw,remount /system");
try {
RootTools.getShell(true).add(command).waitForFinish();
} catch (Exception e) {
Log.e(Constants.TAG, "Failed to remount /system read-write", e);
}
}
Pi-hole (Shell script):
gravity_SwapSpaces() {
local str="Swapping spaces in gravity domains"
printf "%s..." "$str"
sed -i 's/[[:blank:]]/\t/g' "${gravityDBfile}"
printf "%s\\n" "${OVER} ${TICK} ${str}"
}
Both projects aim to block ads, but Pi-hole operates at the network level, while AdAway modifies the hosts file on Android devices. Pi-hole offers more comprehensive blocking and monitoring features, but requires a dedicated setup. AdAway is simpler to install and use on individual Android devices but lacks network-wide protection.
Pros of GoodbyeAds
- Larger blocklist with more comprehensive coverage of ads and trackers
- Regular updates to the blocklist, often daily
- Includes specialized lists for specific platforms (e.g., Samsung, Xiaomi)
Cons of GoodbyeAds
- May be more aggressive, potentially blocking some non-ad content
- Less user-friendly interface compared to AdAway's Android app
- Requires manual installation and updating of hosts files
Code Comparison
AdAway uses a local VPN to block ads, while GoodbyeAds primarily relies on hosts file modification. Here's a simplified example of how each might block a domain:
AdAway (Java):
if (isBlockedDomain(request.getHost())) {
return new DnsResponse(DnsResponse.TYPE_NXDOMAIN);
}
GoodbyeAds (hosts file):
0.0.0.0 ads.example.com
0.0.0.0 tracker.example.com
Both projects aim to block ads and trackers, but they use different approaches. AdAway offers a more integrated solution for Android users, while GoodbyeAds provides a broader, more frequently updated blocklist that can be used across various platforms and devices.
Curated and well-maintained hostfile to block ads, tracking, cryptomining, and more! Updated regularly. ⚡🔒
Pros of blacklist
- Offers a more extensive list of domains to block, including social media trackers and adult content
- Provides separate lists for different purposes (e.g., Facebook, porn, fake news), allowing for more granular control
- Regularly updated with community contributions
Cons of blacklist
- Requires manual implementation and doesn't provide a user-friendly app interface
- May cause over-blocking and require more user intervention to whitelist desired domains
- Lacks built-in tools for managing hosts files or system-wide ad blocking
Code comparison
AdAway:
public class AdAway extends Activity {
private static final int MENU_HOSTS = Menu.FIRST;
private static final int MENU_REDIRECTION = Menu.FIRST + 1;
private static final int MENU_PREFERENCES = Menu.FIRST + 2;
}
blacklist:
0.0.0.0 graph.facebook.com
0.0.0.0 ads.facebook.com
0.0.0.0 an.facebook.com
0.0.0.0 pixel.facebook.com
Note: The code comparison is limited as blacklist primarily consists of domain lists rather than application code.
YouTube script to add the new Ads list for Pi-hole
Pros of youTube_ads_4_pi-hole
- Specifically targets YouTube ads, providing a more focused solution
- Designed for use with Pi-hole, a popular network-wide ad blocker
- Regularly updated to keep up with YouTube's ad-serving methods
Cons of youTube_ads_4_pi-hole
- Limited to blocking YouTube ads only, unlike AdAway's broader approach
- Requires Pi-hole setup, which may be more complex for some users
- May not work as effectively on mobile devices or outside the home network
Code Comparison
AdAway (Java):
public class AdAway extends Activity {
private static final int MENU_HOSTS = Menu.FIRST;
private static final int MENU_REDIRECTION_LIST = Menu.FIRST + 1;
private static final int MENU_TCPDUMP = Menu.FIRST + 2;
}
youTube_ads_4_pi-hole (Python):
def get_youtube_domains():
domains = []
for i in range(0, len(lines)):
if "googlevideo.com" in lines[i]:
domain = lines[i].split()[2]
domains.append(domain)
return domains
The code snippets show that AdAway is written in Java and has a more complex structure, while youTube_ads_4_pi-hole uses Python and focuses on extracting YouTube-specific domains. This reflects their different scopes and approaches to ad blocking.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
AdAway
AdAway is an open source ad blocker for Android using the hosts file and local vpn.
For more information visit https://adaway.org
Installing
There are two kinds of release:
- The preview builds: on the bleeding edge of development - for testers or adventurous
- The stable builds: ready for every day usage - for end users
Preview builds
Requirements: Android 8 Oreo or above
For users with bugs, there may be preview builds available from the XDA development thread and AdAway official website. It is recommended to try those builds to see if your issue is resolved before creating an issue. The preview builds may contain bug fixes or new features for new android versions.
Stable builds
Requirements:
- Android Android 8 Oreo or above
After preview builds have been tested by the more technical or responsive community within the forums, we will then post the stable build to F-Droid.
For devices older than Android 8 Oreo, use the version 4 of AdAway.
Get Host File Sources
See the Wiki, in particular the page HostsSources for an assorted list of sources you can use in AdAway. Add the ones you like to the AdAway "Hosts sources" section.
Getting Help
You can post Issues here or obtain more detailed community support via the XDA developer thread.
Contributing
You want to be involved in the project? Welcome onboard!
Check the contributing guide to learn how to report bugs, suggest features and make you first code contribution :+1:
If you are looking for translating the application in your language, the translating guide is for you.
Project Status
AdAway is actively developed by:
- Bruce Bujon (@PerfectSlayer) - Developer
PayPal | GitHub Sponsorship - Daniel Mönch (@Vankog) - Translations
- Jawz101 (@jawz101) - Hosts list
- Anxhelo Lushka (@AnXh3L0) - Web site
We do not forget the past maintainers:
- DÄvis MoÅ¡enkovs (@DavisNT) - Developer
Paypal - @0-kaladin - Developer and XDA OP
- Sanjay Govind (@sanjay900) - Developer
And we thank a lot to the original author:
- Dominik Schürmann (@dschuermann) - Original developer
Paypal | Flattr | BTC:173kZxbkKuvnF5fa5b7t21kqU5XfEvvwTs
Permissions
AdAway requires the following permissions:
INTERNET
to download hosts files and application updates. It can send bug reports and telemetry if the user wants to (opt-in only)ACCESS_NETWORK_STATE
to restart VPN on network connection changeRECEIVE_BOOT_COMPLETED
to start the VPN on bootFOREGROUND_SERVICE
to run the VPN service in foregroundPOST_NOTIFICATIONS
to post notifications about hosts source update, application update and VPN controls. All notifications can be enabled or disabled independently.REQUEST_INSTALL_PACKAGES
to update the application using the builtin updaterQUERY_ALL_PACKAGES
to let the user pick the applications to exclude from VPN
Licenses
AdAway is licensed under the GPLv3+.
The file LICENSE includes the full license text.
For more details, check the license notes.
Top Related Projects
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
A black hole for Internet advertisements
Curated and well-maintained hostfile to block ads, tracking, cryptomining, and more! Updated regularly. ⚡🔒
YouTube script to add the new Ads list for Pi-hole
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot