Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasker support #146

Open
beatschubser opened this issue May 30, 2017 · 14 comments
Open

Tasker support #146

beatschubser opened this issue May 30, 2017 · 14 comments

Comments

@beatschubser
Copy link

beatschubser commented May 30, 2017

A couple of feature ideas that would be great to have:

  1. Quick settings tile to (de-)activate the service with a single tap
  2. Tasker support for the same reason. For example, I'd like to disable DNS66 whenever I'm connected to my home WiFi since I'm running my own DNS Adblocker there (Pi-Hole). Tasker support would make this very easy.
  3. A simple logging-feature would be nice to see how many ads have been blocked today and how much of the total traffic they made.
@julian-klode
Copy link
Owner

We already have bugs for 1 and 3: #62 and #35 - I'm not sure what I'm supposed to do about 2 - doesn't that work already (figure out which intents to send and send them?).

@julian-klode julian-klode changed the title Quick settings tile / Tasker support / Logging Tasker support May 31, 2017
@julian-klode julian-klode added this to the Later milestone May 31, 2017
@beatschubser
Copy link
Author

Do you know how to find out the correct intents? The only method I know in Tasker is to select "Load Application" and long press on the app to see the available intents. There's just one for DNS66 called "MainActivity".

@julian-klode
Copy link
Owner

No, I don't know anything about tasker. If someone figures out what to do, I'm ready to make it work.

@blueshiftlabs
Copy link

This is the developer documentation for Tasker tasks. A good place to start would probably be an action plugin that can start, stop, and pause DNS66. You can do that pretty easily from within the app by sending a startService to AdVpnService, but it's not something that can be done externally because AdVpnService is protected by android.permission.BIND_VPN_SERVICE.

@julian-klode
Copy link
Owner

That's really not a documentation, that's a confusing page that is half-broken. Basically the only link there is TaskerPlugin.java, and that does not have a license, and it's unclear what that does. The rest links to some "Locale" app framework thingy.

@blueshiftlabs
Copy link

Tasker's plugin API is based on Locale's plugin API. Locale came first, but Tasker was a lot more powerful, and got more traction. If you write a Locale-compatible plugin, it will automatically work with Tasker.

The Locale plugin SDK, the sample setting plugin, and sample condition plugin are all licensed Apache 2.0. The Locale developer documentation also seems quite comprehensive.

@misku
Copy link

misku commented Aug 30, 2017

+1 for Tasker support. Once DNS66 is running its VPN, Tasker doesn't seem to be recognizing the WIFI SSID anymore. As a result, profiles like e.g. "phone connects/disconnects to/from a WIFI with SSD X" will not work.

@winnieXY
Copy link

So according to the Manifest there is a org.jak_linux.dns66.vpn.AdVpnService intent which should start/stop the blocker.
However if i try to toogle this intent via tasker nothing happens. I add as "extra" Argument: "COMMAND:1" for stopping and "COMMAND:0" for starting.

My complete Settings in tasker:
Action: org.jak_linux.dns66.vpn.AdVpnService
Type: None
Mime:
Data:
Extra: COMMAND:1
Paket: org.jak_linux.dns66
target: service

Could you please tell me what is wrong?

@PheiPheiPhei
Copy link

@winnieXY did you get it working?

@winnieXY
Copy link

no - as written by blueshiftlabs on 20 Jun, this can't be done sadly externally up to now.

@febs
Copy link

febs commented Feb 24, 2018

I'd also love to be able to automate dns66 with tasker. Thanks for the great app!

@immanuelfodor
Copy link

Hi Guys, why #280 has not been merged, is this really a matter of not enough coverage tests? Tasker support would take this app to the next level of usability.

@FaserF
Copy link

FaserF commented Nov 8, 2018

Hey. Any news to tasker support? I would really love to see this.

@beeguy1234
Copy link

I got Tasker support working in my fork today.

A Tasker plugin has been used https://github.com/julian-klode/dns66/pull/280/commits but it is overly complicated for my purpose. I'm just using intents to issue commands from Tasker (start/stop/pause/resume) and to update status to Tasker.

  • To send commands from Tasker, use the Send Intent action with Action set to app.intent.action.PAUSE/RESUME/STOP/START, and Package set to org.jak_linux.dns66
  • To receive status updates in Tasker, use the Intent Received event with Action set to net.dinglish.android.tasker.DNS66_STATUS. The status will be available in the action as a local variable (%status) with value "running" or "stopped".

For the status updates I have added sendBroadcast(intent) to AdVpnService.java. Not sure it is the best way to hook the status updates because I haven't studied the code for long. Appears to be working well though. Check out my fork if you're interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants