Skip to content

Commit

Permalink
Merge pull request #249 from SonicCloudOrg/1.5.0-rc
Browse files Browse the repository at this point in the history
1.5.0 rc
  • Loading branch information
ZhouYixun authored Aug 28, 2022
2 parents 28652a7 + 6dfe68d commit fddad09
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: deploy to Dockerhub

on:
workflow_dispatch:
release:
types: [published]

jobs:

Expand All @@ -21,6 +22,8 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: replace version
run: ver=${{ steps.previoustag.outputs.tag }} && new_ver=${ver:1} && sed -i "s/SONIC_VERSION/${new_ver}/g" pom.xml
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u zhouyixun --password-stdin
- name: sgm-download
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: maven-compile-test

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Validate and Compile with Maven
run: mvn validate compile
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: release to github

on:
workflow_dispatch:
release:
types: [published]

jobs:

Expand All @@ -21,6 +22,8 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: replace version
run: ver=${{ steps.previoustag.outputs.tag }} && new_ver=${ver:1} && sed -i "s/SONIC_VERSION/${new_ver}/g" pom.xml && sed -i "s/SONIC_VERSION/${{ steps.previoustag.outputs.tag }}/g" src/main/docker/docker-compose*.yml
- name: mkdir
run: mkdir -p sonic-agent-${{ steps.previoustag.outputs.tag }}-linux_x86/plugins sonic-agent-${{ steps.previoustag.outputs.tag }}-linux_x86_64/plugins sonic-agent-${{ steps.previoustag.outputs.tag }}-macosx_x86_64/plugins sonic-agent-${{ steps.previoustag.outputs.tag }}-windows_x86/plugins sonic-agent-${{ steps.previoustag.outputs.tag }}-windows_x86_64/plugins
- name: package-linux86
Expand Down
2 changes: 1 addition & 1 deletion config/application-sonic-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ modules:
enable: true
webview:
# 是否开启在线webView调试功能
enable: false
enable: true
# 谷歌调试端口,一般不需要修改(默认0使用随机端口,如果需要开启防火墙给外部使用,请设置固定端口如7778)
chrome-driver-debug-port: 0
# 替换为Agent机器上的chrome浏览器的driver路径,可以去http://npm.taobao.org/mirrors/chromedriver/下载
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.cloud.sonic</groupId>
<artifactId>sonic-agent</artifactId>
<version>1.5.0-beta</version>
<version>SONIC_VERSION</version>
<packaging>jar</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-agent:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:v1.5.0-beta"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:SONIC_VERSION"
environment:
# 对应server的env配置,注意防火墙关闭对应端口
- SONIC_SERVER_HOST=192.168.1.1
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/docker-compose2.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-agent:
image: "sonicorg/sonic-agent-linux:v1.5.0-beta"
image: "sonicorg/sonic-agent-linux:SONIC_VERSION"
environment:
# 对应server的env配置,注意防火墙关闭对应端口
- SONIC_SERVER_HOST=192.168.1.1
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.AndroidDebugBridge;
import com.android.ddmlib.IDevice;
import org.cloud.sonic.agent.common.interfaces.IsHMStatus;
import org.cloud.sonic.agent.common.interfaces.PlatformType;
import org.cloud.sonic.agent.common.maps.AndroidDeviceManagerMap;
import org.cloud.sonic.agent.common.maps.DevicesBatteryMap;
Expand Down Expand Up @@ -50,12 +51,13 @@ private void send(IDevice device) {
deviceDetail.put("name", device.getProperty("ro.product.name"));
deviceDetail.put("model", device.getProperty(IDevice.PROP_DEVICE_MODEL));
deviceDetail.put("status", device.getState() == null ? null : device.getState().toString());
if(device.getProperty("hw_sc.build.os.enable") != null){
deviceDetail.put("platform", PlatformType.ANDROID);
if (device.getProperty("ro.config.ringtone") != null && device.getProperty("ro.config.ringtone").contains("Harmony")) {
deviceDetail.put("version", device.getProperty("hw_sc.build.platform.version"));
deviceDetail.put("platform", PlatformType.HARMONYOS);
}else{
deviceDetail.put("isHm", IsHMStatus.IS_HM);
} else {
deviceDetail.put("version", device.getProperty(IDevice.PROP_BUILD_VERSION));
deviceDetail.put("platform", PlatformType.ANDROID);
deviceDetail.put("isHm", IsHMStatus.IS_ANDROID);
}

deviceDetail.put("size", AndroidDeviceBridgeTool.getScreenSize(device));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.cloud.sonic.agent.common.interfaces;

/**
* @author maomeng
* @des 鸿蒙系统标识
* @date 2022/8/23 12:22
*/
public interface IsHMStatus {
int IS_ANDROID = 0;
int IS_HM = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
public interface PlatformType {
int ANDROID = 1;
int IOS = 2;
// HarmonyOs
int HARMONYOS = 6;
int WINDOWS = 3;
int MAC = 4;
int WEB = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ public void onClose(int i, String s, boolean b) {
if (TransportWorker.isKeyAuth) {
log.info("Server disconnected. Retry in 10s...");
}
TransportWorker.client = null;
if(TransportWorker.client == this) {
TransportWorker.client = null;
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spring:

sonic:
saa: 2.0.1
sgm: 0.1.9
sgm: 1.3.1
sib: 1.1.8

logging:
Expand Down

0 comments on commit fddad09

Please sign in to comment.