1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Tasker - Phone 'Security' Profiles


Last Updated:

  1. lifeonmtv

    lifeonmtv Well-Known Member This Topic's Starter

    Joined:
    Jun 5, 2010
    Messages:
    256
    Likes Received:
    49
    Hey guys, I previously posted this (i have now added something extra to this one) on another thread, it took me about 20 minutes to write, surpassing by far any the maximum time I ever spent on one single forum post in the past lmao.

    It was originally a response to someone who wanted to activate gps remotely if they lost their phone in order to use 'lookout' and then deactivate it afterwards to save battery. I though I'd make it its own thread since it took me ages to write, and it can effectively replace several features of the 'lookout' security app.

    Alright, this is gonna be a long post.

    First of all, I use a rooted htc desire running T-Mod 2.2f.

    The version I'm using of Tasker is 1.0.12m, it's a paid app that can be found on the market. I'm sure other versions should work similarly if not the same. Please note that Tasker is able to do so many more useful things and here's a bunch of 'import n go' profiles (I see them more as useful templates but that's just me) Profiles - Tasker Wiki

    I'm also using the locale password lock plugin by willem stoker (only one that works on froyo). This isn't necessary as tasker has its own lockscreen capabilities, but I do recommend getting it as it is a lot 'stronger' imo. You will need to set up the lockscreen password on your phone settings, then the plugin will work properly (on your phone security settings, set up the pin password, and choose it to come on 'immediately' or with 'no delay'). At first instance, I will only explain how to set it up using this plugin, but you can replace these steps by substituting the task Display>Lock. If anyone can't figure it out I will ammend the post accordingly. http://www.appbrain.com/app/locale-password-lock-plug-in/com.willemstoker.PasswordPlugin

    Here we go.

    First off, I have two widgets one that activates the password lock and one that deactivates it. To set this up do the following.

    -Open tasker, tap tasks, tap new, name the task (eg.lock)
    -tap the + button, tap plugin, tap password lock
    -tap edit and put in and confirm your password, then press the back button.
    -tap done
    -go on a homepage and add a 'task' widget, when tasker opens, select your task (eg.lock) from the dropdown, choose an icon and create the widget.
    -repeat steps but instead create the task to set password lock to off, and then add the second widget.
    -now you should have 1 widget to activate the password screen and 1 widget to deactivate it.

    NOTE: you can also do this using only one toggle widget, but I won't include that in this guide.

    Carrying on, I have a 3 profiles set for 'lost phone security' purposes. They are all triggered by a text message received with a particular keyword or phrase (you may be able to extend this to email received). You can use any keyword, the same keyword for all, or individual keywords for each, your choice.

    The first one switches the volume up to the max, locks the phone, and starts playing a loud tune. I set this up in case I misplace my phone somewhere familiar (house, office, etc) and it's on silent at the time.

    Steps:
    - Open Tasker and tap Tasks, then tap new.
    - Add a name for your task (eg. security1).
    - Tap on the + button, then plugin, then password lock, then set to on (you may need to input the password at this stage),done
    - Tap on the + button, then audio, the speakerphone, then set to on, done
    - Tap on the + button, then audio, media volume, then set to maximum, done
    - Tap on the + button, then audio, silent mode, set to on, done
    - Tap on the + button, then media, music play, then browse to the mp3 you want to use. You can use the settings to set a start point. Done.
    Optional: - Tap on the + button, then tasker, wait, i chose 2.5 minutes, done
    - Tap on the + button, then media, music stop, done
    - Tap on the + button, then audio, speakerphone off, done
    - Tap on Done and exit the task.
    - Tap on New on the main screen (to create a new profile) and name it (eg.security1)
    - Tap on event, phone, received sms, then type in your keyword in the message text box. NOTE: I leave the sender filed blank so i can trigger it from any mobile number.
    - Tap on done.
    -This should bring you to the 'task' screen. Choose your task (eg. security1) from the dropdown at the top.
    - Tap done.

    The second one I use does the following upon receipt of a keyword. Switches mobile data on in case it was off at the time, locks the phone, and replies with a link to google maps with the phone's coordinates as per 'network location'. Note: I set mine up to also send me an email with this link, but that's another can of worms which I won't include in this guide.

    Steps:

    - Open Tasker and tap Tasks, then tap new.
    - Add a name for your task (eg. security2).
    - Tap on the + button, then net, then mobile data, then set to on, done
    - Tap on the + button, then plugin, then password lock, then set to on (you may need to input the password at this stage), done
    - Tap on the + button, then variable, then set, in the 'name' field type in %LOCATION, in the 'to' field type in %LOCN, done
    - Tap on the + button, then net, http get, in serverport type in is.gd/api.php?longurl=http://maps.google.com?q=%LOCATION, in mime type select text/plain, done
    - Tap on the + button, phone, send sms, in 'number' field type in %SMSRF, in 'message' field type in your phone is at %HTTPD, done
    - Tap on the + button, tasker, wait, select 1 second, done
    - Tap on the + button, variable, clear, then in name type in %LOCATION, done
    - Tap on the + button, display, lock, then put in the lock code you've set up for tasker (if you haven't done this, go to tasker settings and set one up). I chose mine fullscreen, and made a background image for the tasker lock saying 'this phone's location is known, it has been remotely locked and will be rendered unsuable unless returned, please contact:xxxxxxxx or email xxxxx.'
    , done
    - Click on Done in the task screen.
    - Tap on New on the main screen (to create a new profile) and name it (eg.security2)
    - Tap on event, phone, received sms, then type in your keyword in the message text box. NOTE: I leave the sender filed blank so i can trigger it from any mobile number.
    - Tap on done.
    -This should bring you to the 'task' screen. Choose your task (eg. security2) from the dropdown at the top.
    - Tap done.

    The third one I use does the following upon receipt of a keyword. Set mobile data on, sets gps on, replies with a link to google maps with the phone's location, sets gps off then locks the phone. NOTE: there's other ways to do this (eg. using 'gps fix'), but this works very well for me.

    Steps:
    - Open Tasker and tap Tasks, then tap new.
    - Add a name for your task (eg. security3).
    - Tap on the + button, then net, then mobile data, then set to on, done
    Optional: - Tap on the + button, display, timeout then choose 3 minutes (you can skip this if you're not using set cpu to underclock when screen off), done
    - Tap on the + button, then plugin, then password lock, then set to on (you may need to input the password at this stage), done
    - Tap on the + button, misc, gps, set to on, done
    - Tap on the + button, misc, get location, source gps, timeout 100 seconds (or however long you want to give it), done
    - Tap on the + button, then variable, then set, in the 'name' field type in %LOCATION, in the 'to' field type in %LOC, done
    - Tap on the + button, then net, http get, in serverport type in is.gd/api.php?longurl=http://maps.google.com?q=%LOCATION, in mime type select text/plain, done
    - Tap on the + button, phone, send sms, in 'number' field type in %SMSRF, in 'message' field type in your phone is at %HTTPD, done
    - Tap on the + button, tasker, wait, select 1 second, done
    - Tap on the + button, variable, clear, then in name type in %LOCATION, done
    - Tap on the + button, misc, gps, set to off
    - Tap on the + button, display, timeout, set to 20 secs
    - Tap on the + button, display, lock, then put in the lock code you've set up for tasker (if you haven't done this, go to tasker settings and set one up). I chose mine fullscreen, and made a background image for the tasker lock saying 'this phone's location is known, it has been remotely locked and will be rendered unsuable unless returned, please contact:xxxxxxxx or email xxxxx.'
    , done
    - Click on Done in the task screen.
    - Back on the main screen click on new, create and name a new profile (eg.security3), then select
    this should bring up the task screen so select your task (eg.security3) from the drop down.
    - done

    You can make things even better by adding the following optional stuff (i won't go into too much detail about these and will assume that by now you understand tasker, but feel free to ask if you need further clarification.

    You can add a 'device boot' profile that will show the tasker lockscreen (return this phone bla bla bla) on device boot if one of the above 'security' features was activated before it was switched off.

    To do this, I created a variable (%SECLOC). You will need to edit the previous tasks for this to work, and add another step somewhere at the top of the task list. The task will be to set variable %SECLOC to 1. Then you can create a profile with state 'device boot' and make it 'lock if %SECLOC is 1'.

    You can then make a widget that will set %SECLOC to 0 if clicked to deactivate this once you have your phone back. (I combined this widget with my pin lock screen thing i set up with the locale plugin lockscreen plug for convenience, but i'm sure you can find something to match your setup).

    I suggest you then lock tasker UI altogether with a password, you can do this in tasker settings (and will need to at least put in a password there for the above profiles to work)

    As I said before, you can also get tasker to email you the links, or get it to include more info such as battery level etc.. by adding the relevant variables in the body of the text message (eg. %BATT for battery level).

    ALSO, tasker does much more than this, it does it ALL.

    good luck!

    PS: I didn't attach downloadable profiles as this guide is also intended to make noobs to tasker actually understand how it works. Please feel free to suggest better profiles. The profiles I actually use are slightly different (a few extra 'waits' here and there) but if you follow all of this I'm sure by the end of it you'll know what you need to do to tweak to your liking! lol

    PPS: Since GPS can take a while to obtain data, I'd suggest always activating the second task first (this will lock the phone pretty much straight away), then activating the third task so that the thief doesn't get to browse your phone while gps is working things out.
     

    Advertisement
    shgavman, 8andsand, psaini and 2 others like this.
  2. Rotor

    Rotor Well-Known Member

    Joined:
    May 1, 2010
    Messages:
    97
    Likes Received:
    16
    Nice one. Thanks for takng the time to write all this down. I'll have a play around with these tomorrow.
     
  3. stevepork

    stevepork New Member

    Joined:
    Nov 27, 2010
    Messages:
    1
    Likes Received:
    0
    Hi mate I setup this so that it switches on wifi and crated a profile that switched on GPS and gave it 30 secs to get a better location. I also created a home screen widget that when I found it the settings would go back to as they were before so you didn't need to go into settings.:D

    About sending yourself an email, whoever had stolen your phone he could access your notification bar and see that you sent yourself the email and read the first few lines (if you have that email account setup on your phone that is!)

    If you have music to play when you are looking for your phone make shure Clear Directory is on!! Took me ages to figure out why it wouldn't shut up.

    A website that I used to help me do this was: How to Roll Your Own "Find My iPhone" for Android

    I hope you find this useful

    Stevepork:D
     
  4. lifeonmtv

    lifeonmtv Well-Known Member This Topic's Starter

    Joined:
    Jun 5, 2010
    Messages:
    256
    Likes Received:
    49
    Hmm.. I don't know why you'd want to switch wifi on, unless you know the thief will be hanging around an unsecured wifi network? (note: the above tasks force 3g connection even if wifi is connected).

    The guide i put up gives the gps time to fix into your location, but for anyone interested in using 'gps fix' instead I recommend Steve's link.

    About the emails, yes I noticed this problem too (although sometimes tasker was fast enough to lock the screen again on time, sometimes it wasn't), so I set up another email account that isn't linked to my phone for this purpose (maybe you can create a label on your inbox for these emails, then deactivate gmail sync for that particular label? dunno if that'll work), or you can add a task to the task list that will switch off auto sync when the message is received so that way no email notifications are received :)
     
  5. 8andsand

    8andsand Well-Known Member

    Joined:
    Dec 24, 2009
    Messages:
    114
    Likes Received:
    13
    Thanks for the post. I didn't know about this plugin. I have been looking for something to control when my phone needs a password and when it doesn't. I didn't think the tasker lock screen was secure enough.
     
  6. outkast25

    outkast25 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    313
    Likes Received:
    15
    [​IMG]

    i entered the correct server text but it sends a link to my phone showing my epic is in this location


    can you please help me fix it.
     
  7. lifeonmtv

    lifeonmtv Well-Known Member This Topic's Starter

    Joined:
    Jun 5, 2010
    Messages:
    256
    Likes Received:
    49
    that would mean that it is receiving the coordinates (0,0) from the %LOCATION variable...

    hmm i never had that problem before, are you using gps location or network location?

    edit: try skipping the step of creating the %LOCATION variable. Then, instead of using %LOCATION at the end of the http string you can use %LOC or %LOCN (for example: is.gd/api.php?longurl=http://maps.google.com?q=%LOCN) and let us know if that works
     
    outkast25 likes this.
  8. outkast25

    outkast25 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    313
    Likes Received:
    15
  9. lifeonmtv

    lifeonmtv Well-Known Member This Topic's Starter

    Joined:
    Jun 5, 2010
    Messages:
    256
    Likes Received:
    49
    Yep, that link seems to be using GPS location (%LOC). GPS takes longer to fix a location, and the phone needs to be in a 'gps-able' location. Maybe tasker isn't having enough time to get a gps fix. This is why i separated mine into 2 different profiles one for network location and one for gps location :).

    You can try using gps fix as per this guide How to Roll Your Own "Find My iPhone" for Android and try to force tasker to wait until gps location is fixed before moving onto the next task.

    If using %LOCN instead of %LOC it will use network based location coordinates. These coordinates won't be as accurate, but it will at worst give you a ballpark area of where the phone is, and tasker is very quick to obtain the network location coordinates so you shouldn't get the same bug.

    But yeah, to be honest I never had it return the coordinates (0,0) pretty weird!
     
  10. outkast25

    outkast25 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    313
    Likes Received:
    15
    i set it to wait 1 minute to find its location... should i set it longer?
     
  11. shgavman

    shgavman New Member

    Joined:
    Jan 31, 2011
    Messages:
    2
    Likes Received:
    0
    Thanks lifeonmtv. Fantastic post.

    I'm having a little difficulty getting the mobile data to turn on.

    I typically use a toggle on my home screen to switch mobile data on/off because I pay a lot for mobile internet and try to keep it's use to a minimum. Is there any way of getting tasker to 'tap' this toggle switch based on an sms received because the ['Mobile Data' on] task doesn't seem to be working.

    Thanks.
     
  12. brandall

    brandall Member

    Joined:
    Apr 12, 2011
    Messages:
    5
    Likes Received:
    0
    Hi Lifeonmtv

    I've started a thread over at xda to create profiles that will increase your chances of recovering your device if it's lost or stolen and greatly enhance and overcomplicate the example on the wiki (!).

    Found this thread Google'ing for some more inspiration and looking at what you've done here, your input would be greatly appreciated.

    Hope to see you there

    [DEV] Tasker
     

Share This Page

Loading...