If you forgot to remove the PIN, Pattern, Password before creating your backup in TWRP, then follow these steps to bypass the error you’re getting.
This week, I’ve been showing you how to create a Nandroid backup on the OnePlus 3. Then I showed you how to restore a Nandroid backup on the OnePlus 3, and lastly I showed you how to delete a Nandroid backup on the OnePlus 3. One the tutorials where I showed you how to create and restore the backup, I made a note that warned you about a bug some people are experiencing on the OnePlus 3 with TWRP.
It’s been advised to delete your PIN, Pattern or Password before you create your Nandroid back with the OnePlus 3 (this bug also effected other devices like the Nexus 5X and 6P too). If you don’t, then when you restore the Nandroid backup, Android might not recognize your PIN, Pattern or Password. It doesn’t matter if you enter it correctly, this bug is preventing people from logging back into Android and making them panic.
There is a quick and easy way around this though and that’s what I want to show you today.
OnePlus 3 TWRP Restore Unlock
- Boot the OnePlus 3 into Recovery Mode
- Tap on the ‘Mount’ Button
- Tap on the ‘System’ Partition to Mount it
- Tap the Home Button at the Bottom
- Tap on the ‘Advanced’ Button
- Tap on the ‘File Manager’ Button
- Tap on the ‘data’ Folder
- Scroll Down and Tap on the ‘system’ Folder
- Scroll Down and Tap on the ‘locksettings.db’ File
- Tap on the ‘Delete’ Button
- Swipe the White Arrows to the Right to Confirm
- Tap the ‘Back’ Button and Make Sure the File is Deleted
- Tap the Home Button at the Bottom
- Tap the ‘Reboot’ Button
- Then Tap on the ‘System’ Button to Reboot into Android
Note – If you still can’t boot into Android, you may need to go back into the OnePlus 3 Recovery Mode and go through these same steps again. Except this time, you’ll want to delete the locksettings.db-shm, locksettings.db-wal, gatekeeper.password.key, and gatekeeper.pattern.key. I wasn’t required to do that in the video shown below, but some people have needed to delete all of these files to get it to work on their setup.
This bug has been present with TWRP for a little while now. I know it was very prevalent on the Nexus 5X as well as the Nexus 6P and it seems to be because of the way Android is handling this PIN/Pattern/Password data (I’m assuming it’s because of encryption). Not everyone is experiencing this though. When I tested this issue the first time, it didn’t happen to me. It wasn’t until I tried it a few more times (after tinkering with the settings) that I was able to get the bug to trigger.
If you are experiencing this, you have probably already done the restore process and now you’re unable to boot into Android. So go ahead and power down the OnePlus 3 and then boot it up into Recovery Mode as described in the tutorial that I linked in the guide above. Once you are back into TWRP, tap on the Mount button and then make sure the System partition is mounted/checked. From here, tap on the Home button so we can go back to the TWRP main menu.
Next, you’ll want to tap on the Advanced button, then the File Manager button and then you’ll be shown a list of the folders in the root directory. Simply tap on the data folder, then scroll down and tap on the system folder. Now, you’ll need to scroll down and tap on the locksettings.db so that you can bring up the various actions you can do with it. Since we want to delete it, tap on the Delete button and then swipe the white arrows to the right to confirm.
From here, I recommend tapping the Back button so you can make sure that locksettings.db is actually gone. If it is, then simply tap on the Home button, tap on the Restart button and lastly tap on the System button to reboot the OnePlus 3 back into Android. If you can reboot back into Android then your issue has been resolved and you can go ahead and setup your PIN, Pattern, or Password again.
If you still can’t get into Android, which some people do experience, then you’ll want to boot back into Recovery Mode on the OnePlus 3 and delete some additional files related to the lock screen and your PIN/Pattern/Password. As mentioned above, the additional files are locksettings.db-shm, locksettings.db-wal, gatekeeper.password.key, and gatekeeper.pattern.key. And just make sure those are deleted before you boot back into the Android OS.