AutoInput Smart Unlock By Face with Tasker

Discussion in 'Guides / Examples / Ideas Forum' started by m1st0, Jun 3, 2018.

  1. m1st0

    m1st0 New Member

    Joined:
    Jun 3, 2018
    Messages:
    1
    Likes Received:
    0
    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.
     

    Attached Files:

  2. luks_abido

    luks_abido New Member

    Joined:
    May 13, 2020
    Messages:
    9
    Likes Received:
    0
    Really cool.
    Now it may be possible to detect face/smart lock with the new logcat events.
    Should be more reliable and quicker.
     

Share This Page