Are there any adb commands to block specific apps from accessing mobile data/wifi or in general network acesss?

Achyu@lemmy.sdf.org to Android@lemmy.world – 21 points –

The system launcher on my phone has a data usage that is non-zero. I've already disabled background data for it.

I use Lawnchair2, but haven't tried to disable/uninstall the system launcher because I've read somewhere that it affects gesture navigation(Is it actually so?)

I know that apps like Netguard can help, but is there a more direct solution, other than rooting?

Are there any other adb commands that are useful, hopefully that are not too dangerous?

I've recently found
adb shell pm trim-caches 99999M
Clears all/most app cache, without having to install some cache clear or use Gfiles. I don't really use it often.


Along with this, does anyone know way to troubleshoot gmail not being able to download attachments on mobile data? I've not disabled background data for that.
Or should I make a separate post on it. Or would it be too tech-supporty?

12

If you disable the system launcher, you're gonna have a Bad Time.

Yes, it's responsible for the App Switcher, and some other stuff (I forget what - I once disabled it years ago, probably on Nougat. It was an interesting experiment that I never repeated).

NoRoot Firewall can block network access by being a VPN.

No, if you have another launcher installed with quickswitch support (like Lawnchair). Then you will be fine.

Note: QuickSwitch requires root. It's for gestures and navigation support.

No rootless or adb ways?

Any ways to restrict the system launcher then?

Just remove as much permissions as possible. If you want more control rooting is still "the choice". BTW Banking apps can work with root if that's the concern.

If you don't want root. Use a custom ROM like graphene(if your device is supported) or voltageos(if your device is not supported by graphene)

Ooh, didn't realize Lawnchair had Quickswitch, nice!

I have Netguard on my phone.
Asked to see if there were any direct solutions.

  • You can't revoke android.permission.INTERNET at runtime. You can only revoke at install time. Since you don't have root you can't revoke that permission.
  • Did you check settings? There is an option to remove background data access from an app.

I did disable the background data, but it still seems to use it
Probably because it comes to the foreground when I use gestures.

Netgaurd does not require root.

It can run as a VPN, to funel and block unwanted WiFi or data usage from apps. Lots of settings and options per app to block WiFi and/or data. You can also set it so an app will allowed only if the screen is on (good for weather, lemmy or email updates)

As for gmail, it sounds like that would be setting within gmail, however I just briefly looked and did not see it. Personally I switched to K-9 email, it works great for me. I wonder if gmail follows the system data saver or something stupid (If you happen to have that on)?

The best way to achieve this is by creating an account on NextDNS, then setting your phone to use the NextDNS DNS. On the web dashboard, look at the logs and blacklist anything from Google, Google Play, or anything else you don't want. This not only works but also gives you more control over everything your phone is doing in the background, regardless of whether you're using Wi-Fi or a mobile network.

How secure/private is NextDNS?

It suffices for me if you don't enable logs; there are no logs... and if you enable them, you can choose the country where the logs are saved and for how long.