Using ADB to change the screen lock I am looking for a way to change the screen lock type from slide to password, and set the password via adb command line. I have a device with the setup I want, and one that has slide lock. I'm pretty sure this can be accomplished via sqlite3 "copy paste" of some fields, but not sure which fields, and how to do it. I'm open to pretty much all ideas except using adb shell input commands to accomplish this. Meaning - I can/know how to/am currently using commands input swipe input text input tap commands to change swipe unlock to password unlock.

edit1: clarified adb shell input, and yes, my phone is rooted.

edit2: relevant links:
How to change lock screen type
Pass encryption on android
According to the post in the first link, it should be easy to change the lockscreen type, the only problem is that I cannot find the lockscreen.password_type field in the database they refer to. Has it moved in 4.3? After reading through the article in the second link my idea became to use the salt number stored in the database to hash out a new password using the device specific salt, and override the existing (if any) password. I'm still trying to figure out how to do this.
Since Android 8.0 Oreo, you can change the lock screen using below adb commands

adb shell

athene_f:/ $ locksettings
usage: locksettings set-pattern [--old OLD_CREDENTIAL] NEW_PATTERN

   locksettings set-pin [--old OLD_CREDENTIAL] NEW_PIN
   locksettings set-password [--old OLD_CREDENTIAL] NEW_PASSWORD
   locksettings clear [--old OLD_CREDENTIAL]
   locksettings verify [--old OLD_CREDENTIAL]
   locksettings set-disabled DISABLED
   locksettings get-disabled

flags:
   --user USER_ID: specify the user, default value is current user



locksettings set-pin: sets a PIN
locksettings set-password: sets a password
locksettings clear: clears the unlock credential
locksettings verify: verifies the credential and unlocks the user
locksettings set-disabled: sets whether the lock screen should be disabled
locksettings get-disabled: retrieves whether the lock screen is disabled


And if you want to remove the password, just use below code:

$ locksettings clear --old old_password_put_here


Here is the reference link: The Android Soul - How to change or remove lock screen pattern, PIN or password via ADB on Android 8.0 Oreo

I have tested on Android Oreo device. It works just fine.