Created
October 31, 2012 01:11
-
-
Save dhylands/3984204 to your computer and use it in GitHub Desktop.
Unlock the screen on sgs2 (early slide up version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
# | |
# Constants from include/linux/input.h | |
EV_SYN=0 | |
EV_ABS=3 | |
SYN_REPORT=0 | |
ABS_MT_TOUCH_MAJOR=48 | |
ABS_MT_POSITION_X=53 | |
ABS_MT_POSITION_Y=54 | |
ABS_MT_TRACKING_ID=57 | |
ABS_MT_PRESSURE=58 | |
TOUCH_DEV=/dev/input/event2 | |
last_x=0 | |
last_y=0 | |
Sync() | |
{ | |
sendevent ${TOUCH_DEV} ${EV_SYN} ${SYN_REPORT} 0 | |
} | |
SlideTo() | |
{ | |
last_x=$1 | |
last_y=$2 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_POSITION_X} ${last_x} | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_POSITION_Y} ${last_y} | |
Sync | |
} | |
StartTouch() | |
{ | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_TRACKING_ID} $1 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_POSITION_X} $2 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_POSITION_Y} $3 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_TOUCH_MAJOR} 80 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_PRESSURE} 5 | |
Sync | |
} | |
EndTouch() | |
{ | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_PRESSURE} 1 | |
sendevent ${TOUCH_DEV} ${EV_ABS} ${ABS_MT_TRACKING_ID} -1 | |
Sync | |
} | |
StartTouch 5 200 500 | |
sleep 1 | |
SlideTo 200 450 | |
SlideTo 200 400 | |
SlideTo 200 350 | |
SlideTo 200 300 | |
SlideTo 200 250 | |
sleep 2 | |
SlideTo 200 200 | |
EndTouch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment