Android系统中的locksettings命令
分类:Android, Android, Java, Operating System
阅读 (3,538)
3月 202020
本文基于Android8.1系统
进入Android系统的命令行控制台,可以通过locksettings命令来设置锁屏的一些选项,比如开启或者禁止锁屏,设置密码等
命令行的帮助如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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-pattern: sets a pattern A pattern is specified by a non-separated list of numbers that index the cell on the pattern in a 1-based manner in left to right and top to bottom order, i.e. the top-left cell is indexed with 1, whereas the bottom-right cell is indexed with 9. Example: 1234 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 |
命令举例如下:
允许锁屏
locksettings set-disabled DISABLED
默认不锁屏
locksettings set-disabled true
这个命令对应的系统源码在下面这个文件中:
1 |
frameworks/base/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java |
Sorry, the comment form is closed at this time.