StarGW-net / karma-firewall

Apache License 2.0
113 stars 12 forks source link

Closing the application disconnects the firewall #9

Open Byraan opened 1 year ago

Byraan commented 1 year ago

When you remove the recent app, the VPN service is disconnected, and you have to reopen the app to reactivate the firewall

I have seen that other apps do not close because they have a persistent notification that prevents accidental closing or force closing the system.

StarGW-net commented 1 year ago

I do not see this behaviour on my test phones A40 and A54. When the app is closed the VPN continues to run as a background task.

Byraan commented 1 year ago

The device I have is Xiaomi Poco F5. I already tried several ways removing background restrictions and battery saving ways but it always closes

Gabr-F commented 1 year ago

I confirm that on many, many phones (probably all the chinese ones and maybe even the Samsungs now) the only way to have a chance of an app not getting killed, or actually to at least get it relaunched when it gets killed, is to set a persistent notification (this might be harder to notice on phones with a lot of ram).

Quantum-Future commented 1 week ago

I also have the same problem with Version 59 on a Xiaomi Mi 9 Lite with Android 9, but the problem only happens after a reboot or an upgrade of app. If you close the app from the list of recent used apps, the icon of VPN at top of screen disappears and the firewall is deactivated. I have to open the app and re-enable it.

But if I use the phone several hours (maybe a day) after a reboot, this no longer happens: I can open and close the app without the firewall being deactivated. It's strange.

Update: With Version 64 the problem persists any number of hours: if I close the app, the firewall is deactivated. But I found a workaround: starting the app from the tile in quick setting panel instead of using the app's icon. This way a persistent notification is shown (Non-GUI FW Start/Stop Alert), and then I can close the app without the VPN/FW being terminated. Afterwards, I can even hide/deactivate the notification without afecting the FW sevice (it remains functional).

So I guess the problem can be solved by showing a persistent notification when de FW is started from the icon, and not only when started from the tile.