Orbot and Pandora in a profile

261 views
Skip to first unread message

Narcis Mihai

unread,
Aug 16, 2011, 10:48:22 AM8/16/11
to Tasker
Hi guys,

Ok, so I have a simple profile - when headphones on, I have the media
volume at 2 and perform task "music menu" ( a music menu pops and I
select the app - I have music, radio and Pandora). What I like to know
is:

- is it possible to fire up Orbot (a proxy program which allows
running pandora outside of the us) if I select Pandora? Or this is not
possible and I should put Pandora off the list?

Thanks

Pent

unread,
Aug 16, 2011, 10:58:53 AM8/16/11
to Tasker
> - is it possible to fire up Orbot (a proxy program which allows
> running pandora outside of the us) if I select Pandora? Or this is not
> possible and I should put Pandora off the list?

Do you just need to run Orbot once first and then switch to Pandora ?

If so:

1) create a new task called PandoraProxy with the action Load App
Orbot, then Wait 1 Second, then Load App Pandora.
2) make the menu item of the menu task instead of 'Load App Pandora'
into 'Perform Task, PandoraProxy'.

Pent

Narcis Mihai

unread,
Aug 16, 2011, 11:59:50 AM8/16/11
to Tasker
Great Pent,

It works!!! I just put a wait time of 20s to load pandora, while I
manually enable Orbot after its launch to connects to Tor network!
Many thanks!!!

Narcis Mihai

unread,
Aug 17, 2011, 3:50:44 PM8/17/11
to Tasker
Hey guys, I'm having a problem I try to solve with tasker with the
above profile.

Ok, so if I launch Orbot, once and connect it, it doesn't need to be
connected the next time Pandora starts.
Therefore in the PandoraProxy task Pent suggested, I'm trying to skip
the Orbot part if it's already been launched that day.

So I set up a profile with:

App Orbot - Set variable ORBOTON to 1 and exit to clear variable.

And in the task with the PandoraProxy I put a if variable set in
launch Orbot. The thing is, it's always unset, so the task is
performed anyway, even if it's there (even it's icon in statusbar) as
Orbot goes in the background.
If I relaunch it, it gives a FC. What's to be done?
Any other suggestion?

Narcis Mihai

unread,
Aug 17, 2011, 3:55:14 PM8/17/11
to Tasker
Ok, to better understand here is my profile.

Profile Orbot

App Orbot

Tasks - Enter - Variable Set #ORBOTON to 1
Exit - Variable Clear #ORBOTON


My task PandoraProxy
1. Load App
ORBOT if %ORBOTON isn't set

2. Wait 20 sec if %ORBOTON isn't set

3. Launch Pandora

4. Stop

BossMan

unread,
Aug 17, 2011, 4:19:01 PM8/17/11
to tas...@googlegroups.com
You can't clear the variable in the exit task because it will be called when Orbot will not be foreground app anymore.

How about: remove the exit task from the Orbot profile, leave rest as is. Add another profile that will be triggered with Event->Device Boot and in this profile clear the ORBOTON variable.

The other way (more complicated but probably also more accurate) would be to use some shell scripting using e.g. Secure Settings plugin (search the forum) and then something like : "ps | grep -v grep | grep orbot; if [ $? -eq 0 ]; then echo RUNNING; fi;". You could then parse STDOUT stream and start orbot only if the output doesn't match RUNNING.

BR,
A.
 

BossMan

unread,
Aug 17, 2011, 4:24:13 PM8/17/11
to tas...@googlegroups.com
PS. "grep orbot" is only an example - you have to figure out what is the name of the orbot process and then use that name (or part of it) in the search (from the package name I found on google, it might be something similar to org.torproject.android).

Narcis Mihai

unread,
Aug 17, 2011, 4:46:56 PM8/17/11
to Tasker
BossMan you're the man! :)
Ok, I guess I will stick to the first option, even though I already
have Secure Settings installed (but I have no idea about shell
scripting, I'm using it to disable/enable pattern lock).

But if you already composed that script, could I just use it in secure
settings what you wrote? Or is it more than that? "ps | grep -v grep |
grep orbot; if [ $? -eq 0 ]; then echo RUNNING; fi;" ?

What about parsing STDOUT, how do I go about doing that? Sorry if I
ask too much, you shouldn't have said it in the first place lol.

Thanks anyway, you ' ve helped a bunch!!!!

Narcis Mihai

unread,
Aug 17, 2011, 5:04:20 PM8/17/11
to Tasker
Ok, I found the process with betterbatterystats, it's called
org.torproject.android.Orbot
Should I replace the "orbot" you mentioned?
Thanks!

BossMan

unread,
Aug 17, 2011, 5:46:40 PM8/17/11
to tas...@googlegroups.com
Hello again,

in the pandoraProxy task, replace two first actions (loadapp + wait) with action Tasker->Perform Task (CheckOrbot, with priority greater of the one used in your original profile (6 should be ok by default)).

Task CheckOrbot:
- Variable Clear %STD_OUT
- Plugin Secure Settings, command "ps | grep -v grep | grep torproject; if [ $? -eq 0 ]; then echo RUNNING; else echo STOPPED; fi", standard output redirected to variable %STD_OUT (add "show notification" and "show output" options to verify if everything is working ok - you can disable it later),
- Tasker->Wait Until (5 sec, %STD_OUT is set),
- Tasker->Stop (if %STD_OUT matches *RUNNING*),
- LoadApp Orbot,
- Wait 20 sec

Hope it is more clear now,
A.

Narcis Mihai

unread,
Aug 18, 2011, 12:07:23 PM8/18/11
to Tasker
Thanks alot for your help BossMan,

Ok, made it work, what's curious is that even if Orbot is deactivated,
a process (com.torproject.android) is still running in the BG (which
also makes me wonder about this app), therefore the script would skip
loading orbot, even though it was not running/activated.

When activated, I noticed in the output another process running
(privoxy) so I changed "grep torproject" to "grep privoxy" and now all
works fine.

Many thanks, you've been of great help.

James Brown

unread,
Feb 19, 2016, 3:26:16 AM2/19/16
to Tasker, click...@gmail.com
It would be simpler to create a task to Send Intent with an Action of org.torproject.android.START_TOR, a Cat of Default, and a Target of Activity. This starts the TOR. Then set a profile to run this task when Pandora is started.
Reply all
Reply to author
Forward
0 new messages