Skip to content

Commit

Permalink
仓库迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Dec 11, 2021
1 parent 5a5695b commit 285fefe
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<p align="center">
<img src="https://raw.githubusercontent.com/ZhouYixun/sonic-server/main/logo.png">
<img src="https://raw.githubusercontent.com/SonicCloudOrg/sonic-server/main/logo.png">
</p>
<p align="center">🎉Agent of Sonic Cloud Real Machine Testing Platform</p>
<p align="center">
<span>English |</span>
<a href="https://github.com/ZhouYixun/sonic-agent/blob/main/README_CN.md">
<a href="https://github.com/SonicCloudOrg/sonic-agent/blob/main/README_CN.md">
简体中文
</a>
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.1.0-orange">
<img src="https://img.shields.io/badge/release-v1.2.0-orange">
</a>
<a href="#">
<img src="https://img.shields.io/badge/platform-windows|macosx|linux-success">
</a>
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/ZhouYixun/sonic-agent">
<img src="https://img.shields.io/github/commit-activity/m/SonicCloudOrg/sonic-agent">
</a>
<a href="#">
<img src="https://img.shields.io/github/downloads/ZhouYixun/sonic-agent/total">
<img src="https://img.shields.io/github/downloads/SonicCloudOrg/sonic-agent/total">
</a>
<a href="https://github.com/ZhouYixun/sonic-server/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/ZhouYiXun/sonic-server?color=green&label=license&logo=license&logoColor=green">
<a href="https://github.com/SonicCloudOrg/sonic-server/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/SonicCloudOrg/sonic-server?color=green&label=license&logo=license&logoColor=green">
</a>
</p>

### Official Website
[Sonic Official Website](http://zhouyixun.gitee.io/sonic-official-website)
[Sonic Official Website](http://sonic-cloud.gitee.io)
## Background

#### What is sonic ?
Expand Down Expand Up @@ -62,7 +62,7 @@ mvn package -Pwindows-x86_64

> Can only be used on Linux or Mac!
>
> [Click Here!](https://hub.docker.com/repository/docker/zhouyixun/sonic-agent-linux)
> [Click Here!](https://hub.docker.com/repository/docker/sonicorg)
### jar Mode

Expand Down
18 changes: 9 additions & 9 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<p align="center">
<img src="https://raw.githubusercontent.com/ZhouYixun/sonic-server/main/logo.png">
<img src="https://raw.githubusercontent.com/SonicCloudOrg/sonic-server/main/logo.png">
</p>
<p align="center">🎉Sonic云真机测试平台Agent端</p>
<p align="center">
<a href="https://github.com/ZhouYixun/sonic-agent/blob/main/README.md">
<a href="https://github.com/SonicCloudOrg/sonic-agent/blob/main/README.md">
English
</a>
<span>| 简体中文</span>
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.1.0-orange">
<img src="https://img.shields.io/badge/release-v1.2.0-orange">
</a>
<a href="#">
<img src="https://img.shields.io/badge/platform-windows|macosx|linux-success">
</a>
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/ZhouYixun/sonic-agent">
<img src="https://img.shields.io/github/commit-activity/m/SonicCloudOrg/sonic-agent">
</a>
<a href="#">
<img src="https://img.shields.io/github/downloads/ZhouYixun/sonic-agent/total">
<img src="https://img.shields.io/github/downloads/SonicCloudOrg/sonic-agent/total">
</a>
<a href="https://github.com/ZhouYixun/sonic-server/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/ZhouYiXun/sonic-server?color=green&label=license&logo=license&logoColor=green">
<a href="https://github.com/SonicCloudOrg/sonic-server/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/SonicCloudOrg/sonic-server?color=green&label=license&logo=license&logoColor=green">
</a>
</p>

### 官方网站
[Sonic Official Website](http://zhouyixun.gitee.io/sonic-official-website)
[Sonic Official Website](http://sonic-cloud.gitee.io)
## 背景

#### 什么是Sonic?
Expand Down Expand Up @@ -62,7 +62,7 @@ mvn package -Pwindows-x86_64

> 仅Linux和Mac可用!
>
> [点击这里!](https://hub.docker.com/repository/docker/zhouyixun/sonic-agent-linux)
> [点击这里!](https://hub.docker.com/repository/docker/sonicorg)
### jar模式

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ private void exit(Session session) {
try {
HandlerMap.getAndroidMap().get(session.getId()).closeAndroidDriver();
} catch (Exception e) {
e.printStackTrace();
logger.info("关闭driver异常!");
} finally {
HandlerMap.getAndroidMap().remove(session.getId());
}
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/com/sonic/agent/websockets/IOSWSServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,25 @@
import java.util.concurrent.atomic.AtomicReference;

@Component
@ServerEndpoint(value = "/websockets/ios/{key}/{udId}", configurator = MyEndpointConfigure.class)
@ServerEndpoint(value = "/websockets/ios/{key}/{udId}/{token}", configurator = MyEndpointConfigure.class)
public class IOSWSServer {
private final Logger logger = LoggerFactory.getLogger(IOSWSServer.class);
private Map<Session, String> udIdMap = new ConcurrentHashMap<>();
@Value("${sonic.agent.key}")
private String key;

@OnOpen
public void onOpen(Session session, @PathParam("key") String secretKey, @PathParam("udId") String udId) throws Exception {
if (secretKey.length() == 0 || (!secretKey.equals(key))) {
public void onOpen(Session session, @PathParam("key") String secretKey,
@PathParam("udId") String udId, @PathParam("token") String token) throws Exception {
if (secretKey.length() == 0 || (!secretKey.equals(key)) || token.length() == 0) {
logger.info("拦截访问!");
return;
}
JSONObject jsonDebug = new JSONObject();
jsonDebug.put("msg", "debugUser");
jsonDebug.put("token", token);
jsonDebug.put("udId", udId);
NettyThreadPool.send(jsonDebug);
WebSocketSessionMap.getMap().put(session.getId(), session);
if (!TIDeviceTool.getDeviceList().contains(udId)) {
logger.info("设备未连接,请检查!");
Expand Down Expand Up @@ -254,7 +260,7 @@ private void exit(Session session) {
try {
HandlerMap.getIOSMap().get(session.getId()).closeIOSDriver();
} catch (Exception e) {
e.printStackTrace();
logger.info("关闭driver异常!");
} finally {
HandlerMap.getIOSMap().remove(session.getId());
}
Expand Down

0 comments on commit 285fefe

Please sign in to comment.