Skip to content

Commit

Permalink
doc: rm some config
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Jun 5, 2023
1 parent 584fb54 commit dee777c
Show file tree
Hide file tree
Showing 36 changed files with 40 additions and 88 deletions.
13 changes: 2 additions & 11 deletions config/application-sonic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
wda-bundle-id: com.sonic.WebDriverAgentRunner
13 changes: 2 additions & 11 deletions src/main/docker/config/application-sonic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
wda-bundle-id: ${WDA_BUNDLE_ID:com.facebook.WebDriverAgentRunner.xctrunner}
8 changes: 0 additions & 8 deletions src/main/docker/docker-compose-zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -61,7 +60,6 @@
* @des ADB工具类
* @date 2021/08/16 19:26
*/
@ConditionalOnProperty(value = "modules.android.enable", havingValue = "true")
@DependsOn({"androidThreadPoolInit"})
@Component
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<ContextRefreshedEvent> {
private static File sasBinary = new File("plugins" + File.separator + "sonic-android-supply");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cloud.sonic.agent.common.maps;

import jakarta.websocket.Session;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cloud/sonic/agent/tests/IOSTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cloud/sonic/agent/tests/LogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
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;
import org.cloud.sonic.agent.transport.TransportWorker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jakarta.websocket.Session;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/cloud/sonic/agent/tests/RunStepThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 上午
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
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;
import org.cloud.sonic.agent.tools.PortTool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jakarta.websocket.Session;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading

0 comments on commit dee777c

Please sign in to comment.