A solution for "wrong pattern/pin" in lockscreen even if you type it correctly

AbboodSY

Senior Member
May 3, 2014
386
273
93
Homs
A solution for "wrong pattern/pin" in lockscreen even if you type it correctly

So a lot of users kept reporting that when they flash a custom rom then they successfully manage to boot it they face a bug which is "wrong pin or wrong pattern" when they enter it correctly, and the only solution that is known is to wipe data to get it to work..
Well today I faced this bug after restoring a backup of lineage through TWRP and after I turned on the phone and entered the pattern it told me that the pattern is wrong even though it's correct..
So I solved this without formatting data partition and this is what I did:
1: Go to TWRP
2: Press the advanced button in main screen
3: Press the file manager button
4 Go to data/system/
5: Locate all the files that their names are "locksettings"
There are around 3 files with this name but with different extensions (the number might differs depending on what's your lock type)
6: Delete all of them
7: Reboot to system
& now you will notice that your pattern/pin is gone and you can access your homescreen and after that you can set a new lockscreen from settings.
Hope it helps you while testing the new upcoming roms in the future :fingers-crossed:
 
Last edited:

vexa

Senior Member
Sep 16, 2013
158
222
0
Denpasar, Bali
might as well check the encryption status (settings > security > encryption) once you're able to boot to system. Our device should be encrypted all the time, otherwise fingerprint or any form of lock won't work. this wrong pin issue usually happens because our device fail to encrypt, so just charge your phone to 80%, and manually encrypt from settings. after that everything should be fine and dandy :cool:
 
  • Like
Reactions: jufegoco
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone