Remove /Bypass Lockscreen With Recovery

Search This thread

demenicis

Senior Member
May 7, 2014
549
120
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!!!
 

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

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
57
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
33
4
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
131
6
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
326
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
 

lulli1

Senior Member
Dec 12, 2011
1,445
827
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

Yes! Flash official OOS and close bootloader. Disable usb debugging and you should be safe. Back in 2018 but safe :cowboy:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 193


    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
    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
    you are just the best..! just saved me a wipe
    1
    dirty flash doen't work
    when I delete only:

    gatekeeper.password.key
    gatekeeper.pattern.key

    I can get in again, but I can't set a new lockscreen...

    when I delete also:

    locksettings.db
    locksettings.db-shm
    locksettings.db-wal


    I can't get in anymore...

    only wiping data, cache and dalvik works (clean flash)
    -
    could this be a problem with system profile settings?
    (disable lockscreen when wifi is connected)

    Nope I don't guess so...didn't faced a problem like this..I would say report it to original developer of ROM ... I tried this method on almost 8 ROMs and all went well
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