AppManager icon indicating copy to clipboard operation
AppManager copied to clipboard

[ADB] firewall

Open GreenMystic opened this issue 3 months ago • 8 comments

Please check before submitting an issue

  • [x] I am using the latest version of App Manager
  • [x] I have searched the issues and haven't found anything relevant
  • [x] I have read the docs

Describe a description of the new feature

firewalling by VPN is not a good solution for non rooted user because app can keep waking up and try connect to internet it will drain the battery root option exist but not all people are rooted

Describe the solution you'd like

add ADB mode to block network perm (yes it's possible)

Describe alternatives you've considered

i recently found this app (called netwall) https://play.google.com/store/apps/details?en=com.ysy.app.firewall

this app using ADB (Feat Shizuku) to disable network perm for app

Additional context

Netwall seems take advantage of net policy https://developer.android.com/reference/android/security/NetworkSecurityPolicy

surprisingly this method have advantage app won't able wake up and connect to internet the best part it's applicable on system app as well

GreenMystic avatar Sep 23 '25 13:09 GreenMystic

Feature already available: https://muntashirakon.github.io/AppManager/en/#sec:net-policy

shuvashish76 avatar Sep 25 '25 05:09 shuvashish76

Feature already available: https://muntashirakon.github.io/AppManager/en/#sec:net-policy

currently it needs root that's the problem and as you can see above there is non root method to do so i open this hopefully developer consider add ADB mode thought

GreenMystic avatar Sep 25 '25 12:09 GreenMystic

Clearly mentioned in both Readme and AppStore descriptions. 🤷‍♂️

shuvashish76 avatar Sep 26 '25 01:09 shuvashish76

It's not the same as net policy.

MuntashirAkon avatar Sep 27 '25 01:09 MuntashirAkon

They basically use cmd connectivity set-package-networking-enabled [true|false] [package-name] commands to control the firewall. Internally, it uses Berkeley Packet Filter (BPF) to control network connectivity per-UID basis. But the trouble is, this does NOT persist the changes, which means the configurations get reset after a reboot. A possible solution is to start App Manager on boot and reapply those configurations, but with ADB, this is unreliable since ADB itself may not start automatically after a reboot due to a lack of Wi-Fi.

This feature seems to have been added in Android 13 (Tiramisu): https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java;l=649;drc=969d82bc82db2ab4912ae9fdbb85066a6d403d3c

MuntashirAkon avatar Sep 27 '25 04:09 MuntashirAkon

They basically use cmd connectivity set-package-networking-enabled [true|false] [package-name] commands to control the firewall. Internally, it uses Berkeley Packet Filter (BPF) to control network connectivity per-UID basis. But the trouble is, this does NOT persist the changes, which means the configurations get reset after a reboot. A possible solution is to start App Manager on boot and reapply those configurations, but with ADB, this is unreliable since ADB itself may not start automatically after a reboot due to a lack of Wi-Fi.

This feature seems to have been added in Android 13 (Tiramisu): https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java;l=649;drc=969d82bc82db2ab4912ae9fdbb85066a6d403d3c

yes sir can you please consider add this to AM? 🙏😅

GreenMystic avatar Sep 27 '25 06:09 GreenMystic

can you please consider add this to AM?

As I mentioned above: the firewall won't work after a reboot, which is a major drawback.

MuntashirAkon avatar Sep 27 '25 06:09 MuntashirAkon

can you please consider add this to AM?

As I mentioned above: the firewall won't work after a reboot, which is a major drawback.

ikr that's unfortunate but yes it's up to you sir thanks for considering my feedback 🙏

GreenMystic avatar Sep 27 '25 06:09 GreenMystic

ShizuWall and de1984 can do that even after reboot(ShizuWall at least has this option)

kamik-hub avatar Dec 17 '25 18:12 kamik-hub

ShizuWall and de1984 can do that even after reboot(ShizuWall at least has this option)

yes but it's need root my question is tailored to people that doesn't have root (and cannot root their devices for some reason

but if mentioned app somehow able to achieve that without root (ADB) maybe dev can consider to take look and so on

GreenMystic avatar Dec 18 '25 12:12 GreenMystic

yes but it's need root my question is tailored to people that doesn't have root.

It doesn't. They can work with Shizuku only(ADB) and ADB is not a root

kamik-hub avatar Dec 18 '25 12:12 kamik-hub