Remove /Bypass Lockscreen With Recovery

Search This thread

demenicis

Senior Member
May 7, 2014
549
122
worked perfectly, on axon 7 mini with android 7.1. MASSIVE THANKS
Problem is, any idiot can get into our phones if twrp is installed!!!!!!!
and if it isn't, but usb debug is on, then again, totally unprotected........
i've been playing with android for years and never realised such obvious danger........
but since google REMOVED the ability to unlock phones from "find my device" or even from your google account on a PC, if I didn't have twrp installed I'd be screwed now.

BIG THANKS GOOGLE!!!
 

Newby75

New member
Jan 25, 2020
1
0
grenoble
Great! Thank you! You just saved me from another sleepless night!

I was being careful and just renamed them to *.archive instead of deleting them. Works just fine.

Cheers!
 

Js Dh

New member
May 25, 2020
1
1
Look here

NOTE :

If you don't have these :

password.key
pattern.key
locksettings.db-shm
locksettings.db-wal

And only have
locksettings.db

Just delete locksettings.db then and reboot, it will work without any problems!
 
  • Like
Reactions: arvindgr

SYS113

Member
Apr 5, 2019
5
1
Repetitive but interesting
It's a pity that it doesn't work on high Android version phones ...

thanks
 

panetesan2k6

Member
Jan 11, 2014
21
4
Hi, I'm very insterested in this as my father locked himself out of his phone by forgetting the pin of his Huawei P20 Lite...

Is it posible to install TWRP in a phone that is completely stock? I mean, Emui bootloader, and no USB debugging enabled at all? He would hard reset the phone but doesn't want to lose all the stuff in it.

Thanks in advance.
 

BZ0RG

Senior Member
Jan 28, 2018
58
18
Hi, I'm very insterested in this as my father locked himself out of his phone by forgetting the pin of his Huawei P20 Lite...

Is it posible to install TWRP in a phone that is completely stock? I mean, Emui bootloader, and no USB debugging enabled at all? He would hard reset the phone but doesn't want to lose all the stuff in it.
No you can't because you need to unlock the bootloader, which also means that a reset will be performed.

I would have advised to use ADB but you can't as you don't have debugging enable.

I don't know much Huawei but maybe there is a way to dirty flash the system? Otherwise full reset will be the only way unless you have another way to log in than the pin...
 
  • Like
Reactions: panetesan2k6

monicaONxda

Member
Aug 16, 2020
45
8
This method is dependent on a few factors,

If the device is encrypted you will not be able to read the data without it being decrypted. If you are using a newer device such as a pixel 3 that has a security chip the lockscreen/boot sequence has been offloaded to the chip as well. I have not verified if the OEM unlock also negates the fact the module that handles your lock screen would be accessible as it is its own entity.

I agree, it highly depends on your stock rom and device - you can check the files of your rom via adb , e.g. in Android 10 on a Galaxy Note 10 device, there is no "gatekeeper.password.key, gatekeeper.pattern.key, only locksettings.db, locksettings.db-shm, locksettings.db-wal. I doubt if I remove all *.keys and the locksettings databases that it works without issues, and if so, then you might still be stuck with an encrypted userdata (data/data ) partition...

B.t.w. I just found out, that the userdata (data/data ) partition is UNENCRYPTED and fully readable when viewed with an ADB viewer from my PC , although the device is in lockscreen mode / locked! How is that possible? Someone experienced that? It happens not immediately after reboot before the first unlock! After the device has been unlocked, accessed via ADB and re-locked (but not rebooted) it is (still) unencrypted, even on another PC!!!
Is that a security leak already known? Can it be fixed?
 

domi994

Member
Sep 6, 2008
5
0
Hahahaha yes it works just did it today
This will work only if you have rooted your phone previously
Amazing it save me a wipe of all
to get to the TWRP for me in this case was an LG aristo
have to press vol - and power when you see the logo quick release and press power again
you get to the wipe data menu click yes.. it won't wipe anything will take u to the TWRP menu
thanks a lot @adithyan25
 

luckysoul777

Senior Member
Mar 6, 2015
144
7
Deleting locksettings.db certainly bailed me out when I wasn't able to unlock my phone even with a correct pin. However, I must also ask myself then how we can secure our phones. In the wrong hand, a thief can delete this file too to unlock!

Others have mentioned the key is to get into TWRP and therefore, one can simply put a password on TWRP. Sorry, I went through the settings of TWRP, but I couldn't find a place where I can set a password for it! If this is about Secure Startup, that is device/ ROM dependent. I have a Samsung S4 on stock ROM and can't figure out how to do it. If anyone knows, please share.

Now my last problem is I simply can't set a PIN anymore! It always complains incorrect and that takes me back to square one to delete the locksettings.db. I know it is likely related to a dirty flash (After dropping in a circuit board for GT-I9505 to replace the dead one for SGH-I337M, I wiped clean my phone and Odin'ed stock ROM for GT-I9505. Then I restored my old DATA partition from my TWRP backup, created when the phone was still an SGH-I337M, because reinstalling everything is imply too painful with 100+ apps. GT-I9505 and SGH-I337M are different variants of S4. The main circuit boards are supposed to be interchangeable, but I am sure Samsung has burned some codes to them to differentiate the 2. For example, when I tried to Odin I337M ROM to an I9505 board, it would be rejected even though both boards have unlocked bootloaders). Is there any way to set a PIN after a dirty flash?

[Update Oct 25th, 2020: I am able to set a PIN and my phone doesn't reject it as incorrect anymore! Go to settings -> Security -> Clear credentials to wipe out whatever the old junks are! I assume you only need to do this if you dirty flashed as I did.]
 
Last edited:

latouffe

Senior Member
Jul 30, 2011
339
38
How can you protect against it? LEt's assume I lost my rooted phone. Anyone can delete this file then?

Anyway to protect my phone?

Thank you
 

Top Liked Posts

  • There are no posts matching your filters.
  • 220


    Recently when i restored my data using TWRP i faced a problem at lock screen.
    I was not able to unlock my phone with the pin i set Earlier..So after so many attempts i was able to find a solution for that problem.(works with pattern,pin etc)
    650x300x2016-02-01-17.24.56-650x300.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.mMj7EJhi9_.png




    Requirements
    -----------------



    1. A phone That cant be unlocked witha your Pin/Pattern :p
    2.Any custom recovery installed(TWRP i will say)..Get TWRP from https://twrp.me/Devices/




    Steps
    -------



    1.Once You installed twrp boot into recovery mode.
    2.Go to advanced>filemanager to acces the files in your phone.
    300x533xTWRP-home.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.X120HbFRU1.png

    3.Ggo to the /data/system folder. Scroll down and find the two files with the .key extension. Delete both of them (by tapping on the file and then tapping the �Delete� button). Then, delete all the files containing the word locksettings.

    • password.key
    • pattern.key
    • locksettings.db
    • locksettings.db-shm
    • locksettings.db-wal
    300x533xTWRP-pinreset1.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.ghmGs8Z_4t.png

    Once you�ve deleted all the key and locksettings files, reboot your system. If it asks you to install SuperSU, choose �Do Not Install�.

    Once Android starts, your lock screen should appear, with no PIN or password prompt. Unlock your phone (yay!) :highfive: :fingers-crossed: and head to Android�s Settings. Scroll down and go to Security > Screen Lock. From there, you can choose a new PIN or password to lock your phone.


    Hope this helped you..Hot Thanks if this was helpful :)
    2
    suddenly my phone (G4 H815 lineage ) can't be unlocked (see attachment)

    I tried it with but it didn't worked for me...
    any Idea?
    Dirty flash the ROM again..
    Basically problem with the ROM..All we do according to this thread is delete the file containing lock settings....See whether problem remains after dirty flashing
    2
    I followed the instructions and i still cant decrypt when i delete the the locksettings.db.locksettings.db-shm.locksettings.db-wal.( i dont have any .key files under data/system) and reboot the previous unlock code is gone and i can swipe up to get in but the phone gets stuck at "phone is starting" and wont progress i can enter the setting menu,pull down notifications etc but even if i do that i still get no where please help id hate to think i spent money on a phone that cant fully use lineageos due to twrp errors. im running pie on mi mix 2s latest lineageos.

    Would re flashing a diffrent recovery fix things?
    1
    Great solutions brother.. how user use CWM or PHILZTOUCH?

    I didnt tried it yet..I guess the process is same for all...why don't you give a shot and confirm..
    Cheers
    1
    I'll have to check re the dev menu and usb debugging mode. Will let you know but I doubt it. It was a stock phone that I never modified.

    I'll send you a PM with my email. Thank you so much. If you help me access my phone without losing data I will pay you handsomely my friend
    Just glad to help when i can on XDA, good group of men on here with unlimited knowledge...besides I didnt learn this stuff to keep it all to my self lol