Capture photo when pattern is used to unlock

stravisk

New member
Hello everyone! I am VERY new to this but I wanted to share one I created, and also ask for some input on how to improve it.

I wanted to create a simple macro to capture a front facing phone whenever my phone is unlocked without biometrics. Right now I'm using a pattern as the backup unlock, so this macro is written specifically for that by utilizing the Screen Content trigger watching the app System UI for the keywords "draw unlock pattern". I'm looking for any input on how you would do it so that maybe if I decide to change to a pin unlock it will work as well. Let me know your thoughts!Front_photo_when_pattern_unlock_268515730780640.png
 

stravisk

New member
I don't recall being able to know how the device was unlocked. Maybe Logcat is the way.
Yeah the way I've got it right now seems like a workaround, although it does work about 90% of the time. If I'm super fast at drawing my pin the screen content monitor doesn't seem to trigger.
 

Endercraft

Moderator (& bug finder :D)
Yeah the way I've got it right now seems like a workaround
It's a good thing that you found this workaround as people have been searching for this, so thank you !
If I'm super fast at drawing my pin the screen content monitor doesn't seem to trigger.
You can make it go faster by changing the update rate (either in trigger or global settings).
You make make it as low as 0.1s in most recents versions.
 

stravisk

New member
Well that's cool! I'm happy I was able to figure something out that others can use. I found that if you do not have a 2-3 second delay before it takes the photo it seems to interfere with being able to put your pattern in. Another thing, if people use a pin instead of a pattern, they could even change the trigger words to "emergency call" if that pops up on the screen while tying a pin (essentially and keywords that show up at that time). I've also been tweaking the original macro to include closing out recent apps too. Still a little glitchy.
Also, I'd recommend having the photos be stored in a hidden folder and make sure hidden files and folders are turned off so the pictures don't show in My Files or Gallery.
 

Endercraft

Moderator (& bug finder :D)
I found that if you do not have a 2-3 second delay before it takes the photo it seems to interfere with being able to put your pattern in.
You can use a wait for trigger (screen unlocked) action instead.

In recent Android versions, taking a photo in background is not possible so you have to launch MacroDroid first.
 
Top