How to Bypass Pattern lock in Android phone

March 12, 2024

Unlock Pattern lock of any Android phone. If you own an Android Smartphone then you must be well aware of the security-related stuff available in your phone system.

Moreover, there are various types of lock screens provided to protect and secure your phone’s data from unauthorized access. Among all the different ways to password protect your phone, the most popular one that comes with every Android device is the Pattern, Pin, or Password Lock.

But what if you forget the pattern lock or the password lock? Then you’ll have to log into your Google account which you’ve already set in. Besides, if even this method doesn’t work then there is no other option than wiping or factory resetting your phone.

This will wipe out your entire phone data along with the pattern or the password lock that you’ve set. Besides, This method is not effective as it wipes your phone data completely.

Hence, to overcome this, I am unveiling some of the major methods by which any user can bypass, unlock, or crack the Pattern, Pin, or Password Lock of any Android Smartphone.

Moreover, this article is particularly for those Android users who have forgotten their Android Pattern, Pin, Face, or Password Lock and want to reset that without factory resetting, wiping, or using their Google account.

Disclaimer

This article is for educational purposes only. Don’t use this for cracking any other person’s device without their permission. Droid Thunder will not be held responsible for any damage.

Pre-requisites

  • Make sure your device has at least 60% battery level.
  • Enable USB debugging mode in your phone settings.
  • Temporarily disable all the security-related applications on your PC.

Method 1: Regain your Original Pattern Lock back (Without Data loss)

Downloads

ADB files for Android
Android OS gesture.key dictionary
File View Pro

Pattern lock is a set of gestures that an Android user performs to unlock his/her Smartphone. It seems to be complicated, but actually, it is not. It can be entered by the user joining points on a 3×3 matrix. Since Android 2.3.3 this pattern must involve a minimum of 4 points (on older Android versions the minimum was 3 points) and each point can only be used once. Moreover, the pattern circles can be numbered starting from 1 to 9 from the upper top-left corner to the bottom-right corner as shown in the figure.

Android Pattern Lock with numbering screenshot

For example, if we select the number 7415369, then the pattern would look like this:

Android Pattern Lock with numbering screenshot 2

Furthermore, this pattern is encrypted with a SHA1 hashing algorithm. So the SHA-1 hash for 7415369 will be “F56A6DF0A85F5B0EB1E661B5836ED423542AFA86”. This SHA-1 hash is placed in a file called gesture. key which is stored in a location /data/system folder in Android’s internal memory.

When a user sets the pattern lock, the phone automatically hashes the lock code with SHA-1 and saves the result into the file. While unlocking, when the user enters the pattern lock, the phone compares its SHA-1 hash with the stored one and decides whether to give access or not.

Unlike patterns, Password Lock can contain characters, numbers, or special marks such as $, #, @ etc. Because of such complexion, the SHA-1 hash file number grows tremendously.

Procedure:
  • Download and extract the adb.zip file on your PC. After extracting you’ll find the following files in it:
  1. adb.exe
  2. AdbWinApi.dll
  3. AdbWinUsbApi.dll
Bypass Pattern Lock screenshot
  • Now connect your phone to your PC using the USB cable.
  • Open the ADB folder which you’ve just downloaded. Now press and hold the shift button + right mouse key simultaneously on a space in that folder. Refer to the image:
Bypass Pattern Lock screenshot
  • Select the ‘Open command window here’ option.
Bypass Pattern Lock screenshot
  • As soon as you click on it, a black-colored command prompt window will appear.
Bypass Pattern Lock screenshot
  • In this command prompt window, type the following command to make sure that your device is properly connected to the PC or not.
adb devices
  • After entering this command, some random numbers will appear. This will confirm that your phone has connected properly.
Bypass Pattern Lock screenshot
  • Now we have to copy the gesture.key file from /data/system folder located in Android’s internal memory to your PC. For doing so, we need to use the command ‘ADB pull’. So type the following command in the command prompt and press enter.
adb pull /data/system/gesture.key gesture.key
Bypass Pattern Lock screenshot
  • This command will pull out the gesture.key file located in /data/system/ folder to the ADB folder.
Bypass Pattern Lock screenshot
  • As that you have the gesture.key file, you can close the command prompt window. You can open the file using any text or hexadecimal editor. Here we use the File View Pro software. So download and install this software from the link provided above.
  • Launch the File View software and open this gesture.key file in it. You’ll see something like this:
Bypass Pattern Lock screenshot
  • The code ‘F56A6DF0A85F5B0EB1E661B5836ED423542AFA86’ is important here.
  • Now download and extract the Android OS gesture.key dictionary on your PC.
  • Open that dictionary and search this ‘F56A6DF0A85F5B0EB1E661B5836ED423542AFA86’ code in it. You’ll see something like this:
Bypass Pattern Lock screenshot
  • Besides, smartphone encrypts the pattern of 1234 not as a string ‘1234’, but as a sequence of bytes 0×01 0×02 0×03 0×04. In other words we have a 0×01 for the first point and 0×09 for the last one. Then Android uses SHA-1 and places it in a gesture.key file. Here the gesture.key file contains 0xF5 0x6A 0x6D 0xF0 0xA8 0x5F 0x5B 0x0E 0xB1 0xE6 0x61   0x83 0x6E 0xD4 0x23 0x54 0x2A 0xFA 0x86 bytes value.
  • Additionally, using the dictionary we can find out that it corresponds to 0×06 0×03 0×00 0×04 0×02 0×05 0×08 values, which means that we have a ‘7415369’ pattern.
  • Try this pattern on your device and yes it will be successfully unlocked.
Bypass Pattern Lock screenshot
  • You can use the same method in case of password lock. This is the most simplest and effective method of all. But remember that your device must be rooted.
  • This is the most simplest and effective method to unlock your forgotten pattern/password lock of any Android phone.

Method 2: Reset the Pattern lock using ADB Commands

Downloads
  1. ADB files for Android
Procedure
  • Download and extract the ADB.zip file on PC.
  • Now open the Command prompt window and type command ‘ADB devices’ to check whether your device is properly connected to PC or not. (Refer Steps 1 to 5 of method 1)
  • Now type the following commands one by one. Don’t forget to hit enter after each command.
adb shell
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
update system set value=0 where name=’lock_pattern_autolock’;
update system set value=0 where name=’lockscreen.lockedoutpermanently’;
.quit
  • If the above commands don’t work then try with this one.
adb shell rm /data/system/gesture.key
  • Now you need to reboot your phone.
  • After restarting, you’ll see that the pattern or password lock is still there. Don’t panic, just enter any random pattern or password and your phone will get unlocked.

Method 3: Flashing zip file from CWM recovery

For this method, your phone must have a custom recovery like Clockworkmod (CWM) installed in it.

Downloads
  1. Lock screen security bypass for Android
Procedure
  • Download and copy the zip file on your phone’s external memory. You may use a memory card reader for that.
  • Switch off your phone completely until it vibrates. You need to boot into CWM recovery mode now. Note that every device requires different key combinations to enter recovery mode.
  • After landing into CWM recovery, select install zip from sd card option.
Bypass Pattern Lock screenshot
  • On the next screen, select choose zip from sd card option. This will show all the files located on the sd card.
Bypass Pattern Lock screenshot
  • Just navigate to the zip file that you’ve just transferred on your phone.
Bypass Pattern Lock screenshot
  • Select the file and confirm the installation by selecting ‘Yes – Install LockScreen_Security_bypass.zip’.
Bypass Pattern Lock screenshot
  • It will hardly take a few minutes to complete.
Bypass Pattern Lock screenshot
  • After it completes successfully, select the ‘reboot system now’ option from the recovery mode itself to restart your phone.
Bypass Pattern Lock screenshot
  • If you see the pattern/password lock after rebooting, don’t worry, just enter any random pattern or password and your phone will get unlocked.

Method 4: Using Aroma File Manager

This method does not require USB debugging as well as root access.

Downloads
  1. Aroma File Manager for Android
Procedure
  • Download and copy the Aroma File manager.zip file to your memory card. Remember not to extract it.
  • Now switch off your phone completely until it vibrates. Boot the phone into recovery mode. Different phones have different ways to enter recovery mode. If you don’t know how to boot into recovery, you can Google it or you can also ask us in the comments below.
  • In case of CWM recovery:
  • Mount all partitions including sd-ext (if you have it).
  • Navigate to the install zip from sd card option and select it. On the next screen, select choose zip from sd card option. Then navigate to the Aroma File Manager zip file which you’ve just transferred on your phone. Confirm the installation by selecting the Yes option.
  • In case of Stock recovery (Samsung e3):
  • In stock recovery, there is no option to mount partitions, so navigate to the apply update from sd card option and select it. Now navigate to the Aroma File Manager zip file and flash it.
  • In Aroma File Manager, click on the menu option and then go to settings and select Mount All Partitions. Now, exit from Aroma File Manager and re-flash it.
  • (For both Stock/ CWM recovery) In Aroma file manager, navigate to the /data/system folder.
Bypass Pattern Lock screenshot
  • Note: If you have sd-ext mod to increase internal storage, go to /sd-ext/system/
  • In /data/system/ folder delete the following files if they exist:

gesture.key (for pattern lock)
password.key (for password lock)
locksettings.db
locksettings.db-shm
locksettings.db-wal
signature.key
sparepassword.key

Bypass Pattern Lock screenshot
Bypass Pattern Lock screenshot
  • After deleting, exit the Aroma file manager and restart your phone.
  • If the pattern/password lock still exist then don’t panic just try any random pattern/password and the phone will get unlocked.

Method 5: Reset Pattern lock on Xperia Phone

If you own an Xperia phone that is pattern locked and you don’t have a Google account then to reset Pattern/Password lock perform the following steps.

Warning: This method is only for Sony Xperia devices. Don’t try this on any other phone.

Procedure
  • When the phone is unlocked, you’ll find an emergency call option on the screen. Click on that option.
Bypass Pattern Lock screenshot
  • Enter the Service menu code *#*#7378423#*#*
Bypass Pattern Lock screenshot
  • As soon as you type the code, you’ll see the following options on the screen.
Bypass Pattern Lock screenshot
  • Click on the Customization settings option.
  • On the next page click on the Reset Customization option.
Bypass Pattern Lock screenshot
  • Click on the Reset Customization and Reboot option.
Bypass Pattern Lock screenshot

Note: This method will wipe all the data and apps installed on your phone.

Method 6: Unlock Pattern/Password lock without installing Recovery

Requirements

  1. A computer running a Linux distro or Windows + Cygwin.
  2. USB cable to connect your phone to the PC.
Procedure

Steps to install ADB:

  • Launch the Terminal Window.
  • Type the following command in it:
sudo apt-get install android-tools-adb
  • Press Enter.
  • Follow all the instructions.

Steps to Reset Pattern lock:

  • Connect your (turned on) phone to PC using a USB cable.
  • Launch the Terminal window.
  • Type the following command in it:
adb devices
adb shell
cd data/system
su
rm *.key
  • Reboot your phone.
  • After restarting, if you see the pattern/password lock, then try any random pattern/password to unlock it.

Conclusion

Finally! You’ve successfully unlocked/cracked the pattern lock of your Android phone. So this is all about how to unlock/bypass/crack the pattern lock or password lock of any Android phone. If you face any problems or have any issues or suggestions regarding this article then do let me know through the comments box below.

Leave a Comment

46 thoughts on “How to Bypass Pattern lock in Android phone

  1. Abhijeet pls would u tell me how to bypass android lock pattern I’m stuck
    When I type adb devices it shows
    Hsjs356bhhzhx. – device
    Emulator. – device
    And then I typed adb shell it shows
    Error: More than one device and emulator.
    Pls reply. Thanks in advance.

    Reply
  2. I did it as u mentioned.
    Then I restart my PC.
    Then I type adb devices only one device listed.
    Then I type adb shell so the output was like this:
    Shell@android:/ $
    I type rm /data/system/gesture.key
    So the result was:
    rm failed for /data/system/gesture.key, Permission denied
    255|shell@android:/ $

    My device is Samsung galaxy star pro gt – s7262.
    Android version : 4.1.2
    Pls help,pls reply.

    Reply
  3. One question: How do you know all these stuffs? Did you attended any diploma course or any other course for mastering this? Well your good at your profession.
    Thank you.

    Reply
  4. Hi, perfect tutorial and explanation.
    I would like to use a 3 point pattern, but my phone allows 4 points minimum.
    Could I overwrite my “gesture.key” with a file containing my 3 point path? Can you tell me how to modify the “gesture.key” to obtain the path I need (1-4-7)?
    Thank you very much!

    Reply
  5. Well done, you’ve great knowledge of this.
    Please help me, I’ve an Innjoo i1s phone, can’t remember my password.I’ve tried using Aroma file & Adb method non worked.
    what do i do cos i don’t want to lose data?

    Reply
  6. In fact sir you are too much
    What a great work done!
    May God bless you .
    I want you as my best friend so I can
    learn more from you, if possible on
    whatsapp too. Pls reply me

    Reply
  7. I found a phone on the road, It is locked out I reset it but it is still asking me the old google mail. Please help me with this, How to unlock or reset the phone..? Thank you.

    Reply
  8. my mobile is xperia z1 i forgot my pin/pattern how to bypass that or any software through which we cant delete our data. the main thing is not to delete any data. how to do that without any data loss?

    Reply
  9. my samsung s4 mini problem with downloading firmware its stack at 336mb . i want to flash the phone because the application for contact and keypard went missing. if there is the other way of recovering them help out my brother.

    Reply
  10. Hi, mr. Abhijeet. My mother have a Galaxy S4 sph-L720T kitkat version ( Boost Mobile ) and she put a screen password and now she cannot go inside her phone. She got so much

    important information there, including her accident information she just had, so she needs a way to get inside her phone, PLEASE HELP, PLEASE HELP 🙁 🙁 . She is willing to prove that is her phone and willing to pay for the help too.

    How can she get back to her phone WITHOUT losing her information inside the phone ? ? ,

    how she can remove the screen password WITHOUT losing her information that is inside her phone ? ?.

    She have the regular original stock system in her phone and donot have usb debugging enabled in her phone. Her phone donot give her an option to reset the screen password with her google account.

    I would greatly appreciate your help PLEASE.

    Reply
    • Hi Keysha, have you tried Method 4 given above? If it doesn’t work, I would suggest you try with iMyFone LockWiper and dr.fone tools. If the problem persists, then kindly let me know. I’ll post a new updated tutorial for you.

      Reply
      • Thank you soo much for responding back. I will try method 4 correctly, step by step and let you know how it goes. The iMyfone, LockWiper and Dr.Fone donot have my

        phone model, it only have the Galaxy S4 sph-L720 but my phone is Galaxy S4 sph-L720T ( with the T at the end ) so i donot know if is still gona work correctly for my phone without losing the data. Thank you soo much again for your help.

        Reply
You Might Like
CQATest App