Friday hacking. Over-and-out

This commit is contained in:
Samuel Carlsson 2013-07-26 16:49:12 +02:00
parent e538d58ddc
commit 5789458237
2 changed files with 10 additions and 3 deletions

View File

@ -33,11 +33,18 @@ public class AdbResponder implements Runnable {
String command = new String(buffer, Charset.forName("utf-8"));
System.out.println("Command: " + command);
if ("host.devices".equals(command)) {
if ("host:version".equals(command)) {
output.write("OKAY");
}
else if ("host:devices".equals(command)) {
output.write("OKAY");
send(output, "X\tdevice\nY\tdevice");
}
output.write("FAIL");
else
{
output.write("FAIL");
}
output.flush();
} catch (IOException e) {
}
@ -50,6 +57,5 @@ public class AdbResponder implements Runnable {
public void send(OutputStreamWriter writer, String response) throws IOException {
writer.write(getCommandLength(response));
writer.write(response);
writer.flush();
}
}

View File

@ -9,6 +9,7 @@ import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.Charset;
// >set ANDROID_ADB_SERVER_PORT=15037
public class AdbServer implements Runnable {
private int port = 15037;