Pattern-locked Samsung Galaxy with SuperSU and no internet
First step : Reboot to a custom recovery. (You should probably know how to do that, but see here in case you don't).

Mount all the partitions (On TWRP, Check everything under Mount)

Connect to your PC, and launch an ADB shell. You should directly fall into a root shell.

Then, either use method 1, method 2, or both.

Method 1

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


Method 2

adb shell rm /data/system/gesture.key


Reboot, and enjoy !

Main source...