PIN 码 该密码保存在/data/misc/keystore/user_0/.masterkey ,可以在adb shell之后, ls -al /data/misc/keystore/user_0/.masterkey。
系统锁屏密码数据库存储位于 /data/system/locksettings.db
private LockscreenCredential mChosenPassword;
LockPatternUtils mLockPatternUtils;
mLockPatternUtils = new LockPatternUtils(this);
int userId = UserHandle.myUserId();
public void createPin(String password) {
// final String passwordText = "123456";
mChosenPassword = LockscreenCredential.createPin(password);
// mChosenPassword = LockscreenCredential.createNone();
Log.i(TAG, "mChosenPassword =" + mChosenPassword);
//设置PIN码
final boolean success = mLockPatternUtils.setLockCredential(mChosenPassword, LockscreenCredential.createNone(), userId);
Log.i(TAG, &#