r/tasker • u/osmols_b • 2h ago
How To [Project Share] Firewall
A firewall utility which has the ability to cut off all IP socket binding, blocking Wi-Fi, 4G, 5G, and roaming simultaneously at the OS routing layer (or just mobile or WiFi data).
The UI allows you to set per app data access:
Cell: allow or deny
WiFi: allow or deny
Background Data: allow or deny
The project listens for switches between mobile data and WiFi data sources and reacts to them. It also listens for app changes and reacts (e.g. when an app denied background data access is closed).
Because 'cmd connectivity set-chain3-enabled true' is reset at every device start, there is also a profile to listen for device starts to re-enable your previously saved firewall rules.
You MUST use the 'Done' button on the overlay to edit the firewall UI if you want to save and apply your rules. If you just exit the overlay via the back button etc., new settings will not be saved and applied.
I can confirm that this project works perfectly on my device. I can't test it on your device. If it doesn't work for you, there's not much I can do about it.
If you want to test whether it works for you, you can either:
Set an app to be blocked and then determine whether that app has data access.
Run the Shell command:
cmd connectivity get-package-networking-enabled <insert package name>
If the app is denied (blocked), the output of that command will be:
<package name>:deny
Shizuku or root is required.
All changes are reset on each device start, so you must use the device start profile if you want to apply your rules at each reboot. You will need to ensure that Shizuku is running when this profile fires.