所谓的防水手机由于冲洗屏幕进水而触摸失灵了,幸好adb是打开的,还能用usb连上,然而问题来了,我加了图案锁屏,虽然adb shell能进,但死活操作不了啊。。。
首先,要确定触摸事件的设备,我的手机是event2
其次,分辨率肯定得搞清楚,可参考 https://blog.csdn.net/u011967006/article/details/53760678 获取分辨率。
stackoverflow上找到如下资料:
For touch events only 2 event types are used:
EV_ABS (3)
EV_SYN (0)
Touching the display (in case of Type A protocol) will result in an input report (sequence of input events) containing the following event codes:
ABS_MT_TRACKING_ID (57) - ID of the touch (important for multi-touch reports)
ABS_MT_POSITION_X (53) - x coordinate of the touch
ABS_MT_POSITION_Y (54) - y coordinate of the touch
ABS_MT_TOUCH_MAJOR (48) - basically width of your finger tip in pixels
ABS_MT_PRESSURE (58) - pressure of the touch
SYN_MT_REPORT (2) - end of separate touch data
SYN_REPORT (0) - end of report
然后就是不停尝试了,不同手机貌似不太一致。
如下是个图案 “Z”,最后居然一口气画了出来。一开始还以为中间断线没法完成了。
adb -s <phone sn> shell sendevent /dev/input/event2 3 57 8338
adb -s <phone sn> shell sendevent /dev/input/event2 1 330 1
adb -s <phone sn> shell sendevent /dev/input/event2 1 325 1
adb -s <phone sn> shell sendevent /dev/input/event2 3 53 300
adb -s <phone sn> shell sendevent /dev/input/event2 3 54 1680
adb -s <phone sn> shell sendevent /dev/input/event2 3 58 150
adb -s <phone sn> shell sendevent /dev/input/event2 3 48 5
adb -s <phone sn> shell sendevent /dev/input/event2 3 49 3
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 3 53 1150
adb -s <phone sn> shell sendevent /dev/input/event2 3 54 1630
adb -s <phone sn> shell sendevent /dev/input/event2 3 48 5
adb -s <phone sn> shell sendevent /dev/input/event2 3 58 50
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 3 53 300
adb -s <phone sn> shell sendevent /dev/input/event2 3 54 2280
adb -s <phone sn> shell sendevent /dev/input/event2 3 48 5
adb -s <phone sn> shell sendevent /dev/input/event2 3 58 50
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 3 53 1150
adb -s <phone sn> shell sendevent /dev/input/event2 3 54 2280
adb -s <phone sn> shell sendevent /dev/input/event2 3 48 5
adb -s <phone sn> shell sendevent /dev/input/event2 3 58 50
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0
adb -s <phone sn> shell sendevent /dev/input/event2 3 57 -1
adb -s <phone sn> shell sendevent /dev/input/event2 1 74 0
adb -s <phone sn> shell sendevent /dev/input/event2 1 75 0
adb -s <phone sn> shell sendevent /dev/input/event2 0 0 0