Webkey for Androidicon

To access your phone write your nickname after slash (don't forget to enable "keep alive connection to webkey.cc" and "Start service")
http://webkey.cc/

About

XDA thread Twitter

How can I connect to the phone? Why is everything so complicated?

Webkey opens a standard TCP socket (port 80 is for http), and listens on that port. After starting the service, your phone writes something like:
Your phone is available at:
http://11.22.33.44

where in this example "11.22.33.44" is the IP address of your phone. Usually it is not so easy to remember, changes sometimes, and some 3g internet providers blocks it.

Unable to connect

If you are unable to connect to this address in your webbrowser, then your 3G internet provider blocks the incoming connections to your phone. Users from USA and UK complained about it. (If you are an expert, you can set up a VPN or an ssh reverse port forwarding. If you know how to do that, then stop reading.) However, the easiest solution is to use our server to forward the connection. Namely, your phone connects to our server (it works, because your phone starts the connection), and wait until you visit http://webkey.cc/nickname/. Then our server uses the opened connection (which was opened by the phone) to send the request. After that our server forwards every messages between your phone and your browser.
To use this, click on "Keep alive connection to webkey.cc". (If you don't use, it has minimal network traffic, only some bytes to open the connection.)

But I can connect using my IP

It should work on WiFi (then the IP address is usually something like 192.168.1.x), but then it is only accessable from the local area.
If it works on 3G, then you are lucky! It's not easy to remember the IP address, and usually it changes. You can use DynDNS to have an address like
http://yourphone.homeip.net
or something like that. Webkey has an option to refresh the IP address in the DynDNS database (otherwise how could they know when it has changed). Actually it checks your IP every minute, and if it differs from the last updated one, then it send the new IP to DynDNS.
Actually, if you use our server, it will redirect your browser directly to the phone, you will see a message like Your phone has a public IP, redirecting to ... (How it works: the server tries to connect back to the phone whenever it connects from a new IP address. If it can reach the phone, then the server will remember to do so.)

Just write an email if you have any question.

Download binary and source

Webkey is available on the Market. The source code and the apk can be download here.

Screenshots

Unlock phone from browser by dragging the screen:

screenshot

GPS and network positions:

screenshot

Read and write messages:

screenshot

View call list:

screenshot

Export contacts, messages, call list:

screenshot

Use terminal from browser:

screenshot

Create new users, users' right management:

screenshot

Read files on phone:

screenshot

Browse, download, upload files on the SD card:

screenshot

Server code for one client, how does this server works

How to reach your phone.

API for Webkey

You can use most of the functions without our html page. Webkey uses digest HTTP authentication, for example the program curl support it, and it's available for linux, Windows and Mac OS. There is no documentation about these functions (they are listed in webkey.c), but let's see some examples. The "phone's_address" can be an IP address or http://webkey.cc/nickname as well. It might happen that you have to reconnect twice. This server maintances at most 3 TCP connection with the phone, and it is had to tell which TCP flow is alive.

List the directory /system:
curl --digest http://username:password@phone's_address/run -d "ls -l -a /system/"
result:
drwxr-xr-x    1 root     root          2048 Nov 12 22:18 .
drwxr-xr-x   14 root     root             0 Nov 20 14:59 ..
drwxr-xr-x    1 root     root          2048 Nov 12 22:19 app
drwxr-xr-x    1 root     shell         2048 Nov 13 20:20 bin
-rw-r--r--    1 root     root          2207 Nov 12 22:19 build.prop
-rw-r--r--    1 root     root           206 Aug  1  2008 build.sapphire.prop
-rw-r--r--    1 root     root           268 Aug  1  2008 build.trout.prop
drwxr-xr-x    1 root     root          2048 Nov 13 00:03 etc
drwxr-xr-x    1 root     root          2048 Nov 12 22:18 fonts
drwxr-xr-x    1 root     root          2048 Nov 12 22:19 framework
drwxr-xr-x    1 root     root          2048 Nov 12 22:19 lib
drwxr-xr-x    1 root     root          2048 Nov 12 22:18 lost+found
drwxr-xr-x    1 root     root          2048 Nov 12 22:18 media
drwxr-xr-x    1 root     root          2048 Nov 12 22:18 usr
drwxrwxrwx    2 system   system        3037 Oct 28 05:24 xbin

Download /proc/cpuinfo:
curl --digest http://username:password@phone's_address/files/proc/cpuinfo
result:
Processor	: ARMv6-compatible processor rev 2 (v6l)
BogoMIPS	: 245.36
Features	: swp half thumb fastmult edsp java 
CPU implementer	: 0x41
CPU architecture: 6TEJ
CPU variant	: 0x1
CPU part	: 0xb36
CPU revision	: 2

Hardware	: trout
Revision	: 0080
Serial		: 0000000000000000

Get the position of the phone:
curl --digest http://username:password@phone's_address/gpsget
result should be in xml, but we were lazy, "g" means GPS, lat=latitude, long=longitude, mtime=how many seconds ago, accu=accurate (it might be empty, if there is no position yet):
_glat_47.4770039_glong_19.0527391_gmtime_98_gaccu_24

Save screenshot:
curl --digest http://username:password@phone's_address/screenshot.jpg > screenshot.jpg
or
curl --digest http://username:password@phone's_address/screenshot.png > screenshot.png

Inject keys ("Árvíztűrő tükörfúrógép" is a Hungarian flood-resistant mirror-drilling machine):
curl --digest http://username:password@phone's_address/injkey -d "Árvíztűrő tükörfúrógép"
The keys must be in UTF-8 format and previously added in the menu Config keys.


Inject touch events: Let's see how to unlock my Nexus One:
curl --digest http://username:password@phone's_address/touch
    -d "_v62_664_1_v102_662_1_v342_662_1_v390_668_1_v392_668_0"
or
curl --digest http://username:password@phone's_address/touch_v62_664_1_v102_662_1_v342_662_1_v390_668_1_v392_668_0
The first solution is better, because it works for a longer sequance. The terms has the following format: _OrientationXcoord_Ycoord_Pressed, there Orientation is either 'v' for vertical or 'h' for horizontal, and Pressed is either 1 for touch or drag, or 0 for release. You can make the screen touched forever by sending 1 and not sending 0, then touching the screen by hand releases the touch. You might want to send more requests for a long touch as there is no option for delay.


Read chat messages:
curl --digest http://username:password@phone's_address/getchatmessage_0
result:
<chat><readbypos>5</readbypos><id>1292416763</id>
<message><user>petya</user><time>1291766926</time><data>Hi there!</data></message>
<message><user>phone</user><time>1291766955</time><data>Hi!</data></message>
<readby name="petya">2</readby><readby name="phone">2</readby></chat>
where the main point is the fields user and data. The time is in Unix time.


Write chat messages:
curl --digest http://username:password@phone's_address/writechatmessage -d 'It's me!'

About us

Péter Móra (email), Zoltán Papp (email)
We are guys from Hungary and have enough time to develop Webkey :) Zoltan has already has a job as a coder and tester, Péter is doing his PhD in Math. We are not evil, which means the followings:

Thanks

Mongoose webserver, which was a good choice: http://code.google.com/p/mongoose/

Brad Fitzpatrick for the typing idea: http://brad.livejournal.com/2400054.html

Tuomas Räsänen for the Simple C-API to the Linux uinput-system: http://codegrove.org/libsuinput/

Android-vnc, I've learnt howto read from framebuffers: http://code.google.com/p/android-vnc/

Android Open Source Project, for the kcm.* files: http://android.git.kernel.org/

AjaXplorer: http://www.ajaxplorer.info

Robert Harder, Base64 Java package: http://iharder.net/base64

René Nyffenegger's base64 C++ package: http://www.adp-gmbh.ch/cpp/common/base64.html

Minizip: Zip and UnZip additionnal library: http://www.winimage.com/zLibDll/minizip.html

libpng, libjpeg, libz of course.