celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
2.61k stars 132 forks source link

Firewall blocking for suspended apps #1481

Closed advait404 closed 3 weeks ago

advait404 commented 1 month ago

Hi, I am using the hail app for suspending many of my apps. However, I noticed that some of them are still using the network. I think having an option in the firewall that blocks any connection from a suspended app will be very helpful.

ignoramous commented 4 weeks ago

Is "Hail" open source? If not, is it known what it does to "suspend" apps?

I think having an option in the firewall that blocks any connection from a suspended app will be very helpful.

Don't think there's a way to find out what app is "suspended".

advait404 commented 4 weeks ago

yes, hail is open source.

based on its read me:

Suspend (Android 7.0+)

Suspended apps will have their icons shown in a grayscale in the device's launcher. Unsuspend them to revert the action.

While in this state, the application's notifications will be hidden, any of its started activities will be stopped and it will not be able to show toasts, dialogs or even play audio. When the user tries to launch a suspended app, the system will, instead, show a dialog to the user informing them that they cannot use this app while it is suspended.

I have also used app manager and noticed that it is able to mark suspended apps. I think there may be a property in android that lets us identify the suspended status, and can be used for the firewall filtering.

Screenshot_2024-05-31-06-15-15-25_718a221d6c53e9d44e23988b91117061

Both the apps are open source and available on fdroid. let me know if I can provide any more information.

ignoramous commented 4 weeks ago

Thanks. Will dig in to the code bases to know how to spot such apps.

advait404 commented 3 weeks ago

@ignoramous apparently the reason the apps were using the network was because the 'background data' setting was enabled. After turning it off their data usage is 0 if suspended. Kind of weird how suspending them does not stop this. Maybe the issue can be closed?

ignoramous commented 3 weeks ago

If I were to hazard a guess, these suspended apps may be using data via Google Play service (which may be fetching server-sent notifications, for example)... It is a guess.

But otherwise, it makes no sense for suspended apps to be capable of doing anything at all. May be, these get auto-unsuspended on reboot? You should consider reporting this to Muntashir (App Manager) and see what he has to say.