FORUMS
Remove All Ads from XDA

How to disable the keyguard with Tasker

7 posts
Thanks Meter: 2
 
By LeBobbo, Junior Member on 30th October 2018, 12:49 AM
Post Reply Email Thread
Hi,

Being able to disable the keyguard can be useful in some situations. For instance, you may want to keep your device unlock when staying at home. The common way to do this is to use the Tasker plugin SecureTask. The plugin has first to be set as device owner (see baldapps.altervista.org/deviceowner.html for the details). Unfortunately, some of the Samsung devices with Oreo do not allow device administrator. The device is locked with the following message "Unauthorized software has been installed on your device. Workspace has been locked to prevent unauthorized access. Contant your admin".

I found another way to disable the keyguard with the command "locksettings" for devices with Android Oreo or newer. To create a action to disable the keyguard, you have to choose: Create a new Action -> Category Code -> Run Shell. Then, the command text field should contain the following code: "locksettings clear --old XXXX" with XXXX being your pin code. For the action to enable the keyguard, the code should be "locksettings set-pin XXXX". You have to use root for both of these actions. "locksettings" can also be used with pattern and password. See here: android.googlesource.com/platform/frameworks/base/+/android-8.0.0_r1/cmds/locksettings/src/com/android/commands/locksettings/LockSettingsCmd.java.
30th October 2018, 07:28 PM |#2  
Senior Member
Thanks Meter: 157
 
More
There is an easy reliable workaround for non-root devices:

When at Home-WLAN or in car:
Just use tasker's custom settings to set the "lock_screen_lock_after_timeout" to e.g. 4 hours.

This means that after display off the device is unlocked for 4 hours. When you leave home or car, just the the value back to 30 sec.
30th October 2018, 07:47 PM |#3  
OP Junior Member
Thanks Meter: 2
 
More
If my understanding is correct, changing the value of "lock_screen_lock_after_timeout" does not actually unlock the device. You still need to unlock and then it will stay unlocked for the duration specified by lock_screen_lock_after_timeout. The command "locksettings" completely disable the keyguard.


Quote:
Originally Posted by Tatsch

There is an easy reliable workaround for non-root devices:

When at Home-WLAN or in car:
Just use tasker's custom settings to set the "lock_screen_lock_after_timeout" to e.g. 4 hours.

This means that after display off the device is unlocked for 4 hours. When you leave home or car, just the the value back to 30 sec.

1st November 2018, 02:18 AM |#4  
Senior Member
Thanks Meter: 157
 
More
Of course, but for me that doesn't matter in everyday life. If the phone is currently locked, a one-time unlock is sufficient.

The main thing is that the device is always unlocked at home and in the car.
2nd November 2018, 09:57 AM |#5  
Senior Member
Thanks Meter: 91
 
More
Do you think it would be possible to disable the lockscreen of an oreo rooted phone without knowing if it is protected by a pattern or a pin or a password? Disabling keyguard with the secure settings app does not work.
2nd November 2018, 10:26 AM |#6  
OP Junior Member
Thanks Meter: 2
 
More
Yes, it is possible. But, you have to provide the pin code, pattern code or password.


Quote:
Originally Posted by lucaterpirla

Do you think it would be possible to disable the lockscreen of an oreo rooted phone without knowing if it is protected by a pattern or a pin or a password? Disabling keyguard with the secure settings app does not work.

The Following User Says Thank You to LeBobbo For This Useful Post: [ View ] Gift LeBobbo Ad-Free
2nd November 2018, 07:52 PM |#7  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
Quote:
Originally Posted by lucaterpirla

Do you think it would be possible to disable the lockscreen of an oreo rooted phone without knowing if it is protected by a pattern or a pin or a password? Disabling keyguard with the secure settings app does not work.

I have previously posted my method of "disabling" lock screen when I'm at home. I use a stupid silly long lock screen after sleep time out. This is executed as a run shell action with run as root enabled.

To "disable" the lock screen (delay for 24 hours after sleep);

settings put secure lock_screen_lock_after_timeout 86400000

Then to enable the lock after screen off (delay 5 seconds after sleep);

settings put secure lock_screen_lock_after_timeout 5000

This method,while a bit goofy, has been working reliably for me since Lollipop on an N6 and I'm currently on Pie on an essential PH-1.

There is also the tried and true Smart Lock feature in modern Android.

I'm not at all sure it will work on every device, and likely not on Samsung touchwiz devices.



"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
2nd November 2018, 11:54 PM |#8  
Senior Member
Thanks Meter: 157
 
More
@ktmom
This is what I described above.

But there is no need to be rooted.

Use instead Tasker's "Custom Setting".
6th November 2018, 10:27 PM |#9  
ktmom's Avatar
Senior Member
Thanks Meter: 2,423
 
More
Quote:
Originally Posted by Tatsch

@ktmom
This is what I described above.

But there is no need to be rooted.

Use instead Tasker's "Custom Setting".

You either must be rooted (and tick the user root option) or use ADB and give write settings permission to Tasker (or AutoTools).

There are several ways to achieve the same goal these days.

My answer was really directed to a specific question describing a rooted phone



"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
7th November 2018, 07:34 AM |#10  
Senior Member
Thanks Meter: 157
 
More
@ktmom Ok. But many other users will read this thread. And it's much easier just executing one adb-command than rooting the phone.
28th November 2019, 11:36 PM |#11  
Member
Thanks Meter: 18
 
More
This is a very elegant solution. I've been using SecureTask for years, but for some reason now the broadcast for disable keyguard isn't being sent (no idea why). Is it supposed to remove the lockscreen completely, or just disable the keyguard? Currently it will remove the passcode fine, but I still have to slide up to unlock.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes