Have you noticed that some application on your smartphone Android suspiciously often uses mobile traffic or sends data to the network without your knowledge? It could be an ad SDK, a background tracker, or even malware that is leaking information about your activity. Fortunately, in Android there are several ways to completely block network access to specific apps - both standard means and using third-party tools.

In this article we will examine all current Internet blocking methods for applicationsincluding solutions without rights root, using ADB, as well as through specialized firewalls. You will learn how to restrict access to mobile data and Wi-Fi separately, why some apps bypass standard restrictions, and what to do if the application still โ€œbreaksโ€ into the network. The instructions are suitable for all versions Android from 8.0 Oreo to 15, including devices Samsung, Xiaomi, Google Pixel and others.

1. Standard Android settings: limiting background traffic

The easiest way to reduce application network activity is to use the built-in tools Android. They do not provide a 100% blocking guarantee (some apps can ignore restrictions), but are suitable for most legitimate applications that consume too much traffic.

To limit background Internet access:

  1. Open Settings โ†’ Applications (or Settings โ†’ Applications and notifications on some firmware).
  2. Select the desired application from the list.
  3. Go to the section Mobile traffic or Data usage.
  4. Activate the switch Limit background traffic (the name may vary: Background data, Allow background data transfer).

On some devices (for example, Samsung Galaxy with shell One UI) this option is hidden deeper:

  • ๐Ÿ“ฑ Settings โ†’ Connections โ†’ Data usage โ†’ Mobile data
  • ๐Ÿ” Find the application in the list and tap on it.
  • โš™๏ธ Turn on the option Allow background use data (paradoxically, turning off this switch prohibits background traffic).
๐Ÿ’ก

On devices Xiaomi (MIUI) a similar function is called โ€œAutostart and background activityโ€. Disable both options to completely block background traffic.

โš ๏ธ Attention: This method does not completely block the Internet. The application will still be able to access the network when it is active. (opened on the screen) In addition, some apps (for example, instant messengers or cloud services) can bypass this restriction through WorkManager or Foreground Service.

2. Complete blocking of the Internet through โ€œSpecial accessโ€ (Android 9+)

Starting since Android 9 Pie, the system has introduced a mechanism Special network access (or Unlimited access to data), which allows the completely prohibit application to use mobile traffic and Wi-Fi. This method is more reliable than simply limiting background traffic, but does not work on all firmware.

Instructions:

  1. Open Settings โ†’ Network and Internet โ†’ Mobile network โ†’ Special access (or Settings โ†’ Connections โ†’ Data usage โ†’ Special access on Samsung).
  2. Select Unlimited access to data.
  3. Find in the list the application that you want to block the Internet, and disable the switch next to it.
  4. Repeat the steps for the section Wi-Fiif you need to block wireless network.

On some devices (for example, OnePlus or Realme), this section may be called Applications with network access or Managing application data. If you donโ€™t find the option, use the search in the settings (magnifying glass icon at the top). screen).

What to do if there is no โ€œSpecial accessโ€ section?

On some firmware (for example, on older versions MIUI or ColorOS) this section may be missing. In this case, try alternative methods from the following sections of the article, for example, through ADB or firewall.

Firmware Path to settings Notes
Stock Android (Pixel, Motorola) Settings โ†’ Network and Internet โ†’ Mobile network โ†’ Special access Works on Android 9+
One UI (Samsung) Settings โ†’ Connections โ†’ Data usage โ†’ Special access Called โ€œUnlimited access to dataโ€
MIUI (Xiaomi/Redmi/Poco) Settings โ†’ SIM cards and mobile networks โ†’ Traffic usage โ†’ Special access May not be available on older versions
ColorOS (Oppo/Realme) Settings โ†’ Connection and sharing โ†’ Managing application data The function can be hidden

3. Blocking the Internet via ADB (without root)

If standard methods do not work, you can use ADB (Android Debug Bridge) - a debugging tool that allows you to change system settings without rights. superuser. This method is suitable for any versions of Android and does not require installation of additional apps.

What you will need:

  • ๐Ÿ–ฅ๏ธ Computer with installed drivers ADB (download you can from the official Android website).
  • ๐Ÿ“ฑ Enabled USB debugging on your smartphone (Settings โ†’ About phone โ†’ Number assembly โ€” tap 7 times, then return to Settings โ†’ System โ†’ For developers โ†’ USB debugging).
  • ๐Ÿ”Œ USB cable for connecting the phone to the PC.

Instructions:

  1. Connect the phone to the computer and confirm permission for debugging on the smartphone screen.
  2. Open the command line (cmd on Windows or Terminal on macOS/Linux) and enter:
adb shell
  1. Find out UID applications (unique identifier for this). run:
pm list packages -U | grep "package_name"

For example, for Facebook:

pm list packages -U | grep "facebook"
  1. Deny Internet access for this UID:
cmd appops set <UID> android:request_network RESTRICTED

cmd appops set <UID> android:connectivity_internal RESTRICTED

Example for Facebook (UID can differ):

cmd appops set 10153 android:request_network RESTRICTED

cmd appops set 10153 android:connectivity_internal RESTRICTED

To regain access, replace RESTRICTED to ALLOWED.

๐Ÿ”น Is the phone connected to the PC via USB?

๐Ÿ”น Is USB debugging enabled in the developer settings?

๐Ÿ”น Are ADB drivers installed on the computer?

๐Ÿ”น Is the UID of the application entered correctly?

-->

โš ๏ธ Attention: After rebooting the phone or updating the application, the lock through ADB may be reset. To make it permanent, use a script to automatically apply commands at startup. systems (for example, through Tasker or MacroDroid).

4. Using a firewall (with or without root)

The most reliable way to control network activity is specialized firewalls. They allow you to flexibly configure access rules for each application and block individual domains or IP addresses, as well as keep a log of network activity. Consider two options: with and without rights. root and without them.

4.1. Firewall without root: NetGuard or Mobiwol

Applications like NetGuard or Mobiwol work through a local VPN, intercepting and filtering traffic. They do not require superuser rights, but have limitations:

  • ๐Ÿ›ก๏ธ They cannot block system applications (for example, Google Play Services).
  • ๐Ÿ”„ They may conflict with other VPN clients.
  • ๐Ÿ“ก Does not block traffic if the VPN is disabled.

How to set up NetGuard:

  1. Install NetGuard from Google Play or F-Droid.
  2. When you first start, allow the creation of a VPN connection.
  3. In the main window, find the application that you want to block the Internet, and uncheck the boxes in the columns Wi-Fi and Mobile data.
  4. Activate the switch at the top of the screen to enable protection.

4.2. Firewall with root: AFWall+

If your device has root, the best choice would be AFWall+ (Android Firewall). This application works at the kernel level and blocks traffic everyone apps, including system ones. Advantages:

  • ๐Ÿ”ง Full control over network activity.
  • ๐Ÿ“Š Detailed traffic logs.
  • ๐Ÿ”„ Rules are applied immediately after the system boots.

Setting instructions AFWall+:

  1. Install AFWall+ from F-Droid (version from Google Play is outdated).
  2. Provide root-access upon request.
  3. In the main window, select a profile Custom Rules.
  4. Find the application in the list and uncheck the boxes s Wi-Fi and 3G/4G/5G.
  5. Press the button Apply (apply) in the top menu.

NetGuard (without root)|AFWall+ (with root)|Mobiwol|Other|I donโ€™t use a firewall-->

โš ๏ธ Attention: Some applications (for example, banking or instant messengers) may stop working work correctly after the Internet is blocked. Before setting up the firewall, check whether the app uses network functions for its main work (for example, synchronizing in Google Drive or sending messages to Telegram).

5. Blocking via a router (for Wi-Fi)

If you need to block Internet access not only on phone, but also on other devices (or if the application bypasses all local restrictions), you can configure blocking at the router level. This method only works for Wi-Fi networks and requires access to the router's admin panel.

How to block an application through a router:

  1. Find out the local IP address of your phone on the Wi-Fi network (can be found in Settings โ†’ Wi-Fi โ†’ [your network] โ†’ IP address).
  2. Open the router control panel (usually at 192.168.1.1 or 192.168.0.1).
  3. Find the section Parental Control, Firewall or MAC/IP Filtering.
  4. Add a blocking rule for the phone's IP address or specific domains/ports that the application uses.

Example for routers TP-Link:

  • ๐ŸŒ Go to Advanced settings โ†’ Network tools โ†’ Parental controls.
  • ๐Ÿ“ฑ Add a device by MAC address or IP.
  • โฐ Set a blocking schedule (for example, around the clock).
  • ๐Ÿ”’ Save the settings and reboot the router.

โš ๏ธ Attention: Blocking at the router level affects all devicesconnected to this network. If you deny access via the phone's IP, other gadgets (tablets, laptops) will not be affected, but the smartphone itself will lose access to all network resources, and not just one application.

6. Alternative methods: disabling INTERNET permission

Some applications can be denied access to the Internet by removing their permission android.permission.INTERNETThis can be done in two ways:

6.1. Through ADB (for custom applications)

Run. command:

adb shell pm revoke <package_name> android.permission.INTERNET

Example for Facebook:

adb shell pm revoke com.facebook.katana android.permission.INTERNET

6.2. Through the AppOps application (requires root)

Install AppOps from F-Droid, find the application in the list and disable permission INTERNET.

โš ๏ธ Attention: Removing permission INTERNET can lead to crash. applications at startup if it is critically network dependent. This method is only suitable for apps that can run offline (for example, some games or editors).

7. Checking the effectiveness of blocking

After using any of the methods, it is important to make sure that the application has really lost access to the Internet. Here is how to check this:

  • ๐Ÿ“ก Use the built-in traffic monitor: Settings โ†’ Network and Internet โ†’ Data usage โ€”see if the counter for the blocked one is growing. applications.
  • ๐Ÿ” Install a traffic analyzer, for example Network Monitor Mini or GlassWireto track network activity in real time.
  • ๐ŸŒ Try using application functions that require the Internet (for example, updating content). If the blocking works, you will see errors like โ€œNo connectionโ€ or โ€œCheck the Internet.โ€

If the application still goes online:

  • ๐Ÿ”„ Restart your phone - some restrictions only apply after reboot.
  • ๐Ÿ› ๏ธ Check if the application has been updated (updating may reset settings).
  • ๐Ÿ” Make sure you are not using a VPN or proxy that can bypass local restrictions.

1. Firewall with root (AFWall+) - blocks everything, including system ones. processes.

2. ADB-commands - work without root, but can be reset after a reboot.

3. Standard Android settings (if supported by firmware).

-->

FAQ: Frequently asked questions

Is it possible to block the Internet for system applications (for example, Google Play Services)?

Without rights root this is difficult to do. System applications often ignore standard Android restrictions. If you have root, use AFWall+ or AppOpsWithout root, try ADB-method, but it may not work for critical services.

โš ๏ธ Blocking Google Play Services can disrupt the operation of many phone functions, including Push notifications and application updates.

Why does the application still go online after blocking?

Possible reasons:

  • The application uses another UID (for example, after an update).
  • It connects through VPN or proxywhich bypasses local restrictions.
  • The device is running another firewallthat conflicts with your rules.
  • Firmware resets settings after reboot (relevant for ADBmethod).

Solution: check the traffic logs via NetGuard or PCAPdroidto identify the "loophole".

How to block the Internet for all applications except selected ones?

This can be achieved using a firewall:

  1. B NetGuard or AFWall+ block everything default.
  2. Then manually allow access only necessary apps (messengers, browser, etc.).

In AFWall+ this is done through the profile White List, in NetGuard by disabling ticks for all applications except allowed ones.

Will the lock work after resetting the phone to factory settings?

No, all settings (including ADB-commands and firewall rules) will be reset after resetting the lock. If you reset your phone often, use. scripts for automatically applying commands ADB or save the firewall configuration to a backup.

Is it possible to block the Internet for an application forever, even after updating it?

Yes, but this requires additional measures:

  • For ADBmethod: create a task in Tasker or MacroDroidthat will automatically apply commands after a reboot.
  • For the firewall: in AFWall+ enable the option Apply on Boot (apply when loading).
  • Disable automatic updating for this application in Google Play.