From dee777c6106de758ba8e4da2eabc07e7c0f60256 Mon Sep 17 00:00:00 2001 From: Eason <291028775@qq.com> Date: Mon, 5 Jun 2023 20:22:36 +0800 Subject: [PATCH] doc: rm some config --- config/application-sonic-agent.yml | 13 ++----------- src/main/docker/config/application-sonic-agent.yml | 13 ++----------- src/main/docker/docker-compose-zh.yml | 8 -------- src/main/docker/docker-compose.yml | 8 -------- .../bridge/android/AndroidDeviceBridgeTool.java | 2 -- .../bridge/android/AndroidDeviceThreadPool.java | 2 -- .../agent/bridge/android/AndroidSupplyTool.java | 2 -- .../agent/bridge/ios/IOSDeviceLocalStatus.java | 1 - .../sonic/agent/bridge/ios/IOSDeviceThreadPool.java | 2 -- .../org/cloud/sonic/agent/bridge/ios/SibTool.java | 7 ++++--- .../agent/common/config/WsEndpointConfigure.java | 3 +-- .../cloud/sonic/agent/common/maps/ScreenMap.java | 1 + .../agent/common/maps/WebSocketSessionMap.java | 2 +- .../org/cloud/sonic/agent/tests/AndroidTests.java | 2 +- .../java/org/cloud/sonic/agent/tests/IOSTests.java | 2 +- .../java/org/cloud/sonic/agent/tests/LogUtil.java | 2 +- .../org/cloud/sonic/agent/tests/RunStepThread.java | 2 -- .../android/minicap/MiniCapInputSocketThread.java | 2 +- .../tests/android/minicap/MiniCapLocalThread.java | 2 +- .../android/minicap/MiniCapOutputSocketThread.java | 2 +- .../agent/tests/android/minicap/MiniCapUtil.java | 2 +- .../android/scrcpy/ScrcpyInputSocketThread.java | 2 +- .../tests/android/scrcpy/ScrcpyLocalThread.java | 2 +- .../android/scrcpy/ScrcpyOutputSocketThread.java | 2 +- .../tests/android/scrcpy/ScrcpyServerUtil.java | 2 +- .../sonic/agent/tests/handlers/IOSStepHandler.java | 1 - .../agent/tests/handlers/NoneConditionHandler.java | 2 +- .../sonic/agent/tests/ios/IOSPerfDataThread.java | 2 +- .../agent/tests/ios/IOSTestTaskBootThread.java | 2 +- .../java/org/cloud/sonic/agent/tools/SGMTool.java | 3 --- .../agent/websockets/AndroidScreenWSServer.java | 6 +++--- .../cloud/sonic/agent/websockets/AudioWSServer.java | 12 ++++++------ .../sonic/agent/websockets/IAndroidWSServer.java | 2 +- .../cloud/sonic/agent/websockets/IIOSWSServer.java | 2 +- .../sonic/agent/websockets/WebViewWSServer.java | 6 +++--- .../sonic/agent/android/MockStepDebugTest.java | 2 +- 36 files changed, 40 insertions(+), 88 deletions(-) diff --git a/config/application-sonic-agent.yml b/config/application-sonic-agent.yml index 259d85fe..8fadd29d 100755 --- a/config/application-sonic-agent.yml +++ b/config/application-sonic-agent.yml @@ -12,17 +12,8 @@ sonic: # Change to SONIC_SERVER_PORT of server | 改成server的SONIC_SERVER_PORT port: 3000 +# The following will be migrated to the server configuration in the future | 以下未来会迁移到server配置 modules: - android: - # Whether to enable Android module | 是否开启安卓模块 - enable: true - # Whether to enable sonic-android-supply module | 是否开启sonic-android-supply功能 - use-sas: true ios: - # Whether to turn on the iOS module. Please ensure that iTunes is installed on this computer for Windows users | 是否开启iOS模块。开启的windows用户请确保本机已安装iTunes - enable: true # Replace with the bundleId of wda. If there is no. xcrunner suffix, it will be automatically completed. | 替换为wda的bundleId,如果没有.xctrunner后缀会自动补全 - wda-bundle-id: com.sonic.WebDriverAgentRunner - sgm: - # Whether to enable the sonic-go-mitmproxy module | 是否开启sonic-go-mitmproxy功能 - enable: true \ No newline at end of file + wda-bundle-id: com.sonic.WebDriverAgentRunner \ No newline at end of file diff --git a/src/main/docker/config/application-sonic-agent.yml b/src/main/docker/config/application-sonic-agent.yml index 2265fc1c..d49803db 100755 --- a/src/main/docker/config/application-sonic-agent.yml +++ b/src/main/docker/config/application-sonic-agent.yml @@ -12,17 +12,8 @@ sonic: # Change to SONIC_SERVER_PORT of server | 改成server的SONIC_SERVER_PORT port: ${SONIC_SERVER_PORT:3000} +# The following will be migrated to the server configuration in the future | 以下未来会迁移到server配置 modules: - android: - # Whether to enable Android module | 是否开启安卓模块 - enable: ${ANDROID_ENABLE:true} - # Whether to enable sonic-android-supply module | 是否开启sonic-android-supply功能 - use-sas: ${USE_SAS:true} ios: - # Whether to turn on the iOS module. Please ensure that iTunes is installed on this computer for Windows users | 是否开启iOS模块。开启的windows用户请确保本机已安装iTunes - enable: ${IOS_ENABLE:true} # Replace with the bundleId of wda. If there is no. xcrunner suffix, it will be automatically completed. | 替换为wda的bundleId,如果没有.xctrunner后缀会自动补全 - wda-bundle-id: ${WDA_BUNDLE_ID:com.facebook.WebDriverAgentRunner.xctrunner} - sgm: - # Whether to enable the sonic-go-mitmproxy module | 是否开启sonic-go-mitmproxy功能 - enable: ${SGM_ENABLE:true} \ No newline at end of file + wda-bundle-id: ${WDA_BUNDLE_ID:com.facebook.WebDriverAgentRunner.xctrunner} \ No newline at end of file diff --git a/src/main/docker/docker-compose-zh.yml b/src/main/docker/docker-compose-zh.yml index a5ba0f28..6e5a2d6e 100755 --- a/src/main/docker/docker-compose-zh.yml +++ b/src/main/docker/docker-compose-zh.yml @@ -12,16 +12,8 @@ services: - AGENT_PORT=7777 # Replace with the key of agent generated by the new front-end | 替换为前端新增Agent生成的key - AGENT_KEY=29002272-4659-4808-a804-08ce3388b136 - # Whether to enable Android module | 是否开启安卓模块 - - ANDROID_ENABLE=true - # Whether to enable sonic-android-supply module | 是否开启sonic-android-supply功能 - - USE_SAS=true - # Whether to turn on the iOS module. | 是否开启iOS模块 - - IOS_ENABLE=true # Replace with the bundleId of wda. If there is no. xcrunner suffix, it will be automatically completed. | 替换为wda的bundleId,如果没有.xctrunner后缀会自动补全 - WDA_BUNDLE_ID=com.facebook.WebDriverAgentRunner.xctrunner - # Whether to enable the sonic-go-mitmproxy module | 是否开启sonic-go-mitmproxy功能 - - SGM_ENABLE=true network_mode: "host" privileged: true volumes: diff --git a/src/main/docker/docker-compose.yml b/src/main/docker/docker-compose.yml index fbae32b4..9f4f70c1 100755 --- a/src/main/docker/docker-compose.yml +++ b/src/main/docker/docker-compose.yml @@ -12,16 +12,8 @@ services: - AGENT_PORT=7777 # Replace with the key of agent generated by the new front-end | 替换为前端新增Agent生成的key - AGENT_KEY=29002272-4659-4808-a804-08ce3388b136 - # Whether to enable Android module | 是否开启安卓模块 - - ANDROID_ENABLE=true - # Whether to enable sonic-android-supply module | 是否开启sonic-android-supply功能 - - USE_SAS=true - # Whether to turn on the iOS module. | 是否开启iOS模块 - - IOS_ENABLE=true # Replace with the bundleId of wda. If there is no. xcrunner suffix, it will be automatically completed. | 替换为wda的bundleId,如果没有.xctrunner后缀会自动补全 - WDA_BUNDLE_ID=com.facebook.WebDriverAgentRunner.xctrunner - # Whether to enable the sonic-go-mitmproxy module | 是否开启sonic-go-mitmproxy功能 - - SGM_ENABLE=true network_mode: "host" privileged: true volumes: diff --git a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceBridgeTool.java b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceBridgeTool.java index a28701eb..6244a328 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceBridgeTool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceBridgeTool.java @@ -35,7 +35,6 @@ import org.cloud.sonic.agent.tools.file.UploadTools; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.DependsOn; import org.springframework.context.event.ContextRefreshedEvent; @@ -61,7 +60,6 @@ * @des ADB工具类 * @date 2021/08/16 19:26 */ -@ConditionalOnProperty(value = "modules.android.enable", havingValue = "true") @DependsOn({"androidThreadPoolInit"}) @Component @Slf4j diff --git a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceThreadPool.java b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceThreadPool.java index 38a85846..464fe7e1 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceThreadPool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidDeviceThreadPool.java @@ -1,6 +1,5 @@ package org.cloud.sonic.agent.bridge.android; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -13,7 +12,6 @@ * @date 2021/08/16 19:26 */ @Configuration -@ConditionalOnProperty(value = "modules.android.enable", havingValue = "true") public class AndroidDeviceThreadPool { public static ExecutorService cachedThreadPool; diff --git a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidSupplyTool.java b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidSupplyTool.java index 1b8bf379..09642c06 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidSupplyTool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/android/AndroidSupplyTool.java @@ -25,7 +25,6 @@ import org.cloud.sonic.agent.tests.LogUtil; import org.cloud.sonic.agent.tools.BytesTool; import org.cloud.sonic.agent.tools.PortTool; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.lang.NonNull; @@ -39,7 +38,6 @@ import static org.cloud.sonic.agent.tools.BytesTool.sendText; @Slf4j -@ConditionalOnProperty(value = "modules.android.use-sas", havingValue = "true") @Component public class AndroidSupplyTool implements ApplicationListener { private static File sasBinary = new File("plugins" + File.separator + "sonic-android-supply"); diff --git a/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceLocalStatus.java b/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceLocalStatus.java index 17d90568..33c5113a 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceLocalStatus.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceLocalStatus.java @@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSONObject; import org.cloud.sonic.agent.common.interfaces.DeviceStatus; import org.cloud.sonic.agent.common.maps.IOSDeviceManagerMap; -import org.cloud.sonic.agent.common.maps.IOSInfoMap; import org.cloud.sonic.agent.transport.TransportWorker; public class IOSDeviceLocalStatus { diff --git a/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceThreadPool.java b/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceThreadPool.java index 2f92e801..68dab5a9 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceThreadPool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/ios/IOSDeviceThreadPool.java @@ -1,6 +1,5 @@ package org.cloud.sonic.agent.bridge.ios; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -13,7 +12,6 @@ * @date 2021/08/25 19:26 */ @Configuration -@ConditionalOnProperty(value = "modules.ios.enable", havingValue = "true") public class IOSDeviceThreadPool { public static ExecutorService cachedThreadPool; diff --git a/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java b/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java index da67f57c..3535adb5 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java @@ -26,13 +26,15 @@ import org.cloud.sonic.agent.common.maps.*; import org.cloud.sonic.agent.tests.LogUtil; import org.cloud.sonic.agent.tests.ios.IOSBatteryThread; -import org.cloud.sonic.agent.tools.*; +import org.cloud.sonic.agent.tools.BytesTool; +import org.cloud.sonic.agent.tools.PortTool; +import org.cloud.sonic.agent.tools.ProcessCommandTool; +import org.cloud.sonic.agent.tools.ScheduleTool; import org.cloud.sonic.agent.transport.TransportWorker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.DependsOn; @@ -58,7 +60,6 @@ import static org.cloud.sonic.agent.tools.BytesTool.sendText; -@ConditionalOnProperty(value = "modules.ios.enable", havingValue = "true") @DependsOn({"iOSThreadPoolInit"}) @Component @Order(value = Ordered.HIGHEST_PRECEDENCE) diff --git a/src/main/java/org/cloud/sonic/agent/common/config/WsEndpointConfigure.java b/src/main/java/org/cloud/sonic/agent/common/config/WsEndpointConfigure.java index 16497ecd..41f8f651 100755 --- a/src/main/java/org/cloud/sonic/agent/common/config/WsEndpointConfigure.java +++ b/src/main/java/org/cloud/sonic/agent/common/config/WsEndpointConfigure.java @@ -1,12 +1,11 @@ package org.cloud.sonic.agent.common.config; +import jakarta.websocket.server.ServerEndpointConfig; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; -import jakarta.websocket.server.ServerEndpointConfig; - public class WsEndpointConfigure extends ServerEndpointConfig.Configurator implements ApplicationContextAware { private static volatile BeanFactory context; diff --git a/src/main/java/org/cloud/sonic/agent/common/maps/ScreenMap.java b/src/main/java/org/cloud/sonic/agent/common/maps/ScreenMap.java index a5709ce3..4e0fb9e8 100755 --- a/src/main/java/org/cloud/sonic/agent/common/maps/ScreenMap.java +++ b/src/main/java/org/cloud/sonic/agent/common/maps/ScreenMap.java @@ -1,6 +1,7 @@ package org.cloud.sonic.agent.common.maps; import jakarta.websocket.Session; + import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/org/cloud/sonic/agent/common/maps/WebSocketSessionMap.java b/src/main/java/org/cloud/sonic/agent/common/maps/WebSocketSessionMap.java index 67275d80..20e39a67 100755 --- a/src/main/java/org/cloud/sonic/agent/common/maps/WebSocketSessionMap.java +++ b/src/main/java/org/cloud/sonic/agent/common/maps/WebSocketSessionMap.java @@ -1,9 +1,9 @@ package org.cloud.sonic.agent.common.maps; +import jakarta.websocket.Session; import org.springframework.lang.NonNull; import org.springframework.util.Assert; -import jakarta.websocket.Session; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/org/cloud/sonic/agent/tests/AndroidTests.java b/src/main/java/org/cloud/sonic/agent/tests/AndroidTests.java index 622adad8..2ee28f20 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/AndroidTests.java +++ b/src/main/java/org/cloud/sonic/agent/tests/AndroidTests.java @@ -19,10 +19,10 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import org.cloud.sonic.agent.tests.handlers.AndroidStepHandler; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.common.interfaces.DeviceStatus; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; +import org.cloud.sonic.agent.tests.handlers.AndroidStepHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestContext; diff --git a/src/main/java/org/cloud/sonic/agent/tests/IOSTests.java b/src/main/java/org/cloud/sonic/agent/tests/IOSTests.java index 26f46d63..99559ed2 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/IOSTests.java +++ b/src/main/java/org/cloud/sonic/agent/tests/IOSTests.java @@ -19,9 +19,9 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.cloud.sonic.agent.bridge.ios.SibTool; import org.cloud.sonic.agent.common.interfaces.DeviceStatus; +import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.cloud.sonic.agent.tests.ios.IOSTestTaskBootThread; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/cloud/sonic/agent/tests/LogUtil.java b/src/main/java/org/cloud/sonic/agent/tests/LogUtil.java index 5a6f6ac6..9114ab71 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/LogUtil.java +++ b/src/main/java/org/cloud/sonic/agent/tests/LogUtil.java @@ -18,6 +18,7 @@ package org.cloud.sonic.agent.tests; import com.alibaba.fastjson.JSONObject; +import jakarta.websocket.Session; import org.cloud.sonic.agent.common.interfaces.DeviceStatus; import org.cloud.sonic.agent.common.interfaces.StepType; import org.cloud.sonic.agent.common.maps.WebSocketSessionMap; @@ -25,7 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/src/main/java/org/cloud/sonic/agent/tests/RunStepThread.java b/src/main/java/org/cloud/sonic/agent/tests/RunStepThread.java index 42850792..4059d069 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/RunStepThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/RunStepThread.java @@ -17,8 +17,6 @@ */ package org.cloud.sonic.agent.tests; -import org.cloud.sonic.agent.tests.LogUtil; - /** * @author JayWenStar * @date 2022/2/11 10:49 上午 diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapInputSocketThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapInputSocketThread.java index 49b4d214..c875eeed 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapInputSocketThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapInputSocketThread.java @@ -18,6 +18,7 @@ package org.cloud.sonic.agent.tests.android.minicap; import com.android.ddmlib.IDevice; +import jakarta.websocket.Session; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.common.maps.ScreenMap; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; @@ -25,7 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.io.IOException; import java.io.InputStream; import java.net.Socket; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapLocalThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapLocalThread.java index 9d490643..08430121 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapLocalThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapLocalThread.java @@ -20,13 +20,13 @@ import com.alibaba.fastjson.JSONObject; import com.android.ddmlib.IDevice; import com.android.ddmlib.IShellOutputReceiver; +import jakarta.websocket.Session; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.cloud.sonic.agent.tools.BytesTool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.io.File; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapOutputSocketThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapOutputSocketThread.java index 5ae84dce..c04e8158 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapOutputSocketThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapOutputSocketThread.java @@ -18,12 +18,12 @@ package org.cloud.sonic.agent.tests.android.minicap; import com.alibaba.fastjson.JSONObject; +import jakarta.websocket.Session; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.cloud.sonic.agent.tools.BytesTool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.util.Arrays; import java.util.List; import java.util.concurrent.BlockingQueue; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapUtil.java b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapUtil.java index 951222c5..6762ebd4 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapUtil.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/minicap/MiniCapUtil.java @@ -18,13 +18,13 @@ package org.cloud.sonic.agent.tests.android.minicap; import com.android.ddmlib.IDevice; +import jakarta.websocket.Session; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.tests.TaskManager; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.util.List; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicReference; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyInputSocketThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyInputSocketThread.java index a4701687..9a52ba4f 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyInputSocketThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyInputSocketThread.java @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; import com.android.ddmlib.IDevice; +import jakarta.websocket.Session; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.common.maps.ScreenMap; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; @@ -27,7 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.io.IOException; import java.io.InputStream; import java.net.InetSocketAddress; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyLocalThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyLocalThread.java index 20a0d433..38359250 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyLocalThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyLocalThread.java @@ -20,11 +20,11 @@ import com.alibaba.fastjson.JSONObject; import com.android.ddmlib.IDevice; import com.android.ddmlib.IShellOutputReceiver; +import jakarta.websocket.Session; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.io.File; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyOutputSocketThread.java b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyOutputSocketThread.java index 6f3e5fe3..9c6ba5a8 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyOutputSocketThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyOutputSocketThread.java @@ -17,11 +17,11 @@ */ package org.cloud.sonic.agent.tests.android.scrcpy; +import jakarta.websocket.Session; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.util.concurrent.BlockingQueue; import static org.cloud.sonic.agent.tools.BytesTool.sendByte; diff --git a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyServerUtil.java b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyServerUtil.java index f7a40130..aa6651c4 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyServerUtil.java +++ b/src/main/java/org/cloud/sonic/agent/tests/android/scrcpy/ScrcpyServerUtil.java @@ -18,13 +18,13 @@ package org.cloud.sonic.agent.tests.android.scrcpy; import com.android.ddmlib.IDevice; +import jakarta.websocket.Session; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.tests.TaskManager; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.websocket.Session; import java.util.concurrent.LinkedBlockingQueue; import static org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread.ANDROID_TEST_TASK_BOOT_PRE; diff --git a/src/main/java/org/cloud/sonic/agent/tests/handlers/IOSStepHandler.java b/src/main/java/org/cloud/sonic/agent/tests/handlers/IOSStepHandler.java index 0d92d25a..56f77025 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/handlers/IOSStepHandler.java +++ b/src/main/java/org/cloud/sonic/agent/tests/handlers/IOSStepHandler.java @@ -37,7 +37,6 @@ import org.cloud.sonic.agent.tools.SpringTool; import org.cloud.sonic.agent.tools.file.DownloadTool; import org.cloud.sonic.agent.tools.file.UploadTools; -import org.cloud.sonic.driver.android.service.AndroidElement; import org.cloud.sonic.driver.common.enums.PasteboardType; import org.cloud.sonic.driver.common.models.BaseElement; import org.cloud.sonic.driver.common.models.WindowSize; diff --git a/src/main/java/org/cloud/sonic/agent/tests/handlers/NoneConditionHandler.java b/src/main/java/org/cloud/sonic/agent/tests/handlers/NoneConditionHandler.java index f51f00ae..7cfd0afb 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/handlers/NoneConditionHandler.java +++ b/src/main/java/org/cloud/sonic/agent/tests/handlers/NoneConditionHandler.java @@ -22,8 +22,8 @@ import org.cloud.sonic.agent.common.enums.ConditionEnum; import org.cloud.sonic.agent.common.interfaces.PlatformType; import org.cloud.sonic.agent.common.models.HandleContext; -import org.cloud.sonic.agent.tests.android.AndroidRunStepThread; import org.cloud.sonic.agent.tests.RunStepThread; +import org.cloud.sonic.agent.tests.android.AndroidRunStepThread; import org.cloud.sonic.agent.tests.ios.IOSRunStepThread; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSPerfDataThread.java b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSPerfDataThread.java index b45c027b..eacb39ea 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSPerfDataThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSPerfDataThread.java @@ -18,8 +18,8 @@ package org.cloud.sonic.agent.tests.ios; import com.alibaba.fastjson.JSONObject; -import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.cloud.sonic.agent.bridge.ios.SibTool; +import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSTestTaskBootThread.java b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSTestTaskBootThread.java index da187a1d..08e544e3 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSTestTaskBootThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSTestTaskBootThread.java @@ -18,11 +18,11 @@ package org.cloud.sonic.agent.tests.ios; import com.alibaba.fastjson.JSONObject; -import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.cloud.sonic.agent.bridge.ios.IOSDeviceLocalStatus; import org.cloud.sonic.agent.bridge.ios.SibTool; import org.cloud.sonic.agent.common.interfaces.ResultDetailStatus; import org.cloud.sonic.agent.tests.TaskManager; +import org.cloud.sonic.agent.tests.handlers.IOSStepHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/cloud/sonic/agent/tools/SGMTool.java b/src/main/java/org/cloud/sonic/agent/tools/SGMTool.java index 9e052d8d..fdbef825 100755 --- a/src/main/java/org/cloud/sonic/agent/tools/SGMTool.java +++ b/src/main/java/org/cloud/sonic/agent/tools/SGMTool.java @@ -19,15 +19,12 @@ import lombok.extern.slf4j.Slf4j; import org.cloud.sonic.agent.common.maps.GlobalProcessMap; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; -import java.util.List; import java.util.concurrent.Semaphore; @Component diff --git a/src/main/java/org/cloud/sonic/agent/websockets/AndroidScreenWSServer.java b/src/main/java/org/cloud/sonic/agent/websockets/AndroidScreenWSServer.java index 896ee6fe..4b135f22 100755 --- a/src/main/java/org/cloud/sonic/agent/websockets/AndroidScreenWSServer.java +++ b/src/main/java/org/cloud/sonic/agent/websockets/AndroidScreenWSServer.java @@ -20,6 +20,9 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.android.ddmlib.IDevice; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import lombok.extern.slf4j.Slf4j; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.common.config.WsEndpointConfigure; @@ -35,9 +38,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import jakarta.websocket.*; -import jakarta.websocket.server.PathParam; -import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/org/cloud/sonic/agent/websockets/AudioWSServer.java b/src/main/java/org/cloud/sonic/agent/websockets/AudioWSServer.java index ba26bdae..7efba726 100755 --- a/src/main/java/org/cloud/sonic/agent/websockets/AudioWSServer.java +++ b/src/main/java/org/cloud/sonic/agent/websockets/AudioWSServer.java @@ -18,6 +18,12 @@ package org.cloud.sonic.agent.websockets; import com.android.ddmlib.IDevice; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import lombok.extern.slf4j.Slf4j; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.common.config.WsEndpointConfigure; @@ -28,12 +34,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import jakarta.websocket.OnClose; -import jakarta.websocket.OnError; -import jakarta.websocket.OnOpen; -import jakarta.websocket.Session; -import jakarta.websocket.server.PathParam; -import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; import java.io.InputStream; import java.net.Socket; diff --git a/src/main/java/org/cloud/sonic/agent/websockets/IAndroidWSServer.java b/src/main/java/org/cloud/sonic/agent/websockets/IAndroidWSServer.java index 116860be..0e8f7aed 100755 --- a/src/main/java/org/cloud/sonic/agent/websockets/IAndroidWSServer.java +++ b/src/main/java/org/cloud/sonic/agent/websockets/IAndroidWSServer.java @@ -18,10 +18,10 @@ package org.cloud.sonic.agent.websockets; import com.android.ddmlib.IDevice; +import jakarta.websocket.Session; import org.cloud.sonic.agent.tools.BytesTool; import org.springframework.util.ObjectUtils; -import jakarta.websocket.Session; import java.util.Collections; import java.util.HashSet; import java.util.Map; diff --git a/src/main/java/org/cloud/sonic/agent/websockets/IIOSWSServer.java b/src/main/java/org/cloud/sonic/agent/websockets/IIOSWSServer.java index c74ad6b8..b3437d68 100755 --- a/src/main/java/org/cloud/sonic/agent/websockets/IIOSWSServer.java +++ b/src/main/java/org/cloud/sonic/agent/websockets/IIOSWSServer.java @@ -17,9 +17,9 @@ */ package org.cloud.sonic.agent.websockets; +import jakarta.websocket.Session; import org.springframework.util.StringUtils; -import jakarta.websocket.Session; import java.util.Collections; import java.util.HashSet; import java.util.Map; diff --git a/src/main/java/org/cloud/sonic/agent/websockets/WebViewWSServer.java b/src/main/java/org/cloud/sonic/agent/websockets/WebViewWSServer.java index 3a042e0c..7d941e1a 100755 --- a/src/main/java/org/cloud/sonic/agent/websockets/WebViewWSServer.java +++ b/src/main/java/org/cloud/sonic/agent/websockets/WebViewWSServer.java @@ -17,6 +17,9 @@ */ package org.cloud.sonic.agent.websockets; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import org.cloud.sonic.agent.common.config.WsEndpointConfigure; import org.cloud.sonic.agent.tools.BytesTool; import org.java_websocket.client.WebSocketClient; @@ -26,9 +29,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import jakarta.websocket.*; -import jakarta.websocket.server.PathParam; -import jakarta.websocket.server.ServerEndpoint; import java.net.URI; import java.util.HashMap; import java.util.Map; diff --git a/src/test/java/org/cloud/sonic/agent/android/MockStepDebugTest.java b/src/test/java/org/cloud/sonic/agent/android/MockStepDebugTest.java index 14aa68e8..e2d657aa 100755 --- a/src/test/java/org/cloud/sonic/agent/android/MockStepDebugTest.java +++ b/src/test/java/org/cloud/sonic/agent/android/MockStepDebugTest.java @@ -4,10 +4,10 @@ import com.android.ddmlib.IDevice; import lombok.Getter; import lombok.Setter; -import org.cloud.sonic.agent.tests.handlers.AndroidStepHandler; import org.cloud.sonic.agent.bridge.android.AndroidDeviceBridgeTool; import org.cloud.sonic.agent.tests.android.AndroidRunStepThread; import org.cloud.sonic.agent.tests.android.AndroidTestTaskBootThread; +import org.cloud.sonic.agent.tests.handlers.AndroidStepHandler; import org.cloud.sonic.agent.tests.handlers.StepHandlers; import org.junit.Before; import org.junit.Ignore;