• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][Difficulty: Beginner] Take a Picture and Grab Location on Failed Unlock

Search This thread

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
Hello everyone. Here's a quick and easy Tasker profile for anyone wanting to beef up the security on their phone. There are many apps that can do this for you, but if you would like to customize exactly what information gets recorded and where it gets sent to then implementing this feature in Tasker is your best bet.

Prerequisites

  1. Secure Settings plug-in
  2. Cloud Sync plug-in such as Dropsync or Foldersync (OPTIONAL)
  3. Pushbullet or Join for notifying your other devices (OPTIONAL)

Instructions


  1. Ensure that Secure Settings is set as a Device Administrator by opening the app and going to the Preferences screen. This is so the plugin has the ability to monitor unlocking attempts.
  2. Open Tasker, and create a new profile by clicking on the + sign on the bottom-right. Name your profile 'Discreet Picture' or whatever it is you like.
  3. Create a "State" context and select "Secure Settings" under the "Plugin" state category.
  4. Press the pencil icon to open up Secure Setting's options. Expand the "Conditions" arrow and choose the "Failed Login Attempts" option.
  5. Under "Maximum Failed Login Attempts" enter the number of failed login attempts that must occur before the context is fired. Also, double check that "Device Admin Enabled" is already checked. If not, go back and enable it.
  6. Click the save icon up top to exit configuring the Secure Settings context. When you're back in the Tasker screen, press your back key to exit setting up the context.
  7. Tasker will now ask you to set up a new task associated with this context. Click on "New Task" and optionally give the task a name. Before we move on, here's a picture of what the context screen should look like.
yxD5T9Q.jpg


Now that you've set up the context, it's actually time to set up the task that fires when an incorrect lock-screen input is detected. For each instruction listed below, press "+" at the bottom to bring up the list of Actions you can choose from.

  1. Variables --> Variable Convert. Under Name type in %TIMES or select it from the list of built-in variables by pressing on the note icon. Under Function, choose "Seconds to Medium Date Time" and under Store Result In type in %date.
  2. Media --> Take Photo. Under Camera pick the Front camera. For the filename, type in %date. Deselect "Insert in Gallery" to ensure that the photo can't be seen in any gallery apps. Select "Discreet" to disable the shutter sound when Tasker takes the photo. For Resolution, you can pick whatever you want, however I would recommend selecting a high resolution to get a clear picture. Leave everything else as default.
  3. OPTIONAL: If your phone is rooted, you can toggle location services to ensure it's on by going to Secure Settings and selecting Location Mode under the System+ dropdown. You would first have to enable the System+ Module within Secure Settings before the application will allow you to select this option, however. If you are unrooted, then your only option to automate enabling location services is to use an app like AutoInput to simulate touch inputs.
  4. Location --> Get Location. For source, I would recommend "Any" to ensure Tasker can get an accurate lock on your location.
    neNwpSQ.jpg
  5. OPTION A: Phone --> Send SMS. Under Number, you can choose a telephone number to send an SMS with the location to. Just put %LOC under Message and Tasker will populate the SMS Message with whatever GPS coordinates it pulled earlier.
  6. OPTION B: Plugin --> Pushbullet. Open Pushbullet settings, and select the device you want to push to. For the title, you can set something that will alert you. In the message, put %LOC under Message to populate the GPS coordinates.
  7. OPTION C: File --> Write File. Under File, type in /sdcard/DCIM/Tasker/%date.txt in order to write to a text file named with the date that the incorrect attempt was made. Under Text, type in %LOC.
  8. OPTION C (cont.): Plugin --> Dropsync/Foldersync. Make Tasker perform a manual sync of the /sdcard/DCIM/Tasker folder. I recommend you set up either app to upload the file then delete it from your phone.

That's it! Your phone should now notify you with a picture and a location whenever an incorrect unlock attempt has been made.
 
Last edited:

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
I'm missing where the photo is attached to the sms. Does that only work with option c?

Good point! I based it off of my own set-up, which uses Option C, but unfortunately you can't automatically compose and then send an MMS without the screen being temporarily unlocked then locked, as Tasker only allows you to compose an MMS but not immediately send it. You would have to quickly unlock the screen in the background, then use AutoInput to paste the message and send it to the right number. But temporarily unlocking it when it's in a thief's possession would be risky, no?
 

DarkFrenzy

Senior Member
Feb 4, 2014
1,053
769
Male'
This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol
 
  • Like
Reactions: bitly07

Paramvir Singh

Senior Member
Jul 18, 2015
117
20
lol

This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol

My phone's twrp will be locked!!:D:silly:
 

renolz

Senior Member
Jun 23, 2015
174
83
This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol

I can't say i fully agree. Ofcourse one can get their phone stolen by someone that knows their way around a phone BUT, seeing as 90%+ of phone users worldwide have no clue what "TWRP" or "Custom Recovery" is, i think this feature will work great for many users.
One can ofcourse be unlucky and get their phone stolen, but mostly phones are lost / forgot somewhere.

Thanks for this @MishaalRahman, great feature! :)

- Renolz
 

Mbariah

Senior Member
Nov 23, 2012
214
105
Nairobi
I can't say i fully agree. Ofcourse one can get their phone stolen by someone that knows their way around a phone BUT, seeing as 90%+ of phone users worldwide have no clue what "TWRP" or "Custom Recovery" is, i think this feature will work great for many users.
One can ofcourse be unlucky and get their phone stolen, but mostly phones are lost / forgot somewhere.

Thanks for this @MishaalRahman, great feature! :)

- Renolz

I doubt most people in the 90%+ can even follow half this tutorial; before we get to TWRP. Unless this gets an easier way to do this, I don't see it helping that many users outside XDA
 

ZanaKhan

New member
Jul 27, 2015
3
1
This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol

This is not useless at all. I wouldn't rely on this method to recover my phone if it's stolen, I just want to know if someone tries to unlock it without my permission :)
And people do try to unlock it when they find it, unless they know further about Android and its possibilities.
 

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
10 times failed attempt then erase the phone.use the open recovery script

This is a good idea, and especially great now that Marshmallow gives you so many chances to unlock! However, I'm a bit wary trusting things not to go wonky on me and randomly wiping my phone...call me paranoid.

Great idea but it´s a lot easier if you use a Anti-Theft App like eg. Cerberus if you´re rooted anyway ;)

Yup, Cerberus can do it, but it's a paid service.

Deleting gesture.key removes security lock?

If you have TWRP, then yes essentially anyone can remove the security from your phone. IF they know what file they need to delete. This is why you should flash your ROM and then flash stock recovery + lock bootloader again if you truly want to run custom but still be secure.


Check to make sure that there's no .nomedia file in /sdcard/DCIM/Tasker preventing it from showing up. Try connecting your phone to your computer to double check.

While this is still true, the word you're looking for is discreet. Wildly different meanings.

Oops.
 
  • Like
Reactions: pocketrule

nicesoni_ash

Senior Member
May 26, 2012
6,091
10,951
127.0.0.1
This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol
This will only work for pattern lock, if the user has pin lock it won't work.
Deleting gesture.key removes security lock?
Only the pattern lock.
 
  • Like
Reactions: Me_Ashish_

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Hello everyone. Here's a quick and easy Tasker profile for anyone wanting to beef up the security on their phone. There are many apps that can do this for you, but if you would like to customize exactly what information gets recorded and where it gets sent to then implementing this feature in Tasker is your best bet.

    Prerequisites

    1. Secure Settings plug-in
    2. Cloud Sync plug-in such as Dropsync or Foldersync (OPTIONAL)
    3. Pushbullet or Join for notifying your other devices (OPTIONAL)

    Instructions


    1. Ensure that Secure Settings is set as a Device Administrator by opening the app and going to the Preferences screen. This is so the plugin has the ability to monitor unlocking attempts.
    2. Open Tasker, and create a new profile by clicking on the + sign on the bottom-right. Name your profile 'Discreet Picture' or whatever it is you like.
    3. Create a "State" context and select "Secure Settings" under the "Plugin" state category.
    4. Press the pencil icon to open up Secure Setting's options. Expand the "Conditions" arrow and choose the "Failed Login Attempts" option.
    5. Under "Maximum Failed Login Attempts" enter the number of failed login attempts that must occur before the context is fired. Also, double check that "Device Admin Enabled" is already checked. If not, go back and enable it.
    6. Click the save icon up top to exit configuring the Secure Settings context. When you're back in the Tasker screen, press your back key to exit setting up the context.
    7. Tasker will now ask you to set up a new task associated with this context. Click on "New Task" and optionally give the task a name. Before we move on, here's a picture of what the context screen should look like.
    yxD5T9Q.jpg


    Now that you've set up the context, it's actually time to set up the task that fires when an incorrect lock-screen input is detected. For each instruction listed below, press "+" at the bottom to bring up the list of Actions you can choose from.

    1. Variables --> Variable Convert. Under Name type in %TIMES or select it from the list of built-in variables by pressing on the note icon. Under Function, choose "Seconds to Medium Date Time" and under Store Result In type in %date.
    2. Media --> Take Photo. Under Camera pick the Front camera. For the filename, type in %date. Deselect "Insert in Gallery" to ensure that the photo can't be seen in any gallery apps. Select "Discreet" to disable the shutter sound when Tasker takes the photo. For Resolution, you can pick whatever you want, however I would recommend selecting a high resolution to get a clear picture. Leave everything else as default.
    3. OPTIONAL: If your phone is rooted, you can toggle location services to ensure it's on by going to Secure Settings and selecting Location Mode under the System+ dropdown. You would first have to enable the System+ Module within Secure Settings before the application will allow you to select this option, however. If you are unrooted, then your only option to automate enabling location services is to use an app like AutoInput to simulate touch inputs.
    4. Location --> Get Location. For source, I would recommend "Any" to ensure Tasker can get an accurate lock on your location.
      neNwpSQ.jpg
    5. OPTION A: Phone --> Send SMS. Under Number, you can choose a telephone number to send an SMS with the location to. Just put %LOC under Message and Tasker will populate the SMS Message with whatever GPS coordinates it pulled earlier.
    6. OPTION B: Plugin --> Pushbullet. Open Pushbullet settings, and select the device you want to push to. For the title, you can set something that will alert you. In the message, put %LOC under Message to populate the GPS coordinates.
    7. OPTION C: File --> Write File. Under File, type in /sdcard/DCIM/Tasker/%date.txt in order to write to a text file named with the date that the incorrect attempt was made. Under Text, type in %LOC.
    8. OPTION C (cont.): Plugin --> Dropsync/Foldersync. Make Tasker perform a manual sync of the /sdcard/DCIM/Tasker folder. I recommend you set up either app to upload the file then delete it from your phone.

    That's it! Your phone should now notify you with a picture and a location whenever an incorrect unlock attempt has been made.
    2
    This is useless. (especially peoples like me steal a smart phone) there will be no internet connection and if the there is an internet connection thief will not try to guess the password or pattern he will flash twrp and remove the /data/system/gesture.key and he will get access easily hahahahha lol

    I can't say i fully agree. Ofcourse one can get their phone stolen by someone that knows their way around a phone BUT, seeing as 90%+ of phone users worldwide have no clue what "TWRP" or "Custom Recovery" is, i think this feature will work great for many users.
    One can ofcourse be unlucky and get their phone stolen, but mostly phones are lost / forgot somewhere.

    Thanks for this @MishaalRahman, great feature! :)

    - Renolz
    2
    Every thing works fine, but is there any way I can sync the picture with Google drive?

    Thnx

    Sent from my LG-H961N using Tapatalk

    Follow OP's tut, except replace FolderSync or DropSync with the attached picture. I blame my lurking for lack of links. Sorry.
    1
    this is genius. should be a security feature in android
    1
    Fingerprint scanner

    Does this work with the fingerprint scanner? I mean if the login fails by using a wrong fingerprint, does this click a picture?