The Common Question
A lot of posts on this forum ask:
“Can you modify this app to remove a specific feature?”
While it might seem like a good approach, it’s actually a bad idea (and I have no patience for downloading and uploading your APKs just to edit them).
The Problem with Modding Apps
Apps need updates—simple as that. When you modify an app, you’re creating a short-term solution that lasts only until the next update. Then, you’re back to square one.
Why Modding Isn’t the Right Approach:
- No Source Code Access – We have to work with
smali
, which is tedious and unreliable. - High Risk of Bugs – Modding can break key functions, making the app unstable.
- Forced Updates – Many online apps, like Telegram, require updates, making modded versions unusable.
For offline apps, modding sometimes works. But for online apps, being stuck on an outdated version is annoying and impractical.
The Better Solution: Block Network Requests
Instead of modifying the app, a more effective method is blocking specific network requests—this is exactly how MDM solutions and custom ROMs (like mine) handle it.
How to Find the URLs to Block
Before modifying the hosts file, you need to know which URLs the app is using.
- Use HttpCanary (requires root for HTTPS apps) to monitor network requests.
- Open the app you want to modify and start capturing traffic.
- Identify the URLs related to the feature you want to block (e.g., ads, updates, status, tracking).
Once you have the URLs, add them to your hosts file.
Method 1: Editing the Hosts File (Easy & Recommended)
The hosts file is a simple way to block specific domains at the system level.
Steps to Modify the Hosts File:
-
Locate the Hosts File
- Path:
/system/etc/hosts
- Root access is required.
- Path:
-
Use a Text Editor
- Open the file with a root-supported text editor (MT Manager, Solid Explorer, or ES File Explorer).
-
Add the URLs You Want to Block
- Use this format:
127.0.0.1 example.com 127.0.0.1 sub.example.com
- This redirects the domain to your own device, effectively blocking it.
- Use this format:
-
Save & Reboot
- After editing, save the file and reboot your device for changes to take effect.
Examples of Blocking Specific Features
1. Blocking WhatsApp Status & Channels
To disable WhatsApp’s Status and Channels, add these lines to your hosts
file:
127.0.0.1 static.whatsapp.net
127.0.0.1 mmg.whatsapp.net
127.0.0.1 web.whatsapp.com
This prevents WhatsApp from loading those features while keeping chat functionality intact.
2. Blocking Telegram Forced Updates
Telegram requires updates by blocking older versions. To stop this, add:
127.0.0.1 updates.tdesktop.com
127.0.0.1 api.telegram.org
Note: Blocking api.telegram.org
will also block all Telegram functionality, so use this carefully!
3. Blocking Ads & Trackers in Apps
You can also use the hosts
file to block ads and tracking services by adding:
127.0.0.1 ads.google.com
127.0.0.1 analytics.facebook.com
This method works similarly to ad-blocking apps but is built into the system.
Method 2: Using Iptables (For Advanced Users)
If you need more control over network requests, you can use iptables (requires root):
- Install a terminal app like Termux.
- Run this command to block a domain:
iptables -A OUTPUT -d example.com -j DROP
- To make the rule permanent, use a startup script or firewall app like AFWall+.
Final Thoughts
Blocking URLs at the system level is safer, easier, and update-friendly compared to modifying an app directly. It ensures that unwanted features stay disabled even after updates without causing crashes or instability.
So please, if you have root, stop asking for APK modifications. Just block the URLs yourself—it’s faster, easier, and won’t break after every update.
Hope this helps! Let me know if you have any questions or need help finding specific URLs to block.