• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Profile] [front Camera] Photo/email image of device intruder

SUroot

Extreme Android User
May 25, 2010
23,907
5,306
Riddlesden, West Yorkshire, UK
This is a mid-level complexity profile that takes a photo of someone who incorrectly enters your pattern lock (in this example) twice and emails it to you.

This is based on multiple examples found but this is my own spin on it.

The filename of the photo is always the same so it overwrites itself, saving space because if, like me, you often put your pattern in wrong, you'll end up with a million pictures of yourself :)

Pre-requsites:

  1. SL4a apk - android-scripting.googlecode.com
  2. Secure settings - Google Play
  3. Folder \sdcard\sl4a\scripts containing - sendemailA.py
  4. Python - Install through SL4a as below:
    Only shell is included with the ASE install. Other interpreters must be installed separately. To add another interpreter:

    Press the menu button
    Tap "View"
    Tap "Interpreters"
    Press the menu button
    Tap "Add"
    Select the interpreter you would like to install
    The selected interpreter will be downloaded via the Android web browser. Once it's finished downloading, tap the download notification to start the installation process as you would for any other downloaded APK.

    After installing the interpreter APK, start it and tap the "Install" button. The interpreter, interpreter extras, and example scripts (if available) will be downloaded to /sdcard/xxx.zip and then extracted to /data/data/com.googlecode.android_scripting/files/xxx, /sdcard/sl4a/extras/xxx, and /sdcard/sl4a/scripts respectively.

    Source - InstallingInterpreters - android-scripting - A howto for installing additional interpreters. - Scripting Layer for Android brings scripting languages to Android. - Google Project Hosting

    I have attached the profile exported xml, in a zip. Put this (extracted) in /sdcard/tasker/profiles/. You will still need to do the above and add your email address and password to the tasks below though, but should save some time. UNTESTED
Creating the profile:

Profile
  • Add (+) Profile, name "Intrusion"
Context
  • Select State > Plugin > Secure Settings > configuration Edit > Failed Login Attempts > (set your number, Tick "Device admin" and save
Task
  • New Task
  • + Media > Take Photo > Camera "Front" > Filename "Last-intruder" (and apply)
  • + Variable > Variable Set > name "%EMAIL_USER" to youremailaddress@here.com
  • + Variable > Variable Set > name "%EMAIL_PSWD" to youremailpassword
  • + Variable > Variable Set > name "%EMAIL_TO" to youremailaddress@here.com
  • + Variable > Variable Set > name "%EMAIL_SUBJECT" to "SGS3 INTRUSION ATTEMPT"
  • + Variable > Variable Set > name "%EMAIL_ATTACH" to "/sdcard/DCIM/Tasker/last-intruder.jpg"
  • + Script > Run SL4A Script > Name (Search icon) sendemailA.py > Pass variables " %EMAIL_USER,%EMAIL_PSWD,%EMAIL_TO,%EMAIL_ATTACH,%EMAIL_SUBJECT "
  • Apply

PicsArt_1347344955048.png
 

Attachments

  • profiles.zip
    1 KB · Views: 993
So I'm trying to figure out how to move the snapped picture, but don't know how to go about this.

Trying to setup a new profile, I found event > file > file attribute change, file deleted, file moved, file closed, file modified, and file opened.

Was thinking file modified, but it asked for a specific file name. But I have the snap picture name the file chronologically.

Any suggestions?
 
Upvote 0
This is great! I'm going to try this out.

Do the folders with path /sdcard need to be on the internal memory?
I was wondering because of the /sdcard/DCIM/Tasker/ path for the photo; does Tasker save photos here by default? Asking because my DCIM folder is on extSdcard.

I'm assuming the /scripts folder will need to be on /sdcard.
 
Upvote 0
So I'm trying to figure out how to move the snapped picture, but don't know how to go about this.

Trying to setup a new profile, I found event > file > file attribute change, file deleted, file moved, file closed, file modified, and file opened.

Was thinking file modified, but it asked for a specific file name. But I have the snap picture name the file chronologically.

Any suggestions?

If you prefix the filename, can you use a wildcard?
 
Upvote 0
This is great! I'm going to try this out.

Do the folders with path /sdcard need to be on the internal memory?
I was wondering because of the /sdcard/DCIM/Tasker/ path for the photo; does Tasker save photos here by default? Asking because my DCIM folder is on extSdcard.

I'm assuming the /scripts folder will need to be on /sdcard.

Mine too. No it defaults here. Tasker (like many apps) does not know about extSdCard. Cannot find a setting.

This profile will keep a maximum of 1 image there
 
Upvote 0
If you prefix the filename, can you use a wildcard?

it didn't work.

i named the photo "tried" with the chronological setting. this names the files "tried.2012-09-12-06-44.jpg" then in the file move profile, i tried to identify it with "tried.*.jpg" and "tried.*" and when testing via failed unlock and trying to press the play button, it didn't work.

however from pressing the play button, i was able to see an error "file does not exist". so it sounds like it has to be an exact match.

i also tried to just in general pay attention to the /Tasker/ folder, and still the same results.
 
Upvote 0
This is a mid-level complexity profile that takes a photo of someone who incorrectly enters your pattern lock (in this example) twice and emails it to you.

This is based on multiple examples found but this is my own spin on it.

The filename of the photo is always the same so it overwrites itself, saving space because if, like me, you often put your pattern in wrong, you'll end up with a million pictures of yourself :)

Pre-requsites:


  1. SL4a apk - android-scripting.googlecode.com - This should now come with Tasker.
  2. Secure settings - Google Play
  3. Folder \sdcard\sl4a\scripts containing - sendemailA.py
  4. Python - Install through SL4a as below:
Creating the profile:


Profile
  • Add (+) Profile, name "Intrusion"
Context
  • Select State > Plugin > Secure Settings > configuration Edit > Failed Login Attempts > (set your number, Tick "Device admin" and save
Task
  • New Task
  • + Media > Take Photo > Camera "Front" > Filename "Last-intruder" (and apply)
  • + Variable > Variable Set > name "%EMAIL_USER" to youremailaddress@here.com
  • + Variable > Variable Set > name "%EMAIL_PSWD" to youremailpassword
  • + Variable > Variable Set > name "%EMAIL_TO" to youremailaddress@here.com
  • + Variable > Variable Set > name "%EMAIL_SUBJECT" to "SGS3 INTRUSION ATTEMPT"
  • + Variable > Variable Set > name "%EMAIL_ATTACH" to "/sdcard/DCIM/Tasker/last-intruder.jpg"
  • + Script > Run SL4A Script > Name (Search icon) sendemailA.py > Pass variables "%EMAIL_TO,%EMAIL_ATTACH,%EMAIL_SUBJECT"
  • Apply
PicsArt_1347344955048.png
Takes pic sends to my drop box but does not send me an email??Followed all the steps ?????
 
Upvote 0
i dont have a sl4a App. sl4a was alreadry installed on my version of tasker. Where do i press sendemailA.py ????
download sl4a app. file is there when i try to run it from app or tasker i get this:
"Sorry!
The application SL$A(process com.googlecode.android_scripting) has stopped unexpectedly. Please try again."
Wont let me take a screen shot of that screen. Looks like a System error???:thinking:
Edit:
1. Downloaded sl4a app installed 2. Installed python 3. Added @gmail.com to email.
4. WORKING like a charm.
Thanks a lot SUroot for all the help anf feed back.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones