简体   繁体   English

解锁屏幕Galaxy Nexus ADB

[英]Unlock Screen Galaxy Nexus ADB


I'm having a nightmare day with a broken screen , 我正在做噩梦般的一天,屏幕坏了,
I've 'Droid Screen' with 'Ultimate Touchscreen Control' however the gestures dont seem to work for this Phones unlock it usually requires a swipe that stops however I can get it to 'click' in place , any ideas to unlock with the ADB so I can get to my messages would be a life saver 我已经将“ Droid Screen”和“ Ultimate Touchscreen Control”设置为“ Ultimate Touchscreen Control”,但是该手势似乎不适用于此手机。解锁时,通常需要滑动才能停止,但是我可以将其“点击”到位,任何可以通过ADB解锁的想法这样我就能知道我的消息将为您节省生命

除了@snachmsm的有用技巧之外,我还整理了一个Shell脚本,用于通过ADB发送模式滑动,这应该使它变得简单易用: android-pattern-unlock

so let me be your life saver (maybe) 所以让我成为您的救生员(也许)

I've broke screen in my Nexus 4 few weeks ago and I was also looking for similar answer. 几周前,我的Nexus 4屏幕破裂了,我也在寻找类似的答案。 it's is important that it was Nexus 4 stock Kitkat 4.4 with no root, only ADB and default pattern lock (dots) 重要的是Nexus 4股票Kitkat 4.4不带root,只有ADB和默认模式锁定(点)

so I've been looking in adb command and found simple sendevent method. 所以我一直在寻找adb命令并找到简单的sendevent方法。 it alows to do swipes like you need, some example: 它允许您根据需要进行滑动,例如:

cd C:\sdk_patch\platform-tools
adb shell sendevent /dev/input/event2 3 57 58 
adb shell sendevent /dev/input/event2 3 58 17 
adb shell sendevent /dev/input/event2 3 53 470 
adb shell sendevent /dev/input/event2 3 54 1200
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 53 670 
adb shell sendevent /dev/input/event2 3 54 1200
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 58 88 
adb shell sendevent /dev/input/event2 3 54 1494 
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 54 1820 
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 58 96 
adb shell sendevent /dev/input/event2 3 53 612 
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 58 98 
adb shell sendevent /dev/input/event2 3 53 617 
adb shell sendevent /dev/input/event2 0 0 0 
adb shell sendevent /dev/input/event2 3 57 4294967295 
adb shell sendevent /dev/input/event2 0 0 0

this code I'm executing as bat and it is drawing my pattern lock which was 此代码我以bat的身份执行,并且正在绘制我的模式锁

1 2 3
4 5 6
7 8 9

1 -> 2 -> 5 -> 8 (dots connected) 1-> 2-> 5-> 8(点连接)

I don't really remember these numbers what they mean, but you can found it in documentation. 我真的不记得这些数字的含义,但是您可以在文档中找到它们。 what I remember that 53 and 54 are position (x/y?) in pixels of touch, point 'to swipe', then 0 0 0 as confirmation (?). 我记得5354是触摸像素的位置(x / y?),指向“滑动”,然后将0 0 0作为确认(?)。 so you need to know resolution of your screen (N4 is HD) and also position (approximate, point that allows to dot 'check') of your dots (note that probably screens with physical buttons might have dots a bit lower than N4 with soft buttons shrinking a bit screen). 因此,您需要知道屏幕的分辨率(N4为高清),还需要知道点的位置(大约,允许点“检查”的点)(请注意,带有物理按钮的屏幕的点可能比带有软键的N4低一些)按钮缩小屏幕)。 in above code there are also some short delays ( 58 and miliseconds after?) so you can see how pattern/swipe is drawing (pretty fast as I remember) 在上面的代码中,还存在一些短暂的延迟( 58和毫秒后吗?),因此您可以看到图案/划像的绘制方式(我记得非常快)

important : different devices have different event number responsible for touch. 重要提示 :不同的设备具有负责触摸的不同event编号。 like above in my N4 its event2 , but I've been testing this adb methods with Nexus 7 2013 (full HD, dots in different coordinates, also only adb without root) and there event7 was working (if I remember properly...). 就像上面的N4中的event2 ,但是我一直在使用Nexus 7 2013测试这种adb方法(全高清,点坐标不同,也只有adb而没有root),并且event7正常工作(如果我没记错的话...) 。 Internet said than most common is event0 , its a guessing, depending on producer... In your device it might me another number ( event numbers starting at 0 and rising continously, adb will throw an error/warn when you call non-existing event, probably smth between 7-9 is last event file number) 互联网说,最普遍的是event0 ,它是一个猜测,取决于生产者...在您的设备上,它可能是我另一个数字( event编号从0开始并连续上升,当您调用不存在的事件时,adb会引发错误/警告,大概7-9之间是最后一个事件文件的编号)

tip : after unlock first thing to do is set a long screen-off wait time (1 hr) and also in dev options check option "don't turn off screen when charging' or smth like this. these will allow you to keep screen on for long time without auto-lock. you can also remove pattern lock, but in options you need to write it and positions of dots are a bit different, so your onlock code with coordinates may not work 提示 :解锁后要做的第一件事是设置较长的关闭屏幕的等待时间(1小时),然后在开发人员选项中选中“在充电时请勿关闭屏幕”或类似的选项。这些操作可以让您保持屏幕关闭长时间不启用自动锁定。您也可以删除模式锁定,但是在选项中,您需要编写模式锁定,并且点的位置有些不同,因此带坐标的锁定代码可能无法正常工作

I know that it's not clear, stright answer, but I was looking for this method a lot and some tests with coordinates and event number should give you what you want. 我知道这是不明确的,挺直的答案,但我一直在寻找这种方法很多 ,一些测试坐标和event数量应该给你你想要的东西。 also: when you unlock your phone you might use Android Control which transmitting your screen straight to computer, it also supports touching this screen (but only single tap and stright swipe without turning). 还可以:当您解锁手机时,您可以使用Android Control将屏幕直接传输到计算机,它还支持触摸此屏幕(但仅单击和不动就可以滑动)。 you might install any backup app from Google Play, eg for sms backuping. 您可以从Google Play安装任何备份应用,例如用于短信备份。 Wish you luck 祝您好运

PS. PS。 hopeful method for adb is also adb shell input (check docs) but it supports (as I know) only straight swipe and single tap (and other ones without turning), I'm guessing that Android Control and similar desktop apps are using these commands and this is a reason for no ability of turing while swiping). 对于adb来说,一种有希望的方法也是adb shell input (检查文档),但是它(仅支持笔直滑动和单击)(以及其他一些不旋转的)(据我所知),我猜测Android Control和类似的桌面应用程序正在使用这些命令这就是无法在滑动时浏览的原因)。 also I've heard that newest AirDroid 3 can also stream your screen, maybe this app will help 我也听说过最新的AirDroid 3也可以播放您的屏幕,也许这个程序会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM