How To: Fix 'Wrong PIN' Errors After Restoring a NANDroid Backup

Fix 'Wrong PIN' Errors After Restoring a NANDroid Backup

Making a NANDroid backup can save you from all sorts of flashing-related mishaps and accidents. Bootloops, SystemUI crashes, accidental wipes, bad ZIPs, or a dozen other possibilities—there's almost no condition in which a NANDroid is unable to correct problems with your device. However, recent changes to Android have created an almost paradoxical situation where restoring a NANDroid can actually lock you out of your phone.

As a result of recent changes to Android, the process of restoring a NANDroid backup can now cause your phone to show a message that says "Wrong PIN" or "Try Again" when unlocking your device after restarting. Even if you remember your PIN and make sure to enter it correctly, your phone will still say that it's incorrect, effectively locking you out of your own device. Not to worry, though, there's an incredibly simple fix for this.

Prerequisites

Fixing All PIN Errors

No matter what PIN error you get after restoring a NANDroid, deleting locksettings.db from /data/system will correct all of the problems by removing the PIN from the lock screen. This technique will only remove the PIN, so if you have fingerprints set up, those will still be there.

The problem with this is that the file manager in TWRP can easily get confusing to the average user, making it hard to find and delete the file in question. So to make things a lot easier, developer Primokorn has created a flashable ZIP file that deletes the locksettings.db for you, which means you can get things back up and running in no time.

A Note About Encrypted Devices

Before you begin, note that this ZIP is not compatible with encrypted phones. Android's lock screen—be it PIN, pattern, or password—serves as the phone's decryption key, so removing the lock removes your ability to decrypt the storage and access the device's data. In other words, if your device is encrypted and you're experiencing the "Wrong PIN" error after restoring a NANDroid backup, your only option is to perform a full data wipe.

Step 1: Download the ZIP

If you haven't had the issue yet, simply tap the following link to save the flashable ZIP onto your device, and it'll be there for whenever you restore a NANDroid next.

However, if you're currently stuck with a PIN issue, you'll want to download the ZIP file to your computer. Sideloading the ZIP via ADB is a must if you're unable to unlock your device, but it's a fairly simple process. We'll go over the steps below.

Step 2: Get Your Phone & Computer Ready

Boot your phone into TWRP, then plug it into your computer with a USB data cable. From there, open a Command Prompt (Windows) or Terminal (Mac and Linux) window, depending on your operating system, then type in adb start-server to start the ADB server on your computer. For more help with this, don't miss our full ADB installation guide at the following link.

Next, tap the Advanced tab from TWRP's main menu on your phone. From there, tap on ADB Sideload, then swipe the slider to start the ADB connection.

Step 3: Sideload the ZIP

Type adb sideload into the command prompt, then hit your space bar once to add a single space. From there, locate the ZIP file you downloaded in Step 1, then click and drag the file into the Command Prompt or Terminal window, which will populate the file's location and name into the field. From there, just hit enter to begin the sideloading process.

On your device, you'll see the ZIP do its work and remove the lock screen, which was preventing you from getting into your device. Once you see the Lockscreen removed text in TWRP, tap the "Reboot System" option to wrap things up.

That's all there is to it! Sideloading and flashing the ZIP in TWRP should have helped you regain access to your device. That "Wrong PIN" or "Try Again" message should now be gone from your lock screen entirely—but remember, this ZIP disabled the lock screen security altogether, so make sure to head to the Security menu in Settings and set up a new PIN. And now that you can use your phone again, be sure to leave your thoughts in the comment section below.

Cover photo and screenshots by Kevin M./Gadget Hacks

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest