mirror of
https://github.com/revanced/jadb.git
synced 2025-02-11 09:36:48 +01:00
Friday hacking. Over-and-out
This commit is contained in:
parent
e538d58ddc
commit
5789458237
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user