Smart Unlock By Face with Tasker

135 views
Skip to first unread message

mysterious10394

unread,
Jun 3, 2018, 4:38:05 AM6/3/18
to Tasker
While going over the option to overcome the swipe gesture if your face is detected, the closest tutorial was to have AutoInput disable keyguard. However, I wanted to see if Tasker could also work since I have a rooted phone.

This solution needs root privileges without Accessibility while AutoInput does not require root.

Needed items are Android with:

  • Enabled Smart lock in active Trust agents within Settings > Security & location > Trust agents,
  • Set up Trusted face in Smart lock in Settings > Security & location > Smart lock
  • Tasker has root privileges
Successful steps:
  • In Tasker Vars, create variable named %TrustedFace and set to 0
  • Create Tasker task named accordingly
  • Add Wait step with 500ms ; You may find shorter times are available to complete this task.
  • Add Run Shell step with dumpsys trust | sed -n '5p' | cut -d',' -f4 | cut -d'=' -f2 , Use Root on, and Store Output In %TrustedFace
  • Add Run Shell step with input swipe 540 1915 540 960, Use Root on, and IF %TrustedFace ~ 1 ; I did not find the keyguard off nor the toggle step working, so I manually swiped upward using half my resolution (540) in the horizontal direction and somewhat from the bottom to halfway up vertically ; Your swipe gesture may need to be adjusted
  • In Tasker Profiles, create a profile that uses the previous task on the Display On Event. Do not confuse this with State > Display.
Attached is the XML. You likely will find the AutoInput way easier and more supportive of the developer, but this was an interesting challenge to understand manually.
keyguard_off.xml
Reply all
Reply to author
Forward
0 new messages