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

Search This thread

DarkFrenzy

Senior Member
Feb 4, 2014
1,056
772
Male'
This will only work for pattern lock, if the user has pin lock it won't work.

Only the pattern lock.

yes thats for pattern lock only i was not teaching how to remove all the locks i just gave an example.
For password, remove password.key or remove all the files which end with .key in /data/system/ and restart or if its a pattern lock just draw any pattern and it will unlock or if it is a pin restart after removing the .key files
 

FenrirMX

Senior Member
Apr 5, 2012
338
134
Troy, MI
Ok, so I added this task, but I had to make a few adjustments.
Here's a couple of things I found:

1. It didn't work for me when converting the variable to Medium Date. Only to Datetime.
2. It only works on my old JB phone. According to Secure Settings, Login Attempts is broken on 5.0. Don't know if it's fixed in newer versions, I have nothing newer to test with.
3. It seems to only work on the first failed login attempt. Any further tries will not produce a photo. Even if you login successfully and try a failed attempt later.

So, this is cool, but it doesn't really work as advertised :p
 

MishaalRahman

Retired Editor in Chief
Nov 2, 2015
1,043
2,142
www.xda-developers.com
Ok, so I added this task, but I had to make a few adjustments.
Here's a couple of things I found:

1. It didn't work for me when converting the variable to Medium Date. Only to Datetime.
2. It only works on my old JB phone. According to Secure Settings, Login Attempts is broken on 5.0. Don't know if it's fixed in newer versions, I have nothing newer to test with.
3. It seems to only work on the first failed login attempt. Any further tries will not produce a photo. Even if you login successfully and try a failed attempt later.

So, this is cool, but it doesn't really work as advertised :p

I'm on a Nexus 6p on 6.0.1 and it works for me on first failed attempt.
 

FenrirMX

Senior Member
Apr 5, 2012
338
134
Troy, MI
Ok, this is what I'm talking about.
Second screenshot is my Android version.
 

Attachments

  • 1457664681194.jpg
    1457664681194.jpg
    29.8 KB · Views: 271
  • 1457664785788.jpg
    1457664785788.jpg
    36.4 KB · Views: 273

troymz1

Senior Member
Jul 7, 2014
275
107
Google Pixel 6
3. It seems to only work on the first failed login attempt. Any further tries will not produce a photo. Even if you login successfully and try a failed attempt later.

So, this is cool, but it doesn't really work as advertised :p

I've noticed thus as well. It took one picture. Now I login and check it. Then I try to fail login again and nothing.
 

FenrirMX

Senior Member
Apr 5, 2012
338
134
Troy, MI
I've noticed thus as well. It took one picture. Now I login and check it. Then I try to fail login again and nothing.
I did some research, I think I found why it's not taking pictures every time.
Apparently, Android only counts it as a failed attempt when you hit 4 or more points in the pattern, despite the very clear message you get when you hit a couple of points.
I tried doing that and it did take a picture every time.
I'd point this out in the OP if possible :good:

As for my Secure Settings issue, turns out it's fixed in 5.1+ so yeah, I'm screwed :p
 
  • Like
Reactions: the.lirius

Rythyrix

Member
Aug 1, 2015
10
2
For those of us who are having trouble with Dropbox or other syncing services on Windows, there is an issue: Seconds to Medium Date Time (Long Date Time too, but not plain Date Time) returns a colon when delimiting hours/mins, and when you try to assign that to a filename, Windows won't accept it. To fix:

1) Open your Action to take a picture (I named mine Discreet Front Picture)
2) EITHER:
A) Change Variable Convert's Function from Seconds to Medium/Long Date Time, to Seconds to Date Time and accept the filename change
OR
B) Tap the + button at the bottom to add a new Action, Variables > Variable Search Replace.
3) Under Variable, use what you set Variable Convert's Store Result In (in the OP's tutorial, it's %date)
4) Since the colon ( : ) is what is giving Windows trouble, place one in the Search field.
5) Make sure that Replace Matches is checked, and put in something Windows will allow. A good idea is to use an underscore ( _ ). The other fields are optional, at least for this use. Press your device's Back button when done.
6) If you retrofitted your Action, the new Variable Search Replace is probably at the bottom. To fix that, long-press the Variable Search Replace action, then press the cut (scissors) option that appears at the top of the screen.
7) Now long-press the Action below where you want the Variable Search Replace to appear, in OP's tut it's Take Picture. Press Paste (the clipboard icon). Variable Search Replace should now be between Variable Convert and Take picture.

Hope this helps.
 

ruva

Member
Jul 5, 2010
42
1
Wao, cant follow the guide at all. Even can´t give the profile a new name. The plus in the bottom gives me only a menu. And the second part, after the first picture, its not for a Tasker noob.
 
Last edited:

weenan

Member
Dec 21, 2016
22
7
Does this work with the fingerprint scanner? I mean if the login fails by using a wrong fingerprint, does this click a picture?

I does not work for me. And if the profile is triggered the only way to deactivate it is to enter the right pin. If you unlock with fingerprint the profile stays active
 

loco-cork

Member
May 13, 2013
40
7
I know this thread is a bit old, but still it is a handy feature.
Would it be possible to make it take photo every time you unlock the phone with the pattern or pin, but not when you use a fingerprint?
 

niyonsv

Senior Member
Apr 17, 2013
448
115
OnePlus 7T
Hi, I tried this two days ago and was working without any issues. But from today this isn't working anymore. When I checked the profile inside Tasker I can't see secure setting's 'condition' menu in configuration. Admin rights and root is still enabled for Secure Settings. My phone is Lenovo Zuk Z2 Plus in Resurrection Remix 8.1 ROM.
 

niyonsv

Senior Member
Apr 17, 2013
448
115
OnePlus 7T
Can we recreate this task using the new custom-settings feature instead of the separate secure-settings app? The present secure-settings action works only once.
 

master-kenobi

New member
Mar 12, 2019
1
0
POST parameter for file

I am trying to send the photo snapshot via POST but I have no idea what is the POST parameter used for the file data. Any idea?
 
Jan 12, 2021
10
3
Hey guys, great instructions, I'm just experiencing one problem where i was not able to find a working solution on the net yet:

All works fine, event is triggered and task executed (trying it successfully playing sound). However, as soon as it comes into the "Take Photo" action, it gets stuck inside the procedure until you successfully unlock the phone - and then it takes the photo.

Now, I have a nice photo of myself, but none from "the unknown one messing around with my phone". Any ideas? I checked the rights of the camera, maximum permission I can give is "Allow while using the app" - should there be "Always"?

Phone: Poco X3 NFC with ArrowOS A12 Vanilla + microG and SecureTask.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    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?