• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

DroidViews

  • Apps
  • Downloads
    • Android Apps
    • Themes
  • Guides
    • Root
  • ROMs
  • Reviews
  • Wallpapers
  • About Us
  • Contact Us

Fix PIN Errors After Restoring Nandroid Backup in TWRP

Deeptabho Misra | 24 Feb 2017 | Guides/ Miscellaneous

Once your device is rooted and you begin tinkering with mods and custom ROMs, a nandroid backup will start coming very handy. Who knows when your device will suddenly malfunction? But now with your backup, you will always have a fail-safe ‘undo’ button. If you don’t know how to create a nandroid backup, the steps are very simple.

Also read: How to Bypass Lock Screen Security on Android (Pattern /Pin /Password)

You must have a custom recovery (TWRP is the current favorite), and there will be an option to create a backup in the recovery main screen itself. Don’t do anything with the check boxes, just swipe right at the bottom to start creating a backup. Based on installed apps and data, a nandroid backup can take up several gigs of SD Card storage. When the process is complete, go back to the main screen and reboot.

Everything works fine until now, but then you choose to encrypt your phone with a password. Now if you wish to restore another backup with a different password, several problems may arise. At times, you will need both the new password (during boot) and the old password (screen unlock), to use your device. This can be easily fixed, simply head over to Settings, Security and reset your password.

Don’t miss: How to Change Android Device Model Name on Marshmallow and Nougat

Steps to Fix PIN Errors After Restoring Nandroid Backup in TWRP

Another more complicated scenario may arise when none of the passwords can unlock the lock screen. There are two ways to fix this problem:

Using TWRP File Manager

  1. Reboot into recovery mode. If asked for a password, enter the recent one.
  2. Select Advanced, then tap File Manager.
  3. Navigate to /data/system directory.
  4. Now delete the files with .key extension as well as those containing the word ‘locksettings’. In total, it should be five files.
  5. Now reboot your device again. If prompted to install SuperSU, choose do not install.

When the phone finishes rebooting, you will find the lock-screen unprotected. Now you can head over to Settings-> security to create a new password.

Flash a zip file

Instead of shuffling through tons of files and folders, you can simply flash a package to do the same things, only faster. This package was created by Primokorn, a recognized XDA contributor, specifically for One Plus 3T, but it should also work in other stock ROMs.

The package deletes the following files:

  • password.key
  • pattern.key
  • locksettings.db
  • locksettings.db_shm
  • locksettings.db_wal

Downloads:

  • If you want to remove the 5 files mentioned above: lockscreen-removed-signed.zip
  • If you would like to remove only the LockSettings file: lockscreen-removed-v2-signed.zip

If your phone uses these files for security, the package will work. Simply download the zip file from this link and transfer it to your SD Card. Open TWRP, select install, and flash the given file. Reboot and voilà! Your phone is unlocked, finally. Take a deep breath, and be more consistent with your passwords!

Related article: How to get past the Android lock screen security measures

Tags: Backup Bypass or Remove Lockscreen Nandroid Backup Tips and Tricks TWRP

Related Posts

fix backup google drive

How to Fix Backup Now Option Under “Backup to Google Drive”

How to backup your holiday photos from your smartphone

How to Backup Your Holiday Photos from Smartphone to PC

Backup Contacts and SMS

How to Backup Contacts and SMS from Android to PC

Reader Interactions

Join The Discussion: Cancel reply

We never share our visitor/user details. For more info, Please read our privacy policy before submitting your comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Footer

  • Apps
  • Downloads
    • Android Apps
    • Themes
  • Guides
    • Root
  • ROMs
  • Reviews
  • Wallpapers
  • About Us
  • Contact Us

Privacy Policy | Terms & Conditions
© 2025 · DroidViews