TeamViewer Forum

General Category => Teamviewer for Android => Topic started by: Aqualung on January 29, 2014, 01:00:10 PM

Title: QS Tasker script
Post by: Aqualung on January 29, 2014, 01:00:10 PM
Folks, somebody should design a Tasker script to bypass them pesky QS local prompts, hence allow for unattended remote control. Any volunteers? I do not think we should rely on TeamViewer to allow unattended access anytime soon.
Title: Re: QS Tasker script
Post by: Aqualung on February 03, 2014, 10:12:38 AM
Alright, I wrote the Tasker scripts myself. Works like a charm! Welcome to unattended access!
Title: Re: QS Tasker script
Post by: whitedavidp on March 08, 2014, 06:36:42 PM
Hello. I just stumbled across this thread and it is exactly what I want to do. Any chance you can post or email your solution? I don't yet own tasker but have been waiting for a reason to get it. This could be it. Thanks
Title: Re: QS Tasker script
Post by: Aqualung on March 08, 2014, 08:44:49 PM
First you do a Tasker Load App (TVQS), and then use Tasker to simulate screen taps like so:

Profile: BypassTVQS#1
   Event: New Window [ Label:Allow remote support? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:2 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]
Profile: BypassTVQS#2
   Event: New Window [ Label:Allow remote control? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:1 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]

I know, not very elegant, but it does its job.
Title: Re: QS Tasker script
Post by: whitedavidp on March 08, 2014, 09:45:52 PM
First you do a Tasker Load App (TVQS), and then use Tasker to simulate screen taps like so:

Profile: BypassTVQS#1
   Event: New Window [ Label:Allow remote support? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:2 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]
Profile: BypassTVQS#2
   Event: New Window [ Label:Allow remote control? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:1 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]

I know, not very elegant, but it does its job.

Aqualung my friend --
don't you start away uneasy
you poor old sod, you see, it's only me...

Thanks very much. I am all about not very elegant but doing the job. I just paid for Tasker and will try to get this going tomorrow. I hope to ultimately trigger the starting up (and bypassing) from a remote, desktop computer via ssh. I think I have found all the bits to cobble this together. Should be interesting. Your piece is critical. Cheers!
Title: Re: QS Tasker script
Post by: whitedavidp on March 09, 2014, 05:49:43 PM
First you do a Tasker Load App (TVQS), and then use Tasker to simulate screen taps like so:

Profile: BypassTVQS#1
   Event: New Window [ Label:Allow remote support? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:2 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]
Profile: BypassTVQS#2
   Event: New Window [ Label:Allow remote control? Window Type:Dialog ]
Enter: Anon
   A1: Dpad [ Button:Right Repeat Times:1 ]
   A2: Dpad [ Button:Press Repeat Times:1 ]
   A3: Go Home [ Page:0 ]

I know, not very elegant, but it does its job.

Thank you, thank you, thank you!

With a bit of fiddling, I now have this working as I want. I did have to change the repeat times on Bypass2 from 1 to 2 on action 1.

I also lost alot of time fiddling with an old Tasker Proxy app that no longer seems to work. Finally, I stumbled into this:

/system/bin/am broadcast -a net.dinglisch.android.tasker.ACTION_TASK -e task_name <your task>

I am able to execute this from my desktop PC to launch TVQS via tasker using SSH. When I connect via TV on my PC, your tasker stuff works perfectly! Wow!

So thanks!
Title: Re: QS Tasker script
Post by: n3wb13 on March 23, 2014, 10:26:35 AM
Thank you Aqualung so much for your script.

On my phone which is running JellyBean, the script works just fine.

But it seems not working on my Nexus 7 II (KitKat) as the second profile BypassTVQS#2 goes straight to the Deny button. I tried to set the number of right button press to 2 and Tasker did select the Allow button. However, I still got a reject message.

I'm wondering if anyone has the same problem or not?
Title: Re: QS Tasker script
Post by: drakongetes on June 02, 2014, 03:52:57 PM
hello whitedavidp,

thank you for your script - this is exactly what I am trying to do.
However, I am a bit out of my depth as how to implement your script!

I intalled Tasker.
Under Profile, I have a Device Boot option (which is ON) and then
device Boot -> Option Apps.

If I click on Option Apps, I have
1. Wait 20 seconds
2. Lauch App
  App TV QuickSupport.

So basically when I reboot my phone, TV QS starts automatically, which is great.

But from here I am stuck.

How do I implement your script?
- Do I add it under the 2 taskes I have above? If so, how???
When I add a task, I cannot find an Event called "New Window"

Alternatively, if I try to selection an Script action, I can choose:
JavaScript, JavaScripted, Run Shell, Run SL4A Script
Which one do I choose?

Thanks A LOT in advance for your help.
Title: Re: QS Tasker script
Post by: whitedavidp on June 02, 2014, 04:13:43 PM
hello whitedavidp,

thank you for your script - this is exactly what I am trying to do.
However, I am a bit out of my depth as how to implement your script!

I intalled Tasker.
Under Profile, I have a Device Boot option (which is ON) and then
device Boot -> Option Apps.

If I click on Option Apps, I have
1. Wait 20 seconds
2. Lauch App
  App TV QuickSupport.

So basically when I reboot my phone, TV QS starts automatically, which is great.

But from here I am stuck.

How do I implement your script?
- Do I add it under the 2 taskes I have above? If so, how???
When I add a task, I cannot find an Event called "New Window"

Alternatively, if I try to selection an Script action, I can choose:
JavaScript, JavaScripted, Run Shell, Run SL4A Script
Which one do I choose?

Thanks A LOT in advance for your help.


Well, I am mostly copying the work of others who have gone before me. But let me see if I can help...

First, you need to enable something called Tasker's Accessibility service. Look under settings->Accessibility->Services for something that says Tasker. Turn that on. This is needed so Tasker can read information that is shown in popup windows from TVQS. (Note that this causes problems on at least some Samsung phones including my Note I. It causes the thing to incorrectly read all sorts of stuff aloud. There is no fix for that so I do not use this on my phone - only on my TV computer where it works fine.)

Then create a new Task - call it Bypass TVQS. Step 1 = Dpad (under input). Set Button to Right and Repeat = 2. Step 2 = Dpad. Set Button to Press and Repeat = 1. Step 3 = Go Home (under App). Set Page = 0 (however I need to use 2 on my TV computer so you may have to fool with this. But 0 should take you to you main home screen).

Then create a new profile that is triggered by a New Window event (under UI). For Label put in Allow remote control?, select Window Type = Dialog, Priority Highest. Associate this even with the Bypass TVQS task created above.

I generally seem to have to exit Tasker, remove it from the Android task list, and restart Tasker to get it to read in my changes properly. Not sure why. But after doing this, you should be able to start TV on a PC and connect to TVQS (which is already started on your device at boot - I don't do this myself - I trigger it by sending the device an SSH command but that is another story). When you connect, Tasker should see the new popup Window from TVQS that says Allow remote control? When Tasker sees this it should trigger your Bypass TVQS task which should press the Allow button and then show your main home screen.

Good luck.
Title: Re: QS Tasker script
Post by: whitehathacker on June 07, 2014, 01:14:49 AM
Super Newbie here...this is what I am looking for as well but a few questions.

From the google playstore what tasker app do I download onto my android? I know it sounds like a stupid question!
Title: Re: QS Tasker script
Post by: whitedavidp on June 07, 2014, 05:42:41 PM
Super Newbie here...this is what I am looking for as well but a few questions.

From the google playstore what tasker app do I download onto my android? I know it sounds like a stupid question!

Here it is: https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm (https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm).
Title: Re: QS Tasker script
Post by: whitehathacker on June 09, 2014, 03:11:42 PM
I'm trying to use the same script on a Samsung note 10.1 (2014 edition) and the input screen tells me that 'dpad' is not available on this device? Anyone else see this?
Title: Re: QS Tasker script
Post by: whitedavidp on June 09, 2014, 03:34:25 PM
I'm trying to use the same script on a Samsung note 10.1 (2014 edition) and the input screen tells me that 'dpad' is not available on this device? Anyone else see this?

I think you should check about this on the Tasker Support forum https://groups.google.com/forum/#!forum/tasker (https://groups.google.com/forum/#!forum/tasker). I did a quick google and found a posting that says dpad requires a rooted device https://groups.google.com/forum/#!topic/tasker/S2ZoulP8Urc (https://groups.google.com/forum/#!topic/tasker/S2ZoulP8Urc). I cannot say for sure but all of my devices are rooted.
Title: Re: QS Tasker script
Post by: zetsui on February 03, 2015, 12:57:05 AM
This thread has over 5k  views. Could someone upload the tasker scripts? The directions here are a little difficult to follow
Title: Re: QS Tasker script
Post by: zetsui on February 03, 2015, 02:12:17 AM

Edit: got it to work with the above confirguration, by restarting tasker a few times. Hits yes on both pop up dialogs. The thing is though I need the teamviewer android window in the foreground (in front) for it to automate the service. Everytime I log out of the android on my computer, I have to walk over to my charging android tablet and open up the teamviewer file myself to bring it to the foreground so it can auto-load it's teamviewer id in the id box...is there a way I can have tasker call it to the foreground whenever the android is idle (most of the time- almost like a constant android server for my laptop)?
Title: Re: QS Tasker script
Post by: zetsui on February 03, 2015, 02:22:52 AM
Edit: just to be clear what I need in my last sentence: .is there a way I can have tasker call it to the foreground whenever the teamviewer connection is closed on my pc and the teamviewer app on the android must be reloaded in order to automatically fill in its teamviewer id?
Title: Re: QS Tasker script
Post by: Aqualung on February 15, 2015, 11:35:06 AM
Well, once I switched to Lollipop I started having issues with TVQS, as it no longer controls my phone. I've been bouncing emails for a few months with the TV support team, until, finally, they've disclosed to me that QS doesn't work on Lollipop yet. Good grief! It took 2 months of turmoil to get them to admit that! Unbelievable!
Title: Re: QS Tasker script
Post by: jicama on June 04, 2015, 08:40:49 AM
Here's what I'm doing to keep QuickSupport running.  It relies on pgrep (from BusyBox) being installed, and that /proc/$pid/oom_adj is 0 for a foreground task, 1 or 2 for a background task, and something larger for a cached task.  Note that !~ is "Doesn't Match" in the drop-down list.

Task: Relaunch QuickSupport
A1: Run Shell
 Command: pid=$(pgrep -x com.teamviewer.quicksupport.market) && cat /proc/$pid/oom_adj || echo nope
 Store output in: %oomadj
A2: Launch App
 App: QuickSupport
 If: %oomadj !~ 0/1/2

Profile: Keep QuickSupport On
 Time: Repeat every 2 minutes
 Task: Relaunch QuickSupport

Title: Re: QS Tasker script
Post by: Swamping on August 02, 2015, 02:38:36 AM
So I've been able to successfully create the tasker script to accept the connection automatically, however this only happens when I have the app open and the phone unlocked. When I lock the phone (lock screen), tasker is unable to press the accept button. Do you guys know a way to fix this, or a method for it to still work with the lock screen? How do you guys have your tasker press the accept button, while the screen is off?