I don't want to upload all my pictures, just the failed unlock attempt ones, so I am not sure if DropBox will work. Unless I can force DropBox to synchronize certain folders via Tasker, not sure what else I can do.
As for how to do this, it's easy, but you have to use the 'Secure Settings' plugin (not sure if you need root for this specific task, since I was rooted already).
- Install the free Secure Settings plugin and add a new profile to Tasker.
- Select 'State > Plugin > Secure Settings' as the trigger, and pick the 'Failed Login Attempts' condition.
- Now you have to create the action which will take the picture, which you can find under 'Media'. If you want a new file every time a pic is taken, use the 'Photo Series Time' action, or if you want to use the same name every time, use 'Photo'. I use both methods, in case there are multiple attempts, while also having access to the latest pic using a static file name. Don't forget to select the 'Discrete' option.