[HOWTO] Get over lock screen when code/password/pattern don't work anymore

After typing your password, your phone refuses to unlock, or you’re stuck on lock screen ?
A solution is to rename or delete your lockscreen settings.


  • Having TWRP installed
  • A backup is recommended, mainly if your device is encrypted

How to bypass lock screen

  1. Boot to TWRP
    You may need to enter in the bootloader of your device, then enter in recovery mode.
  2. In TWRP, click on Advanced then File Manager
  3. Go to /data then system, find and press the locksettings.db file
  4. Now press Delete file (you can also Rename file ), then Swipe to Confirm
  5. Ended ! Click Reboot System.

Source : u/monteverde_org on Reddit [archive]
On forum : How can I reset my Trust-PIN?

1 Like

@Manoj Is this bug ever going to be resolved, or is it a feature now? bug

Ideally it should be resolved but as always I will share the lack of developers excuse…it would be great if users with development experience can code and merge such changes / fixes.

It is needed after a TWRP restore from/to a lock-enabled phone.

If phone is encrypted TWRP is asking for unlock scheme at startup, before user could access any file.

So I think that recommendations in @gael post (here) are perfectly relevant.