Compare commits
	
		
			No commits in common. "47b6c0d7288def3590043044dba0b101ef162cf1" and "0e785a67a5ebb39ef8ab2e31222368472cfce43c" have entirely different histories. 
		
	
	
		
			47b6c0d728
			...
			0e785a67a5
		
	
		| 
						 | 
					@ -138,10 +138,15 @@ public class AndroidAgentSession {
 | 
				
			||||||
     * 安静地关闭流
 | 
					     * 安静地关闭流
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public void closeSilence() {
 | 
					    public void closeSilence() {
 | 
				
			||||||
        if (null != this.sendThread) {
 | 
					        try {
 | 
				
			||||||
            this.sendThread.interrupt();
 | 
					            state = false;
 | 
				
			||||||
 | 
					            logger.debug("关闭设备【{}】的agentSession连接",serial);
 | 
				
			||||||
 | 
					            if (transport != null) {
 | 
				
			||||||
 | 
					                transport.close();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        } catch (IOException ignore) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        state = false;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private class CommandSendThread extends Thread {
 | 
					    private class CommandSendThread extends Thread {
 | 
				
			||||||
| 
						 | 
					@ -163,14 +168,7 @@ public class AndroidAgentSession {
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            try {
 | 
					            closeSilence();
 | 
				
			||||||
                logger.debug("关闭设备【{}】的agentSession连接",serial);
 | 
					 | 
				
			||||||
                if (transport != null) {
 | 
					 | 
				
			||||||
                    transport.close();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            } catch (IOException ignore) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@ package net.northking.cctp.upperComputer.service;
 | 
				
			||||||
import cn.hutool.core.codec.Base64;
 | 
					import cn.hutool.core.codec.Base64;
 | 
				
			||||||
import cn.hutool.core.img.ImgUtil;
 | 
					import cn.hutool.core.img.ImgUtil;
 | 
				
			||||||
import com.alibaba.fastjson.JSON;
 | 
					import com.alibaba.fastjson.JSON;
 | 
				
			||||||
import com.alibaba.fastjson.JSONObject;
 | 
					 | 
				
			||||||
import io.appium.java_client.AppiumDriver;
 | 
					import io.appium.java_client.AppiumDriver;
 | 
				
			||||||
import io.appium.java_client.android.AndroidDriver;
 | 
					import io.appium.java_client.android.AndroidDriver;
 | 
				
			||||||
import io.appium.java_client.ios.IOSDriver;
 | 
					import io.appium.java_client.ios.IOSDriver;
 | 
				
			||||||
| 
						 | 
					@ -865,20 +864,17 @@ public class AndroidDebuggerServiceImpl extends AbstractDebuggerService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public String endRecord(DebuggerDeviceInfo info) {
 | 
					    public String endRecord(DebuggerDeviceInfo info) {
 | 
				
			||||||
        String videoUrl = null;
 | 
					        String result = null;
 | 
				
			||||||
        logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
 | 
					        logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
 | 
				
			||||||
        AndroidScreenResponseThread screenThread = AndroidDeviceManager.getInstance().getScreenThread(info.getDeviceId());
 | 
					        AndroidScreenResponseThread screenThread = AndroidDeviceManager.getInstance().getScreenThread(info.getDeviceId());
 | 
				
			||||||
        if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
 | 
					        if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
 | 
				
			||||||
            String result = screenThread.stopRecord();
 | 
					            result = screenThread.stopRecord();
 | 
				
			||||||
            JSONObject jsonObject = JSON.parseObject(result, JSONObject.class);
 | 
					            return result;
 | 
				
			||||||
            videoUrl = jsonObject.getString("videoUrl");
 | 
					 | 
				
			||||||
            logger.info("设备【{}】在任务【{}】录屏关闭,得到的视频地址为:{}",info.getDeviceId(),info.getTaskId(),videoUrl);
 | 
					 | 
				
			||||||
            return videoUrl;
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
 | 
					            logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),videoUrl);
 | 
					        logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),result);
 | 
				
			||||||
        return videoUrl;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -248,20 +248,17 @@ public class IosDebuggerServiceImpl extends AbstractDebuggerService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public String endRecord(DebuggerDeviceInfo info) {
 | 
					    public String endRecord(DebuggerDeviceInfo info) {
 | 
				
			||||||
        String videoUrl = null;
 | 
					        String result = null;
 | 
				
			||||||
        logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
 | 
					        logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
 | 
				
			||||||
        IosScreenResponseThread screenThread = IOSDeviceManager.getInstance().getScreenThread(info.getDeviceId());
 | 
					        IosScreenResponseThread screenThread = IOSDeviceManager.getInstance().getScreenThread(info.getDeviceId());
 | 
				
			||||||
        if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
 | 
					        if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
 | 
				
			||||||
            String result = screenThread.stopRecord();
 | 
					            result = screenThread.stopRecord();
 | 
				
			||||||
            JSONObject jsonObject = JSON.parseObject(result, JSONObject.class);
 | 
					            return result;
 | 
				
			||||||
            videoUrl = jsonObject.getString("videoUrl");
 | 
					 | 
				
			||||||
            logger.info("设备【{}】在任务【{}】录屏关闭,得到的视频地址为:{}",info.getDeviceId(),info.getTaskId(),videoUrl);
 | 
					 | 
				
			||||||
            return videoUrl;
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
 | 
					            logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),videoUrl);
 | 
					        logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),result);
 | 
				
			||||||
        return videoUrl;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue