Jump to content

How do I emulate screen swipe?


liamvictor
 Share

Recommended Posts

I've just bought a USB rubber ducky to help break the PIN on my Nexus. However that pigging thing currently isn't even charging, so to play with the ducky I want to try a few things on my Android phone, which is the Sony Xperia U.

However, that requires a screen swipe after switching on before you can enter the PIN. (NB, there doesn't seem to be an option to turn off that initial swipe in any of the security or screen settings.)

Without this swipe it accepts the first of the entered digits as the emergency number - strangely only the first, even with a delay on.

If I manually swipe then the PIN gets entered as normal. but as the point of having the Ducky is to automate an attack I was wondering if anyone knew how to emulate the initial unlock screen swipe?

Edited by liamvictor
Link to comment
Share on other sites

Stackoverflow is always a helpful place to go. I found this,

For Fair Use from:

http://stackoverflow.com/questions/6933626/android-how-to-emulate-swipe-gestures-in-avd

An interesting answer was this:

"One easy way is blind copying!

Instead of reading getevent output and figuring it out, then give to sendevent which is really slow. Simply blind copy the gestures from a real device with the same Android version, then blindly paste them.

You can copy the touch input in real device by:

1- In adb shell run dd if=/dev/input/event2 of=/sdcard/left.

2- Do the gesture you like to simulate (swipe).

3- This wall create a file (/sdcad/left) named file with the data generated by your real touch.

4- Move the file to any location in your AVD, lets say (/sdcad/left).

5- In AVD adb shell, run dd if=/sdcard/left of=/dev/input/event2

Viola! the simulated touch event will happen.

NOTE: In my device the file who has touch events is /dev/input/event2 , it might differ from a device to another, so you may use trial and error first.

In short, if you record and play on the same device:

1- dd if=/dev/input/event2 of=/sdcard/left

2- Do the touch for real

3- dd if=/sdcard/left of=/dev/input/event2

4- Repeat step 3, as much as you need.

Cheers :)"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...