[android adb shell] 怎么解锁图案锁屏(pattern lock)的手机?

所谓的防水手机由于冲洗屏幕进水而触摸失灵了,幸好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

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值