emanuele-f / PCAPdroid

No-root network monitor, firewall and PCAP dumper for Android
https://emanuele-f.github.io/PCAPdroid
GNU General Public License v3.0
2.08k stars 260 forks source link

Unblock for 10 Min #390

Closed smexyy closed 4 months ago

smexyy commented 6 months ago

Hello, when trying to ublock the app for some time for example 10 Min, it keeps allowed and not auto blocked after the the duration end.

Screenshot_20231225-143308~4

Phone Info: - Pixel 6a - android 14 Pcap version - 1.6.9

Note: this happen in this phone not my other phone.

emanuele-f commented 6 months ago

Hello, is the hourglass icon still displayed after the 10 minutes pass? Does the same happen with other apps like chrome?

smexyy commented 6 months ago
emanuele-f commented 6 months ago

@smexyy in the screenshot above, I can see the checkmark icon :white_check_mark:, which indicates that the firewall is working in whitelist mode (block everything except the whitelisted apps) and that whatsapp is whitelisted, ~so this is why the app is unblocked even if the grace period has ended. The bug to fix here is that PCAPdroid allows you to temporary unblock an app which is already whitelisted.~

Edit: actually block rules co-exist with whitelist rules, as explained in the whitelist help dialog, so this is not the case

emanuele-f commented 6 months ago

I've tested this on Android 14 and could not reproduce it. Please try with this beta APK and post here the App log, which you can find in the left drawer of PCAPdroid

2023-12-25_18-34

smexyy commented 6 months ago

@smexyy in the screenshot above, I can see the checkmark icon ✅, which indicates that the firewall is working in whitelist mode (block everything except the whitelisted apps) and that whatsapp is whitelisted, ~so this is why the app is unblocked even if the grace period has ended. The bug to fix here is that PCAPdroid allows you to temporary unblock an app which is already whitelisted.~

Edit: actually block rules co-exist with whitelist rules, as explained in the whitelist help dialog, so this is not the case

I add some apps in whilelist and add the same apps in blocklist, and when I need to allow connection, I allow the app for 10 Min use and it will auto block again after grace period end. this issue happen only with my pixel 6a not my other phone which is the same setup.

emanuele-f commented 6 months ago

I see, I will need the log to investigate further

smexyy commented 6 months ago

Hello, is the hourglass icon still displayed after the 10 minutes pass? Does the same happen with other apps like chrome?

I tested now and seems not all apps, it random apps. after 10 min it takes some time to revert back to block sign again.

anpic commented 5 months ago

I tested now and seems not all apps, it random apps

I think it's not about PCAPdroid. Although PCAPdroid has strange global permissive rules. But in the worst case they will only lead to DNS leaks. And here something is probably interfering with the firewall. Try to turn on Always-on VPN and Block connections without VPN for PCAPdroid in VPN system settings. It would be useful to look at all PCAPdroid settings in general. But this requires the feature of exporting them but Emanuele denies the need for this feature :(

emanuele-f commented 5 months ago

I tested now and seems not all apps, it random apps. after 10 min it takes some time to revert back to block sign again.

@smexyy please provide the app log as explained in https://github.com/emanuele-f/PCAPdroid/issues/390#issuecomment-1869064688, it's necessary to proceed with the troubleshooting

emanuele-f commented 4 months ago

I reproduced this. The bug occurs when the device enters deep sleep, as https://developer.android.com/reference/android/os/SystemClock#uptimeMillis() does not count time spent sleeping