"Wrong PIN" after TWRP restore - G4 Q&A, Help & Troubleshooting

I made a TWRP backup yesterday to play with the stock ROM for a bit, but after restoring it today I can't unlock it. Every time I enter my PIN it says "Wrong PIN." I have no idea why. I've tried wiping everything but the SD card in TWRP before restoring again, but it still won't unlock. Anyone know what could be causing this?
T-Mobile G4 (H811)
Cyanogenmod 13.0
TWRP 3.0.2.0

I had this problem with Cyanogenmod. After restoring my backup the lock screen pattern did not work anymore.
I had to delete these two files:
/data/system/gesture.key
/data/system/cm_gesture.key
Afterwards there was no lock screen protection and I was able to set up a new one.
Maybe there is something similar for the PIN.

Mogster2K said:
I made a TWRP backup yesterday to play with the stock ROM for a bit, but after restoring it today I can't unlock it. Every time I enter my PIN it says "Wrong PIN." I have no idea why. I've tried wiping everything but the SD card in TWRP before restoring again, but it still won't unlock. Anyone know what could be causing this?
T-Mobile G4 (H811)
Cyanogenmod 13.0
TWRP 3.0.2.0
Click to expand...
Click to collapse
Maybe a factory reset

In fact, it suffices to delete locksettings.db in /data/system. @codeworkx explained this workaround somewhere in the official CM thread.

RogerF81 said:
In fact, it suffices to delete locksettings.db in /data/system. @codeworkx explained this workaround somewhere in the official CM thread.
Click to expand...
Click to collapse
That worked, thanks.

RogerF81 said:
In fact, it suffices to delete locksettings.db in /data/system. @codeworkx explained this workaround somewhere in the official CM thread.
Click to expand...
Click to collapse
Thanks buddy. I followed your suggestion and it worked perfectly.

Related

OP3 won't unlock 'Wrong PIN'

So I backed up stock OxygenOS with TWRP, copied that backup to my PC, flashed the CM13 nightly to test it, wiped the device, restored original backup from TWRP.
Boots up, asks me for my PIN, this works and so it continues to boot Android.
At the lock screen it says 'Wrong PIN' when it's correct and it's the only PIN I've ever used on the device.
Does anyone have any suggestions that may fix this?
Thanks.
I had the same problem with unlock pattern, idk how to solve it without formatting internal memory.
but you can erase internal memory (factory reset) and your phone will reboot and be clean (wiped everyting including pin)
washichi said:
I had the same problem with unlock pattern, idk how to solve it without formatting internal memory.
but you can erase internal memory (factory reset) and your phone will reboot and be clean (wiped everyting including pin)
Click to expand...
Click to collapse
Yep it sucks, I'm trying to avoid that
This is a known issue with twrp. You should be disabling security (pin/fingerprint) before making a back up. There is a thread on here on how to get around it.
k.s.deviate said:
This is a known issue with twrp. You should be disabling security (pin/fingerprint) before making a back up. There is a thread on here on how to get around it.
Click to expand...
Click to collapse
Any link to the thread please?
Edit: Found it, deleting the password files has worked https://forums.oneplus.net/threads/fix-wrong-pin-pattern-when-restoring-twrp-nandroid-backup.452384/
flyboyovyick said:
Any link to the thread please?
Edit: Found it, deleting the password files has worked https://forums.oneplus.net/threads/fix-wrong-pin-pattern-when-restoring-twrp-nandroid-backup.452384/
Click to expand...
Click to collapse
here as well.
Yes already answered many times.
This worked for me as well

Replacement phone via Uh-Oh, Can I use NANDROID backup?

I managed to somehow break my 3 week old HTC 10's rear camera glass so I'm going to get it replaced via the "Uh-Oh Protection" since I bought from HTC directly.
I have the Unlocked US edition, but use it on Verizon. When I get my replacement phone, I'll go through the steps to Unlock via HTC dev, run Sunshine for S-OFF and change the CID/MID to Verizon. At that point, can I just flash a NANDROID backup from my old device onto the new one to get my ROM / Apps / etc. back? Will there be any issues since it'll be different hardware? The NANDROID will contain everything I need so I won't need to first apply the VZW RUU right? I think I've done it before on previous HTC hardware but I want to check if it'll work before I try it. Will encryption be an issue?
Sounds good as long as correct firmware is also flashed
drumz0rz said:
I managed to somehow break my 3 week old HTC 10's rear camera glass so I'm going to get it replaced via the "Uh-Oh Protection" since I bought from HTC directly.
I have the Unlocked US edition, but use it on Verizon. When I get my replacement phone, I'll go through the steps to Unlock via HTC dev, run Sunshine for S-OFF and change the CID/MID to Verizon. At that point, can I just flash a NANDROID backup from my old device onto the new one to get my ROM / Apps / etc. back? Will there be any issues since it'll be different hardware? The NANDROID will contain everything I need so I won't need to first apply the VZW RUU right? I think I've done it before on previous HTC hardware but I want to check if it'll work before I try it. Will encryption be an issue?
Click to expand...
Click to collapse
I don't see it being any issue.
So I just got my replacement phone. I followed the exact same steps as I did on my original HTC 10 to get s-off and convert to Verizon (used the same files as well). I made a fresh NANADROID backup on the old phone in TWRP, copied it over to the new phone, and restored it. When I reboot I get stuck on the white splash screen. I tried wiping the cache but I can't progress further.
I was really hoping I'd just be able to use the NANDROID so I don't have to go through the arduous process of backing up all of my apps and settings, and copying them over in TiBu, and having to recustomize everything in VenomHub/Xposed.
What am I doing wrong?
drumz0rz said:
So I just got my replacement phone. I followed the exact same steps as I did on my original HTC 10 to get s-off and convert to Verizon (used the same files as well). I made a fresh NANADROID backup on the old phone in TWRP, copied it over to the new phone, and restored it. When I reboot I get stuck on the white splash screen. I tried wiping the cache but I can't progress further.
I was really hoping I'd just be able to use the NANDROID so I don't have to go through the arduous process of backing up all of my apps and settings, and copying them over in TiBu, and having to recustomize everything in VenomHub/Xposed.
What am I doing wrong?
Click to expand...
Click to collapse
Try dirty flashing ROM
How would changing devices between TWRP backup/restore affect encryption?
EDIT: Since TWRP decrypts now, phone encryption would be a moot point in this context.
I received a replacement Uh-Oh phone from HTC. Unlocked bootloader, installed TWRP and S-Offed. Tried using my Nandroid to restore but TWRP would not see it (file names different, based on S/N). I created a small new backup to create the proper file structure and renamed the old Nandroid backup and placed it in the proper directory. Still would not work so I went to my TiBu backup and reset everything back up.
Here's a strange result though - my fingerprint works fine to unlock the phone but somewhere along the line (perhaps my attempt restoring Nandroid) the pattern lock changed. So now I cannot unlock phone using the pattern and cannot change it. I can use fingerprint so it works for now but I would like to reset the pattern lock - any ideas?
stebaile said:
I received a replacement Uh-Oh phone from HTC. Unlocked bootloader, installed TWRP and S-Offed. Tried using my Nandroid to restore but TWRP would not see it (file names different, based on S/N). I created a small new backup to create the proper file structure and renamed the old Nandroid backup and placed it in the proper directory. Still would not work so I went to my TiBu backup and reset everything back up.
Here's a strange result though - my fingerprint works fine to unlock the phone but somewhere along the line (perhaps my attempt restoring Nandroid) the pattern lock changed. So now I cannot unlock phone using the pattern and cannot change it. I can use fingerprint so it works for now but I would like to reset the pattern lock - any ideas?
Click to expand...
Click to collapse
So when you did a restore with TWRP, what was the result? What does "still would not work" mean exactly? What did the log say?
I'll have to dig into the log file but it is my habit to only backup /data. That's what I was trying to restore. I might need to factory reset to get the pin reset I suppose. Was hoping there was a file I could delete to reset the encryption.
Sent from my HTC 10 using XDA-Developers mobile app
Just in case anyone has this issue of losing their pattern lock from a Nandroid restore I found the answer in a different thread. Use a file manager with root access such as Root Explorer, or use TWRP's file manager capability to delete the locksettings.* files in /data/system. Reboot and your device will no longer have a pattern lock. You will need to create a new pattern lock along with new fingerprint unlocks.
stebaile said:
might need to factory reset to get the pin reset I suppose. Was hoping there was a file I could delete to reset the encryption.
Click to expand...
Click to collapse
Factory reset erases everything, leaving nothing to decrypt.
Your idea of "reset encryption" would make encryption useless if anyone could just remove the lock without the PIN/password.
stebaile said:
Just in case anyone has this issue of losing their pattern lock from a Nandroid restore I found the answer in a different thread. Use a file manager with root access such as Root Explorer, or use TWRP's file manager capability to delete the locksettings.* files in /data/system. Reboot and your device will no longer have a pattern lock. You will need to create a new pattern lock along with new fingerprint unlocks.
Click to expand...
Click to collapse
Rolo42 said:
Factory reset erases everything, leaving nothing to decrypt.
Your idea of "reset encryption" would make encryption useless if anyone could just remove the lock without the PIN/password.
Click to expand...
Click to collapse
Next time just read the TWRP FAQ
http://forum.xda-developers.com/htc-10/development/recovery-twrp-touch-recovery-t3358139/page74
10. After I restored my Data backup and boot back to Android, I'm entering the correct PIN/password, but it's telling me the password is wrong. What happened, and how do I fix it?
It appears that sometimes after restoring a backup of Data where security was enabled (such as a PIN or password lock), the device does not recognize the correct password. There are two ways to avoid this issue:
Disable security in Android?*before?*making a backup of data.
After restoring Data, while still in TWRP, use the TWRP File Manager to navigate to /data/system and delete all the locksettings.* files (such as locksettings.db, etc). When you reboot, the password will be gone.
Click to expand...
Click to collapse
Maik268 said:
Next time just read the TWRP FAQ
http://forum.xda-developers.com/htc-10/development/recovery-twrp-touch-recovery-t3358139/page74
Click to expand...
Click to collapse
Is that referring to unlocking the screen or decrypting the device?
The question was referring to encryption.
When TWRP restores a backup, is it encrypted? (There's a few "it depends" to that question I would think.)

password issue on Mi Max Resurrection Remix 5.7.4 **Update 11/19/16**

Hi There,
I could not login my phone suddenly with fingerprint or password. The password was definitely correct as I made the password visible.
It already happened several times. I also tried **Update 11/19/16** and **Update 11/06/16** two version. The problem was still there. Does anyone has the same problem? Thanks.
Phone: Mi Max 3GB/32GB Hydrogen
Rom: Mi Max Resurrection Remix 5.7.4 **Update 11/19/16**
Mi Max Resurrection Remix 5.7.4 **Update 11/06/16**
Reboot to TWRP, go to advance - file manager then find path: ..data/system, delete 3 locksetting files, reboot then setup your security settings again when it booted up. I dont have this problem on any build of RR but hope it helps.
dinhvtai said:
Reboot to TWRP, go to advance - file manager then find path: ..data/system, delete 3 locksetting files, reboot then setup your security settings again when it booted up. I dont have this problem on any build of RR but hope it helps.
Click to expand...
Click to collapse
Thanks for your reply. Yes, that's the way I reset the password. But I have to reset the password once a day or even more. It is very weird.
ccken said:
Thanks for your reply. Yes, that's the way I reset the password. But I have to reset the password once a day or even more. It is very weird.
Click to expand...
Click to collapse
So try to clean flash again. I have hydrogen, too. There is no one except you have this problem. Good luck
This happens to me frequently when I restore a backup of CM or MIUI on this phone. My password does not work anymore and I can't get into the phone. But I have a passwordreset.zip at home that can be flashed in TWRP that resets the password and I always have it on my phone. I can attach it to this thread later when I get home from work.
dinhvtai said:
So try to clean flash again. I have hydrogen, too. There is no one except you have this problem. Good luck
Click to expand...
Click to collapse
In fact, this was a clean install from unofficial cm13 to RR 5.7.4. I may give a try again. Thanks again.
dannejanne said:
This happens to me frequently when I restore a backup of CM or MIUI on this phone. My password does not work anymore and I can't get into the phone. But I have a passwordreset.zip at home that can be flashed in TWRP that resets the password and I always have it on my phone. I can attach it to this thread later when I get home from work.
Click to expand...
Click to collapse
I did restore a backup using titanium backup but only one time from unofficial cm13 to RR 5.7.4. These were user apps, no system apps at all.
Will it be affected even I deleted the locksettings and gatekeeper.password files already? Everytime I have to reset the password, it is pretty annoying. You should know that feel.
Thanks for your zip file.
ccken said:
I did restore a backup using titanium backup but only one time from unofficial cm13 to RR 5.7.4. These were user apps, no system apps at all.
Will it be affected even I deleted the locksettings and gatekeeper.password files already? Everytime I have to reset the password, it is pretty annoying. You should know that feel.
Thanks for your zip file.
Click to expand...
Click to collapse
Not sure. It has only happened to me when restoring a TWRP backup of the whole system.
Anywho here's the zip should save you some seconds.
This happens when restoring a rom in TWRP on any device. It has nothing to do with Resurrection Remix. I never noticed this before my 6P (I never had a fingerprint scanner on a phone prior to the 6P so I never set any lockscreen security)
I have the EXACT same issue.
dinhvtai said:
So try to clean flash again. I have hydrogen, too. There is no one except you have this problem. Good luck
Click to expand...
Click to collapse
Redmi 3s Prime. Do NOT use a password on Resurrection Remix. All hail TWRP.

From CM13 back to Viper

Hi guys, first, sry for my bad english.
I have a huge Problem. I did a Twrp Backup from my Viper rom. After Backing up, i installed cm13. After that, i would go back to my backup from Viper. The Problem is, i can restore the Backup but ive got a bootloop. How can i go back to my Backup ?
Next Problem is, everytime i start into twrp i got asked for the Decrypt password. How can i deactivate that ?
Which TWRP version are you currently on? Sounds asbif it is an older one. If so, try the latest 3.0.2-6 and report back.
Sent from my htc_pmeuhl using XDA Labs
hi, im on 3.0.2-6.
Now i restored my Viper backup. It Boots normaly.
Then i have type my Pin, that works. But after that, i have to unlock the Pattern lock. But it says my Code is Wrong.
I know it is the right code. I can try 1000000 different times, i cant unlock
pboden83 said:
hi, im on 3.0.2-6.
Now i restored my Viper backup. It Boots normaly.
Then i have type my Pin, that works. But after that, i have to unlock the Pattern lock. But it says my Code is Wrong.
I know it is the right code. I can try 1000000 different times, i cant unlock
Click to expand...
Click to collapse
directly from twrp FAQ:
"After I restored my Data backup and boot back to Android, I'm entering the correct PIN/password, but it's telling me the password is wrong. What happened, and how do I fix it?
It appears that sometimes after restoring a backup of Data where security was enabled (such as a PIN or password lock), the device does not recognize the correct password. There are two ways to avoid this issue:
Disable security in Android before making a backup of data.
After restoring Data, while still in TWRP, use the TWRP File Manager to navigate to /data/system and delete all the locksettings.* files (such as locksettings.db, etc). When you reboot, the password will be gone."
pboden83 said:
hi, im on 3.0.2-6.
Now i restored my Viper backup. It Boots normaly.
Then i have type my Pin, that works. But after that, i have to unlock the Pattern lock. But it says my Code is Wrong.
I know it is the right code. I can try 1000000 different times, i cant unlock
Click to expand...
Click to collapse
adb into the phone via TWRP or live system and rm -rf /system/data/*.key and locksettings* this will reset the security. no one currently knows why twrp is doing this but it seems to only happen to me when flashing a different rom then going back. it does NOT does this if restoring a previous backup of my current rom.
really the only file you need to delete is the locksettings.db file. I've never had issues deleting just that one.
I also tried this way to delete the locksetting.db and can bypass the suck lockscreen!
BTW, highly recommend you that in addition to whole system backup in TWRP, also use Titanium Backup to backup all user apps. In case of restore failure, you still can preserve your user apps and restore in newly installed system.

Cannot get unlock pattern to work.... please read

Hi..
I updated to Android N, and everything went fine, but I found it a little buggy and (my mistake) didn't realize xposed was not working yet, and there are some privacy modules I really would like.... So, I decided to downgrade back to MM.
As I am s-off, I booted into a rom.zip RUU (1.96.617.20). During the subsequent initial setup, I picked a screen pattern (to be used on restarts only)..for whatever reason, I decided to pick something different besides the rather easy pattern I had used since the M8... I will call this pattern B. Also during setup I copied over my internal storage files which I had backed up my laptop.
I then flashed the correct TWRP and then installed the correct SuperSU.zip. When I rebooted from here, Pattern B worked fine as I expected it to. I then thought I it would save time by restoring a nandroid (also 1.96.617.20) which had a lot of tweaks and other things. That nandroid backup however I know used my old screen pattern, which I will call Pattern A. That restore finished without error.
After reboot I got the restart screen asking for the pattern... I wasn't sure which one would work, so I first tried Pattern A which would have been used in the nandroid restore I just finished.... no luck. So I thought ok, I will try the pattern I used when I set up MM, Pattern B. But that didn't work...
This makes no sense... I have never used a screen unlock pattern other than Pattern A, and then today, I tried Pattern B which I know I remembered correctly because I used it once before I restored the nandroid.
When I search on how to solve this problem, I see "do a reset"... but wouldn't a reset be the same as restoring a nandroid backup? And since I just restored a nandroid and the pattern doesn't work, I am stumped.
Anyone have any clue how I can fix this???
Thanks in advance!
syntropic said:
Anyone have any clue how I can fix this???
Thanks in advance!
Click to expand...
Click to collapse
I found in the Nexus Forum someone with this problem... I rebooted into TWRP, and using the file manager I deleted these files:
/data/system/locksettings.db
/data/system/*.key
And this allowed me into the OS.
Thank you for anyone who has read this anyway!!
syntropic said:
I found in the Nexus Forum someone with this problem... I rebooted into TWRP, and using the file manager I deleted these files:
/data/system/locksettings.db
/data/system/*.key
And this allowed me into the OS.
Thank you for anyone who has read this anyway!!
Click to expand...
Click to collapse
A hint: You are talking about twrp, sill you are searching a nexus forum. Next time try twrp htc 10 thread instead
mirok said:
A hint: You are talking about twrp, sill you are searching a nexus forum. Next time try twrp htc 10 thread instead
Click to expand...
Click to collapse
I just googled "site:sea-developers.com pattern security not working HTC 10"
This wasn't strictly a TWRP issue... You could use TWRP or ADB to access the system partition IF the files which stored this security code were stored there (of this I wasn't entirely sure).
I didn't know for certain if these files were located in the same place or even under the same name as the Nexus, so I used TWRP's file manager to look around (starting in the above location) aa maybe I'd find them.
Sent from my HTC 10 using XDA Labs

Categories

Resources