“This tutorial is only for educational purposes. Do not use these techniques to unlock someone’s phone pattern and violate their privacy. “

Pattern lock is one of the most used lock type in android phones. According to a study, 40% of the android users use pattern lock to protect their devices.

Researchers say the reason behind this is because the human brain can recall visual information better than letters or numbers.

With the advancement and evolution of technology and security, modern smartphones now use it’s user’s biometric data such as fingerprint and face to secure the device.

Even though modern smartphone users use new screen lock methods to secure their devices they tend to use pattern lock as their backup lock.

What Is Pattern Lock?

Android pattern lock is a 3×3 matrix with some built-in conditions.

  • Need to use one point at a time.
  • The minimum points that should be included in a pattern is 4.
  • Since pattern lock is a 3×3 matrix, the maximum number of points a pattern can contain is nine.
Android Lock Screen
If we number these dots in numerical order. It looks like this.

When we configure a pattern to use as the lock, algorithms inside the android operating system convert this pattern into an unsalted SHA-1 encrypted bytes sequence format.

This encrypted byte sequence is then stored in the location /data/system as a file known as “gesture.key.” We can’t directly access this file location. It is only readable by system processes. 

So how to unlock pattern lock in an android phone? The method explained in this article will show you how to unlock an android phone pattern lock without factory reset so that you can unlock your android phone pattern lock without losing data.

To proceed with the steps, there are few requirements your device needs to fulfill in order to crack the pattern.

  1. You needs to have physical access to the device.
  2. Your device need to be rooted because we can’t directly access the /data/system folder, which contains the gesture.key file.
  3. Since we are using ADB to pull the gesture.key file it is compulsory to make sure that your device has USB debugging enabled. Because If USB debugging is turned off, we can’t use ADB.

Also Read: How Does Hardware And Software Work Together

How To Unlock Android Phone Pattern Lock Without Losing Data

Since Android does not use a salted hash and we have finite possible pattern combinations, it’s not very difficult to generate a dictionary containing all possible hashes of sequences. 

We are using a technique known as brute-forcing to unlock pattern lock in android phone.

  • Go ahead and clone this repository. This repository contains a python script that will help us to crack the gesture.key file. (make sure to appreciate the developer’s work by giving him a star.)
  • Connect your smartphone to your computer using a USB cable and enable USB debugging.
  • Open up your terminal (If you don’t have ADB installed in your PC you can download and install it from below.)

Windows – Microsoft Windows ADB Setup

Mac OS – Mac OS ADB Setup

Linux – Linux ADB Setup

Debian-based Linux users can type the following command to install ADB: sudo apt-get install adb
Fedora/SUSE-based Linux users can type the following command to install ADB: sudo yum install android-tools

  •  Using the following two commands get into the adb shell and become the root.
$ adb shell
$ su
Getting root in adb shell
Getting root in adb shell
  • Now copy the gesture.key file from /data/system/ folder to sdcard using the following command.
$ cp /data/system/gesture.key sdcard
Extracting gesture.key file from /data/system/ folder
  • The file could now be pulled out to the local machine through this command. (adb pull /mnt/sdcard/gesture.key) Or you can copy the file by navigating to the sdcard.
  • Now change directory to cloned repository folder.
  • Move the extracted gesture.key file to that folder. There is a sample gesture.key file in that folder, make sure to delete that or replace that with your original key file.
  • Crack the hash using the python script. 

So that’s it, guys. I hope you find this article useful and informative. Make sure not to use this technique to commit a wrongful act that will result in harm to another.

Write A Comment