Jump to content
alien4u

Android Visual Control by USB. NO SDK Needed, NO SCREEN or TOUCH Screen Needed.

Recommended Posts

This is an small script to Control Android Devices by USB using adb, you can use it with phones with a Cracked Screen or not working Touch Screen.

What it Does:
- Show your Android Screen on your Desktop.
- Allow you to Swipe or Tap on the screen.
- Allow you to send BACK button event.
- Allow you to send WakeUp event.
- Allow you to move in List Menu using Swipe gestures or Mouse Wheel Forward or Backward.
- Refresh Screen with Wheel Click(Wheel Down)(To update your device screen on your desktop view).
- Allow you to unlock your Device with Pattern only 3 points pattern for now.

What it does not:
- Complex Unlock Pattern not supported yet I'm working on that.
- Complex Swipe gesture not supported yet, only straight lines.
- PC Keyboard to write SMS or Email not Supported yet, I'm working on that.
- Volume UP or Down not supported yet I will add it soon.
- No configuration interface or file yet, keys and actions are pre set on script code. I will change that.

What it Requires:
- In order to Compile the Script you need 3 files:
adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll
- In order to use the script without these files or without compile it you need to copy that files to user Temp Dir, or windows Temp dir I mean @TempDir.
 

Keys Used and Notes:
- Left Click will tap on the screen.
- Keep Left Click down, move the mouse and release it with perform a Swipe operation.(Mouse Drag = Swipe).
- Right Click will go back.
- Enter on the keyboard will send WakeUp event(Power Button)
- Wheel Down will Refresh the screen on your desktop, also F5.(Take last pictures of your android device screen)
 

IMPORTANT: There is an $scale variable on the script that scale down your Phone screenshot image to a good resolution to show on your Desktop, I use 1.5 of scale factor because my phone resolution is 480x800 and my Desktop Screen is 1366x768 and that scale factor is good enough for me.(I will calculate that in the future to make it automatic).

IMPORTANT 2: If you feel is very slow feel free to decrease Sleep() values from 400 to 200, that will be faster but you will need to Refresh with Wheel Click after you perform certain actions.

Thanks and Credits:
UDFs\MouseControl.au3 Base on Low Level Mouse Hook by @_Kurt all credits to him.
UDFs\GUICtrlPicPNG.au3 Based on PNG work around by @UEZ from the help file, All credits to him.

Kind Regards
Alien.
 

AndroidControl.zip

Edited by alien4u
Adding Swipe Operation Instruction.

Share this post


Link to post
Share on other sites
On 10/10/2016 at 5:22 AM, WormIT said:

Using screen capture to show Android's screens and control will make your Android system lag. :D

One of the purposes of this code is to learn and also access to an Android Device with a broken screen, is not really about efficiency.

Share this post


Link to post
Share on other sites

Bad idea to use Team Viewer as an intermediator, not only does it not work while the phone is not connected to the internet, you have to totally trust them with your device. I think there are better ways to do this... something like a VNC Server, I only know droidVNC but it does not work on my phone... But screen cap does work for now :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
8 hours ago, Lakes said:

Use the TeamViewer UDF instead of screen cap?

@Lakes
The idea here is you will not need any software installed on your Android Device with the broken screen.
You only need USB Debugging Enable that all.

As an example, a family:
Man, Woman, Kid they all enable USB debugging and connect at least once to this computer or any computer they can run the Script.
6 months or a year from that moment, if the computer operating system was not re-installed or the phone system, if they get a not working touch-screen or display they will be able to connect to their phones and save data or do some things... regardless what they have installed on their phones.

Kind Regards
Alien. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By nacerbaaziz
      hello sirs, please i created a tool witch get the focused control in a window and play a audio file linked with this controls
      e.g buttons, checkBoxes, radios, comboboxes, and others
      i know that their is a function that give us the control focus but it return the classNN
      i want to get the class name to use it with a switch and
      because their are more than class e.g button tbutton timagebutton tnewButton...
      please can any one help me to get the class name not the classnn
      thanks in advance
    • By nacerbaaziz
      Hello my friends
      Can we create a single context menu on more than one item?
      For example, a context menu includes standardized options on more than one control, such as buttons or check boxes
      to Create a context menu on one item am using this function
      GUICtrlCreateContextMenu ($ HWND)
      How to link it with more than one element please?
      or if we can't do that, please give me a solution
      so i tried to add an context menus to all the controls but the script will be long, for that if their are any solutions i hope to give it to me
      thanks in advanced
    • By wisem2540
      I am a huge autoit fan and have written several graphical apps.  I would love to get started building simple and complex android apps.  I am hoping someone here can recommend a good platform to get started with.  Preferably something that had an Autoit-like feel
    • By TheAutomator
      Is there a (simple) way to make your script using a picture-control to resize the gui?
      This would be useful for a transparant pop-up window with a custom made theme using picture controls:
      $Form = GUICreate('', 301, 173, 5, 5, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUICtrlCreatePic(@scriptdir & "\resize_win.bmp", 0, 73, 20, 51) ; some api call or code telling the os to use this picture as a resize border GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) While True if GUIGetMsg() = $GUI_EVENT_CLOSE then Exit WEnd  
      EDIT: to make it more clear what i wanna do, if you go with the mouse arrow over the border of a re-sizable window the arrow changes to a "resize" arrow, you click and drag the border and then the window size adjusts to the mouse position until you release the mouse button.
      I want my picture control to be used the same way as the resize border to resize my window.
    • By ur
      An application is there which is created using vc++,mostly mfc.
       
      DOn't know the details completely.
       
      WHen I try to automate the control clicks for testing the UI.
      THe below control is not detected.
      As you can see, during UI operations I can click the elements one by one.
      But all the elements is selected as a whole set, when I use the Windowinfo tool.

       
      How to click this using AutoIT.?
       
      Please suggest.
×
×
  • Create New...