Hello
previously I had the problem with an App called "Where's My Droid". The App was able to lock the Display (with the default system lock-screen) with sending a code by message to the phone followed by a four digit PIN and with this message the phone could be locked by activating and setting the display lockscreen.
The problem was, that the PIN could only be a maximum four digit code, which is not really secure, as the code could be found by trying ("only" 10000 attempts, but average only 5000, which is at least possible).
With Tasker it is possible to do this differently. At the easiest way I have two Profiles, one to set a PIN, the other is to unset the lock with a special unlock code by message. Here they are:
Profile "LockDisplay":
Event / Phone / Received Text / Type: Any; Content: mylockcodeword /
Task "lock_display":
1. Plugin / Secure Settings / Configuration 'Edit' / Dev Admin Actions / Password/Pin / 'Enabled' / Device Admin Enabled: YES / Pin Code / mylongpin, mylongpin / 'DISK-SYMBOL (Save)'
2. Plugin / Display / System Lock
Profile "UnlockDisplay":
Event / Phone / Received Text / Type: Any; Content: myunlockcodeword /
Task "unlock_display":
Plugin / Secure Settings / Configuration 'Edit' / Dev Admin Actions / Password/Pin / 'Disabled' / Device Admin Enabled: YES / 'DISK-SYMBOL (Save)'
I guess that this little script could be done as well with a codeword in the message (like in Where's My Droid) and not a predefined (in the Task) one, but it is OK for me like this. I have a ten digit code and this is enough I think ;)
frank
PS.: I put single quotes for Links or CommandButtons, double quotes for Names or Variables