skullone / android_firewall

This is a fork of Droidwall by Rodrigo Zechin Rosauro - http://code.google.com/p/droidwall/
128 stars 91 forks source link

Shortcuts to activate profiles #56

Closed lschweiss closed 10 years ago

lschweiss commented 10 years ago

There needs to be application shortcuts to activate each profile and enable or disable the firewall.

This way profiles can be switched automatically with tools like llama or MacroDroid.

skullone commented 10 years ago

I will look into this. Please note that functionality like this currently exists in AF via the Tasker/Locale plugin.

laphlaw commented 10 years ago

On that note, I have a related question.. I'm trying to write a shell script to enable/disable the firewall rules (trying to schedule times when the firewall is active via a cron job).

I'm not too familiar with iptables, but where do you save the rules? Couldn't I just manually run iptables with whatever rules are saved?

If that is not possible, what would be the easiest way to enable/disable the rules in an automated fashion? I'm not really looking to a plugin, but a shell script. Thanks

skullone commented 10 years ago

Rules are not saved anywhere. They are hardcoded. The only variables for the rules themselves are the chain name and the UID for the app to be allowed/disallowed.

Easiest method of automation is by using Tasker and the plugin included in AF. If you want to build a shell script instead of using the plugin you probably need to build the script by using the commands from the source code. All the iptables rules can be found in Api.java.

Thanks!

On Wed, Oct 30, 2013 at 10:54 PM, laphlaw notifications@github.com wrote:

On that note, I have a related question.. I'm trying to write a shell script to enable/disable the firewall rules (trying to schedule times when the firewall is active via a cron job).

I'm not too familiar with iptables, but where do you save the rules? Couldn't I just manually run iptables with whatever rules are saved?

If that is not possible, what would be the easiest way to enable/disable the rules in an automated fashion? I'm not really looking to a plugin, but a shell script. Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/skullone/android_firewall/issues/56#issuecomment-27457721 .

skullone commented 10 years ago

This has been added to version 2.3.3 and is complete. Please e-mail me as I would appreciate another set of eyes to test this with Macrodroid and Llama.

lschweiss commented 10 years ago

Jason,

I'd be happy to test it on both Llama and MacroDroid.

Do you have an installer package I can use?

-Chip

skullone commented 10 years ago

Chip email me at emaileditedout and i'll send you the link.

skullone commented 10 years ago

This has added in version 2.3.3.