|
@@ -103,6 +103,8 @@ import java.util.GregorianCalendar;
|
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Queue;
|
|
import java.util.Queue;
|
|
|
|
|
+import java.util.Timer;
|
|
|
|
|
+import java.util.TimerTask;
|
|
|
|
|
|
|
|
import javax.net.ssl.SSLServerSocket;
|
|
import javax.net.ssl.SSLServerSocket;
|
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
@@ -3766,6 +3768,10 @@ public class iMapServer extends Service {
|
|
|
|| Version.getModelType() == MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|| Version.getModelType() == MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
retXML = iCMDProcEntireLightControl(doc); // 전체 조명 제어
|
|
retXML = iCMDProcEntireLightControl(doc); // 전체 조명 제어
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ //jglee - 2024.11.13 원격 adb 로깅
|
|
|
|
|
+ else if( cmd.equalsIgnoreCase("remote_debug_connect")) {
|
|
|
|
|
+ retXML = imapRemoteDebugConnect(doc);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -3833,6 +3839,161 @@ public class iMapServer extends Service {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /** ADB 원격 디버깅 */
|
|
|
|
|
+ public String imapRemoteDebugConnect(Document doc) {
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] START -----------");
|
|
|
|
|
+ String resultstr = XMLHeader + "<service type=\"reply\" name=\"" + "remote_debug_connect" + "\" result=";
|
|
|
|
|
+ String action = "", id = "", pw = "", duration = "", port = "", message = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ // action
|
|
|
|
|
+ NodeList items = doc.getElementsByTagName("action");
|
|
|
|
|
+ Node item = items.item(0);
|
|
|
|
|
+ if (item == null) return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+
|
|
|
|
|
+ Element element = (Element) items.item(0);
|
|
|
|
|
+ action = element.getTextContent().replace("\"", "").trim();
|
|
|
|
|
+
|
|
|
|
|
+ items = doc.getElementsByTagName("account");
|
|
|
|
|
+ element = (Element) items.item(0);
|
|
|
|
|
+ NamedNodeMap mAttrs = element.getAttributes();
|
|
|
|
|
+ int nAttrCnt = mAttrs.getLength();
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] nAttrCnt [" + nAttrCnt + "]");
|
|
|
|
|
+ for (int i = 0; i < nAttrCnt; i++) {
|
|
|
|
|
+ Node mAttr = mAttrs.item(i);
|
|
|
|
|
+ if (i == 0) {
|
|
|
|
|
+ if (!mAttr.getNodeName().equalsIgnoreCase("id"))
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ id = mAttr.getNodeValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (i == 1) {
|
|
|
|
|
+ if (!mAttr.getNodeName().equalsIgnoreCase("pw"))
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ pw = mAttr.getNodeValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ items = doc.getElementsByTagName("option");
|
|
|
|
|
+ element = (Element) items.item(0);
|
|
|
|
|
+ mAttrs = element.getAttributes();
|
|
|
|
|
+ nAttrCnt = mAttrs.getLength();
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] nAttrCnt [" + nAttrCnt + "]");
|
|
|
|
|
+ for (int i = 0; i < nAttrCnt; i++) {
|
|
|
|
|
+ Node mAttr = mAttrs.item(i);
|
|
|
|
|
+ if (i == 0) {
|
|
|
|
|
+ if (!mAttr.getNodeName().equalsIgnoreCase("duration"))
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ duration = mAttr.getNodeValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (i == 1) {
|
|
|
|
|
+ if (!mAttr.getNodeName().equalsIgnoreCase("port"))
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ port = mAttr.getNodeValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ items = doc.getElementsByTagName("message");
|
|
|
|
|
+ element = (Element) items.item(0);
|
|
|
|
|
+ message = element.getTextContent().replace("\"", "").trim();
|
|
|
|
|
+
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] action [" + action + "]");
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] id [" + id + "], pw [" + pw + "], duration [" + duration + "], port [" + port + "]");
|
|
|
|
|
+ Log.d(TAG, "[imapRemoteDebugConnect] message [" + message + "]");
|
|
|
|
|
+
|
|
|
|
|
+ if (!checkRemoteDebugAccount(id, pw)) return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+
|
|
|
|
|
+ if (action.equalsIgnoreCase("enable")) {
|
|
|
|
|
+ ctrlRemoteDebugConnect(true, port, Integer.parseInt(duration));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (action.equalsIgnoreCase("disable")) {
|
|
|
|
|
+ ctrlRemoteDebugConnect(false, port, Integer.parseInt(duration));
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ }
|
|
|
|
|
+ return resultstr += "\"ok\"/> \r\n </imap>";
|
|
|
|
|
+ } catch (RuntimeException re) {
|
|
|
|
|
+ Log.e(TAG, "[imapRemoteDebugConnect] RuntimeException");
|
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ Log.e(TAG, "[imapRemoteDebugConnect] Exception");
|
|
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
|
|
+ }
|
|
|
|
|
+ return resultstr += "\"fail\"/> \r\n </imap>";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public void ctrlRemoteDebugConnect(boolean enable, String port, int mins) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Log.d(TAG, "[ctrlRemoteDebugConnect] enable [" + enable + "], port [" + port + "], mins [" + mins + "]");
|
|
|
|
|
+ if (enable) {
|
|
|
|
|
+ if (0 >= nRemoteDebugCntDN) {
|
|
|
|
|
+ RemoteDebugTimer = new Timer();
|
|
|
|
|
+ RemoteDebugTimer.schedule(new RemoteDebugCntDN(), 1000, 60000);
|
|
|
|
|
+ if (mIOInterface.checkADBRemoteConnect() == -1) {
|
|
|
|
|
+ // 미사용중
|
|
|
|
|
+ mIOInterface.enableADBRemoteConnect(port);
|
|
|
|
|
+ }
|
|
|
|
|
+ nRemoteDebugCntDN = mins;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mIOInterface.disableADBRemoteConnect();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ Log.e(TAG, "[Exception] ctrlRemoteDebugConnect()");
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int nRemoteDebugCntDN = 0;
|
|
|
|
|
+ Timer RemoteDebugTimer = null;
|
|
|
|
|
+ public class RemoteDebugCntDN extends TimerTask {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ nRemoteDebugCntDN--;
|
|
|
|
|
+ Log.d(TAG, "[RemoteDebugCntDN] nRemoteDebugCntDN [" + nRemoteDebugCntDN + "]");
|
|
|
|
|
+ if (0 >= nRemoteDebugCntDN) {
|
|
|
|
|
+ RemoteDebugTimer.cancel();
|
|
|
|
|
+ RemoteDebugTimer = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ Log.e(TAG, "[Exception] RemoteDebugCntDN().run() : " + e);
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** ADB 원격 디버깅 계정 정보 확인 */
|
|
|
|
|
+ public boolean checkRemoteDebugAccount(String id, String pw) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (id.equals("icontrols")) {
|
|
|
|
|
+ if (pw.equals("hdc1208193646#$")) {
|
|
|
|
|
+ Log.i(TAG, "[checkRemoteDebugAccount] Account correct!!");
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ Log.w(TAG, "[checkRemoteDebugAccount] PW incorrect!!");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ Log.w(TAG, "[checkRemoteDebugAccount] ID incorrect!!");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ Log.e(TAG, "[Exception] checkRemoteDebugAccount(String id, String pw)");
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public class iMapSverSocketThread_Mix extends Thread {
|
|
public class iMapSverSocketThread_Mix extends Thread {
|
|
|
private final Socket iMAPSock;
|
|
private final Socket iMAPSock;
|
|
|
String strRcvMSG;
|
|
String strRcvMSG;
|
|
@@ -5032,8 +5193,8 @@ public class iMapServer extends Service {
|
|
|
|
|
|
|
|
if (devname.equalsIgnoreCase(DetailInfo[2])) {
|
|
if (devname.equalsIgnoreCase(DetailInfo[2])) {
|
|
|
if (DetailInfo[3].equalsIgnoreCase(define.DEVICE_ENABLE)) {
|
|
if (DetailInfo[3].equalsIgnoreCase(define.DEVICE_ENABLE)) {
|
|
|
- ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_ON);
|
|
|
|
|
- ctrlSmartIOTCamLEDMode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
|
|
|
|
+ ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
|
|
+ ctrlSmartIOTCamLEDMode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
@@ -15290,8 +15451,8 @@ public class iMapServer extends Service {
|
|
|
|
|
|
|
|
if (getStrangerRecordingManagerSetting() && getStrangerRecordingUserSetting()) {
|
|
if (getStrangerRecordingManagerSetting() && getStrangerRecordingUserSetting()) {
|
|
|
// 설정값을 확인하여 스마트 IoT 현관카메라의 상태를 전송한다. (거동수상자 녹화를 위한 자동 On 기능 활성화)
|
|
// 설정값을 확인하여 스마트 IoT 현관카메라의 상태를 전송한다. (거동수상자 녹화를 위한 자동 On 기능 활성화)
|
|
|
- ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_ON);
|
|
|
|
|
- ctrlSmartIOTCamLEDMode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
|
|
|
|
+ ctrlSmartIOTCamStatusMode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
|
|
+ ctrlSmartIOTCamLEDMode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
// 설정값을 확인하여 스마트 IoT 현관카메라의 상태를 전송한다. (거동수상자 녹화를 위한 자동 On 기능 비활성화)
|
|
// 설정값을 확인하여 스마트 IoT 현관카메라의 상태를 전송한다. (거동수상자 녹화를 위한 자동 On 기능 비활성화)
|