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

Automation settings (Tasker, AutomateIt, etc) #1896

Closed
Revertron opened this issue Jun 1, 2018 · 19 comments
Closed

Automation settings (Tasker, AutomateIt, etc) #1896

Revertron opened this issue Jun 1, 2018 · 19 comments
Assignees
Milestone

Comments

@Revertron
Copy link

Now we've exposed our ServiceManager service to rule AdGuard from Tasker.
We need to remove ServiceManager, and for this task we need to develop some new interface.
It can be a BroadcastReceiver that will get all intents from Tasker and change the state of protection.

@Revertron Revertron added this to the 2.12 milestone Jun 1, 2018
@ameshkov
Copy link
Member

ameshkov commented Jun 4, 2018

First of all, we need to add a new setting to the "Advanced" section and call it: Automation

Description:

Status: Disabled
AdGuard can expose an API that you can use for setting up custom complicated automation rules via apps like "Tasker", "AutomateIt", etc.

Tapping on this setting opens a new activity.

Here's what we need to show on this activity:

Mockup:
https://uploads.adguard.com/up04_tx9e1_Adguard_for_Android_-_Automation__Moqups_.png

Prior to implementing it, we must add a knowledge base article explaining what it is. Click on the "Learn more" button leads to this article.

Here is the list of actions we expose through the API:

  1. Start protection (starts protection)
  2. Stop protection (stops protection completely)
  3. Pause protection (pauses protection -- with a notification that allows to unpause it manually)
  4. Check filters updates
  5. Enable/disable DNS filtering
  6. Change the DNS settings

@ameshkov
Copy link
Member

ameshkov commented Jun 4, 2018

KB task:
AdguardTeam/AdguardKnowledgeBase#175

@ameshkov ameshkov changed the title Remake Tasker interface Automation settings Jun 11, 2018
@ameshkov ameshkov changed the title Automation settings Automation settings (Tasker, AutomateIt, etc) Jun 11, 2018
@TPS
Copy link
Contributor

TPS commented Jun 14, 2018

Is this the current state for the ηightly builds? If so, what intents do work? Or are there none 'til that Automation section is activated?

@ameshkov
Copy link
Member

Is this the current state for the ηightly builds? If so, what intents do work? Or are there none 'til that Automation section is activated?

The old API does not work in the currently nightly builds.

We intend to replace it with the new one completely.

@TPS
Copy link
Contributor

TPS commented Jun 15, 2018

Sadly, this is suddenly essential again, as my previous (definitely temporary) device has critical need of this. (Apparently, the watchdog function isn't sufficient, either. 😢)

@Revertron
Copy link
Author

Revertron commented Jun 27, 2018

Implemented and merged.

Testing instructions:

Install AdGuard 2.12.83+, Tasker or AutomateIt.
Check all functions from KB article: https://kb.adguard.com/android/solving-problems/tasker

@TPS
Copy link
Contributor

TPS commented Jun 30, 2018

I like it, & it's rather simple to use, even on officially unsupported/abandoned automators (I use Llama).

A suggestion: Allow an extra to modify behavior of that green toast that pops-up, so it can, i.e., operate silently [per a particular configured intent], or display no more than once an hour, or, more advanced, iff it affects state (e.g., if using start, toast only shows whenever AG isn't already started).

@ameshkov
Copy link
Member

ameshkov commented Jul 3, 2018

@Revertron let's make it configurable as @TPS suggests, the toast might be annoying.

We will need to add it to the article as well.

@TPS
Copy link
Contributor

TPS commented Jul 3, 2018

Thanks! 🙇

Another suggestion for those using the previous/legacy version: Popup a dialog (I think a toast is insufficient) in AG to the effect of "You're using our old/deprecated version of automation! Update now to our free, secure, more versatile version!" whenever an old-style intent is received/detected. I think it's silently ignored now.

@snhv
Copy link

snhv commented Jul 4, 2018

Hi,
Can we do something like this:

  1. When phone connects to wifi networks:
  • Adguard switches to proxy mode;
  • another VPN of our choice starts and get connected. [The reason for this is that wifi networks can be unencrypted, and even if it's encrypted, it can be easily hacked.]
  1. When phone connects to mobile networks:
  • the other VPN stops;
  • Adguard switched back to VPN mode.

Thanks.

Edit: Just realize for unrooted phones, proxy mode requires manual setup. Maybe I'm thinking too much but can automation apps automatically set up proxy for whatever connected wifi too?

@Revertron
Copy link
Author

@snhv

  1. Why do you trust your mobile operator and not wi-fi networks? ;)
  2. If you already have root and you are able to use AdGuard in root-proxy mode, why do you need VPN mode? :)
    You can use root-proxy mode whenever and be happy with that.

can automation apps automatically set up proxy for whatever connected wifi too?

Without root it is impossible.

@snhv
Copy link

snhv commented Jul 4, 2018

Without root it is impossible.

OK understood.

Why do you trust your mobile operator and not wi-fi networks? ;)

Mobile connection is encrypted. Wifi connection may be not and prone to man-in-the-middle attack.

If you already have root and you are able to use AdGuard in root-proxy mode, why do you need VPN mode? :)

No I as majority of phone users don't have root. The proxy I mentioned is manual proxy mode for wifi networks. That's why I asked if antomation app can set that up.

@TPS
Copy link
Contributor

TPS commented Aug 1, 2018

@vozersky This is still missing the toast configurability info, @ least in the KB article, but maybe in implementation as well.…

@ameshkov
Copy link
Member

ameshkov commented Aug 5, 2018

This is still missing the toast configurability info, @ least in the KB article, but maybe in implementation as well.…

It's rather self-explanatory, not really necessary to have it in the KB article.

@TPS
Copy link
Contributor

TPS commented Aug 6, 2018

@ameshkov I don't understand. How does 1 configure the toasts for automation?

@ameshkov
Copy link
Member

ameshkov commented Aug 6, 2018

@TPS there's a "Show toasts" setting in the automation settings (maybe it's in the nightly ver only?)

@TPS
Copy link
Contributor

TPS commented Aug 6, 2018

@ameshkov Oh, I saw that, but completely silent operation isn't useful to me; I was expecting something more along lines of

let's make it configurable as @TPS suggests

Allow an extra to modify behavior of that green toast that pops-up, so it can, i.e., operate silently [per a particular configured intent], or display no more than once an hour, or, more advanced, iff it affects state (e.g., if using start, toast only shows whenever AG isn't already started).

@ameshkov
Copy link
Member

Uh, this kind of configuration is too complicated and worthy of a separate feature request. Mind filing it?

@TPS
Copy link
Contributor

TPS commented Aug 12, 2018

@ameshkov Absolutely, & done! 🙇

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

5 participants