2424
2525package com .yeetor ;
2626
27- import com .neovisionaries .ws .client .WebSocketException ;
28- import com .yeetor .adb .AdbDevice ;
2927import com .yeetor .adb .AdbServer ;
30- import com .yeetor .androidcontrol .client .RemoteClient ;
31- import com .yeetor .androidcontrol .server .LocalServer ;
32- import com .yeetor .androidcontrol .server .RemoteServer ;
3328import org .apache .log4j .Logger ;
34-
29+ import java . io . IOException ;
3530import java .security .InvalidParameterException ;
3631
3732
@@ -46,37 +41,44 @@ public class Main {
4641 * [client ip port serialNumber]
4742 * [client ip port]
4843 */
49- public static void main (String [] args ) throws InterruptedException {
44+ public static void main (String [] args ) throws InterruptedException , IOException {
5045
5146 // 监听USB的变化
5247 AdbServer .server ().listenUSB ();
5348
5449 // 同步ADB的设备列表
5550 AdbServer .server ().listenADB ();
5651
57- // parse命令行
58- try {
59- Config config = new Config (args );
60-
61- if (config .isClient ) {
62- new RemoteClient (config .ip , config .port , config .key , config .serialNumber );
63- } else {
64- if (config .isLocal ) {
65- new LocalServer (config .port ).start ();
66- } else {
67- new RemoteServer (config .port ).start ();
68- }
69- }
70- } catch (InvalidParameterException ex ) {
71- System .out .println ("localserver <port>: 启动本地服务器(p2p)\n remoteserver <port> 启动服务器 \n remoteclient <ip> <port> <key> [serialNumber] 启动客户端" );
72- System .exit (0 );
73- } catch (WebSocketException |InterruptedException e ) {
74- System .out .println ("启动服务器失败: " + e .getMessage ());
75- System .exit (0 );
76- } catch (Exception e ) {
77- e .printStackTrace ();
78- System .exit (0 );
52+ while (true ) {
53+ System .out .print ("> " );
54+ System .in .read ();
55+ // System.console().read
7956 }
57+
58+
59+ // // parse命令行
60+ // try {
61+ // Config config = new Config(args);
62+ //
63+ // if (config.isClient) {
64+ // new RemoteClient(config.ip, config.port, config.key, config.serialNumber);
65+ // } else {
66+ // if (config.isLocal) {
67+ // new LocalServer(config.port).start();
68+ // } else {
69+ // new RemoteServer(config.port).start();
70+ // }
71+ // }
72+ // } catch (InvalidParameterException ex) {
73+ // System.out.println("localserver <port>: 启动本地服务器(p2p)\n remoteserver <port> 启动服务器 \nremoteclient <ip> <port> <key> [serialNumber] 启动客户端");
74+ // System.exit(0);
75+ // } catch (WebSocketException|InterruptedException e) {
76+ // System.out.println("启动服务器失败: " + e.getMessage());
77+ // System.exit(0);
78+ // } catch (Exception e) {
79+ // e.printStackTrace();
80+ // System.exit(0);
81+ // }
8082 }
8183
8284 static class Config {
0 commit comments