111
hxb
2022-11-24 08b203ac4cda87b13837f8e003e9caade9c9cc52
111
5个文件已修改
170 ■■■■ 已修改文件
AndroidOpenDemo/.idea/workspace.xml 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/CONST.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
AndroidOpenDemo/.idea/workspace.xml
@@ -16,11 +16,12 @@
  </component>
  <component name="ChangeListManager">
    <list default="true" id="7bacc5cf-316f-4ad4-b191-7f5297eb7bcf" name="Default Changelist" comment="">
      <change beforePath="$PROJECT_DIR$/.idea/modules/LCAndroidSDKDemo.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/LCAndroidSDKDemo.iml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/model/DeviceAddModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/model/DeviceAddModel.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/CONST.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/CONST.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/service/DeviceAddService.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/service/DeviceAddService.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/ScanPresenter.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/ScanPresenter.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -371,46 +372,54 @@
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state x="453" y="113" key="#com.intellij.ide.util.MemberChooser/0.0.1280.800@0.0.1280.800" timestamp="1669257253970" />
    <state width="1236" height="418" key="GridCell.Tab.0.bottom" timestamp="1669257607924">
    <state width="469" height="466" key="DebuggerActiveHint" timestamp="1669268288615">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="418" key="GridCell.Tab.0.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
    <state width="1236" height="164" key="GridCell.Tab.0.bottom/0.23.1280.777@0.23.1280.777" timestamp="1669257377595" />
    <state width="1236" height="418" key="GridCell.Tab.0.center" timestamp="1669257607924">
    <state width="469" height="466" key="DebuggerActiveHint/0.0.1280.800@0.0.1280.800" timestamp="1669268288615" />
    <state width="1236" height="164" key="GridCell.Tab.0.bottom" timestamp="1669268575109">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="418" key="GridCell.Tab.0.center/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
    <state width="1236" height="164" key="GridCell.Tab.0.center/0.23.1280.777@0.23.1280.777" timestamp="1669257377593" />
    <state width="1236" height="418" key="GridCell.Tab.0.left" timestamp="1669257607923">
    <state width="1236" height="164" key="GridCell.Tab.0.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669268575109" />
    <state width="1236" height="262" key="GridCell.Tab.0.bottom/0.23.1280.777@0.23.1280.777" timestamp="1669267473682" />
    <state width="1236" height="164" key="GridCell.Tab.0.center" timestamp="1669268575107">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="418" key="GridCell.Tab.0.left/0.0.1280.800@0.0.1280.800" timestamp="1669257607923" />
    <state width="1236" height="164" key="GridCell.Tab.0.left/0.23.1280.777@0.23.1280.777" timestamp="1669257377592" />
    <state width="1236" height="418" key="GridCell.Tab.0.right" timestamp="1669257607924">
    <state width="1236" height="164" key="GridCell.Tab.0.center/0.0.1280.800@0.0.1280.800" timestamp="1669268575107" />
    <state width="1236" height="262" key="GridCell.Tab.0.center/0.23.1280.777@0.23.1280.777" timestamp="1669267473681" />
    <state width="1236" height="164" key="GridCell.Tab.0.left" timestamp="1669268575106">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="418" key="GridCell.Tab.0.right/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
    <state width="1236" height="164" key="GridCell.Tab.0.right/0.23.1280.777@0.23.1280.777" timestamp="1669257377594" />
    <state width="1236" height="164" key="GridCell.Tab.1.bottom" timestamp="1669257522605">
    <state width="1236" height="164" key="GridCell.Tab.0.left/0.0.1280.800@0.0.1280.800" timestamp="1669268575106" />
    <state width="1236" height="262" key="GridCell.Tab.0.left/0.23.1280.777@0.23.1280.777" timestamp="1669267473680" />
    <state width="1236" height="164" key="GridCell.Tab.0.right" timestamp="1669268575108">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="164" key="GridCell.Tab.1.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669257522605" />
    <state width="1236" height="164" key="GridCell.Tab.1.center" timestamp="1669257522603">
    <state width="1236" height="164" key="GridCell.Tab.0.right/0.0.1280.800@0.0.1280.800" timestamp="1669268575108" />
    <state width="1236" height="262" key="GridCell.Tab.0.right/0.23.1280.777@0.23.1280.777" timestamp="1669267473682" />
    <state width="1236" height="164" key="GridCell.Tab.1.bottom" timestamp="1669268569960">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="164" key="GridCell.Tab.1.center/0.0.1280.800@0.0.1280.800" timestamp="1669257522603" />
    <state width="1236" height="164" key="GridCell.Tab.1.left" timestamp="1669257522602">
    <state width="1236" height="164" key="GridCell.Tab.1.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669268569960" />
    <state width="1236" height="164" key="GridCell.Tab.1.bottom/0.23.1280.777@0.23.1280.777" timestamp="1669268409973" />
    <state width="1236" height="164" key="GridCell.Tab.1.center" timestamp="1669268569958">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="164" key="GridCell.Tab.1.left/0.0.1280.800@0.0.1280.800" timestamp="1669257522602" />
    <state width="1236" height="164" key="GridCell.Tab.1.right" timestamp="1669257522604">
    <state width="1236" height="164" key="GridCell.Tab.1.center/0.0.1280.800@0.0.1280.800" timestamp="1669268569958" />
    <state width="1236" height="164" key="GridCell.Tab.1.center/0.23.1280.777@0.23.1280.777" timestamp="1669268409972" />
    <state width="1236" height="164" key="GridCell.Tab.1.left" timestamp="1669268569957">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state width="1236" height="164" key="GridCell.Tab.1.right/0.0.1280.800@0.0.1280.800" timestamp="1669257522604" />
    <state x="332" y="155" width="708" height="490" key="find.popup" timestamp="1669264064530">
    <state width="1236" height="164" key="GridCell.Tab.1.left/0.0.1280.800@0.0.1280.800" timestamp="1669268569957" />
    <state width="1236" height="164" key="GridCell.Tab.1.left/0.23.1280.777@0.23.1280.777" timestamp="1669268409972" />
    <state width="1236" height="164" key="GridCell.Tab.1.right" timestamp="1669268569959">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state x="332" y="155" width="708" height="490" key="find.popup/0.0.1280.800@0.0.1280.800" timestamp="1669264064530" />
    <state width="1236" height="164" key="GridCell.Tab.1.right/0.0.1280.800@0.0.1280.800" timestamp="1669268569959" />
    <state width="1236" height="164" key="GridCell.Tab.1.right/0.23.1280.777@0.23.1280.777" timestamp="1669268409973" />
    <state x="332" y="155" width="774" height="490" key="find.popup" timestamp="1669267701624">
      <screen x="0" y="0" width="1280" height="800" />
    </state>
    <state x="332" y="155" width="774" height="490" key="find.popup/0.0.1280.800@0.0.1280.800" timestamp="1669267701624" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
@@ -452,7 +461,7 @@
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java</url>
          <line>187</line>
          <line>194</line>
          <option name="timeStamp" value="84" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
@@ -470,6 +479,76 @@
          <line>410</line>
          <option name="timeStamp" value="98" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java</url>
          <line>59</line>
          <option name="timeStamp" value="118" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/model/DeviceAddModel.java</url>
          <line>162</line>
          <option name="timeStamp" value="119" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/CloudConnectPresenter.java</url>
          <line>96</line>
          <option name="timeStamp" value="121" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/DevLoginPresenter.java</url>
          <line>137</line>
          <option name="timeStamp" value="122" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/DevSecCodePresenter.java</url>
          <line>89</line>
          <option name="timeStamp" value="123" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/DevSecCodePresenter.java</url>
          <line>40</line>
          <option name="timeStamp" value="124" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/DevSecCodePresenter.java</url>
          <line>35</line>
          <option name="timeStamp" value="125" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/TypeChoosePresenter.java</url>
          <line>48</line>
          <option name="timeStamp" value="126" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/ScanPresenter.java</url>
          <line>98</line>
          <option name="timeStamp" value="127" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/ScanPresenter.java</url>
          <line>107</line>
          <option name="timeStamp" value="129" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/presenter/ScanPresenter.java</url>
          <line>114</line>
          <option name="timeStamp" value="130" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/model/DeviceAddModel.java</url>
          <line>346</line>
          <option name="timeStamp" value="131" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/service/DeviceAddService.java</url>
          <line>165</line>
          <option name="timeStamp" value="132" />
        </line-breakpoint>
        <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
          <url>file://$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java</url>
          <line>268</line>
          <option name="timeStamp" value="133" />
        </line-breakpoint>
      </breakpoints>
    </breakpoint-manager>
    <watches-manager>
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/CONST.java
@@ -34,6 +34,8 @@
    //添加子账户权限
    public static String ADD_POLICY = "addPolicy";
    public static String INDEPENDENT_REGISTER  ="independentRegister";
    // URL地址
    public static String HOST = "";
    // 如果不知道appid,请登录open.lechange.com,开发者服务模块中创建应用
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/DeviceAddOpenApiManager.java
@@ -106,13 +106,8 @@
     */
    public static BindDeviceData.Response userDeviceBind(BindDeviceData bindDeviceData) throws BusinessException {
        HashMap<String, Object> paramsMap = new HashMap<String, Object>();
//        paramsMap.put("token", bindDeviceData.data.token);
//        paramsMap.put("deviceId", bindDeviceData.data.deviceId);
        paramsMap.put("code", bindDeviceData.data.code);
        paramsMap.put("spk","security.ipcam.imou");
        paramsMap.put("extDevId",bindDeviceData.data.deviceId);
        paramsMap.put("token", bindDeviceData.data.token);
        paramsMap.put("deviceId", bindDeviceData.data.deviceId);
        JsonObject json = HttpSend.execute(paramsMap, CONST.METHOD_BINDDEVICE,DMS_TIME_OUT);
        BindDeviceData.Response response = new BindDeviceData.Response();
        response.parseData(json);
@@ -128,8 +123,9 @@
     */
    public static BindDeviceData.Response hdlUserDeviceBind(BindDeviceData bindDeviceData) throws BusinessException {
        HashMap<String, Object> paramsMap = new HashMap<String, Object>();
        paramsMap.put("deviceId", bindDeviceData.data.deviceId);
        paramsMap.put("extDevId", bindDeviceData.data.deviceId);
        paramsMap.put("spk","security.ipcam.imou");
        paramsMap.put("sid","8D00708PAGA01ED");
        paramsMap.put("code", bindDeviceData.data.code);
        JsonObject json = HttpSend.execute(paramsMap, CONST.METHOD_BINDDEVICE,DMS_TIME_OUT);
        BindDeviceData.Response response = new BindDeviceData.Response();
@@ -270,10 +266,10 @@
//        HttpSend.execute(jsonParam, CONST.ADD_POLICY,TIME_OUT);
//        return  true;
        final Map<String, Object> map = new Gson().fromJson(new Gson().toJson(req), new TypeToken<Map<String, String>>() {
        }.getType());
        JsonObject json = HttpSend.execute(map, CONST.CREATE_SUB_ACCOUNT, TIME_OUT);
//        final Map<String, Object> map = new Gson().fromJson(new Gson().toJson(req), new TypeToken<Map<String, Object>>() {
//        }.getType());
//
//        JsonObject json = HttpSend.execute(map, CONST.CREATE_SUB_ACCOUNT, TIME_OUT);
        return true;
    }
}
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java
@@ -35,9 +35,9 @@
        Map<String, Object> map = paramsInit(paramsMap);
        JsonObject jsonResult = null;
        if (CONST.isHdlServer()) {
            if(method.equals("bindDevice")){
            if (method.equals("bindDevice")) {
                jsonResult = doPost(CONST.HOST + "/home-wisdom/app/device/independentRegister", map, timeOut);
            }else {
            } else {
                jsonResult = doPost(CONST.HOST + "/home-wisdom/imou/openapi/" + method, map, timeOut);
            }
        } else {
@@ -56,16 +56,19 @@
            String msg = jsonResult.get("msg").getAsString();
            throw new BusinessException(code + msg);
        }
        JsonObject jsonData = new JsonObject();
        try {
            JsonObject jsonData = jsonResult.getAsJsonObject("data");
            jsonData = jsonResult.getAsJsonObject("data");
            if (jsonData == null) {
                jsonData = new JsonObject();
            }
            return jsonData;
        } catch (Throwable e) {
            BusinessException businessException = new BusinessException(e);
            throw businessException;
//            BusinessException businessException = new BusinessException(e);
//            throw businessException;
        }
        return jsonData;
    }
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java
@@ -71,7 +71,7 @@
        HdlToLcUtils.getInstance().initData(this, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "https://test-gz.hdlcontrol.com");
        HdlToLcUtils.getInstance().setHomeId("1547099040465408002");
        HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3MmI0OTEwYWRkYmE0ZjA3YjAxNzQxYmZhOGIzOTIyMSIsImNvbXBhbnlJZCI6IjIwMiIsInJvbGUiOiIiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidXNlckFjY291bnQiOiJ3eHIiLCJ0ZW5hbnRJZCI6IjIwIiwidXNlclR5cGUiOiJVU0VSX0IiLCJ0b2tlblR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJ1c2VyTmFtZSI6Ind4ciIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NjkyNTk5NTUsIm5iZiI6MTY2OTI1Mjc1NX0.T0Ni3_QGu25At2UNmsqB3lfo_ueRUZTmeRLbeVK4JpvqzwlwYykCnxXZ6pyWmTPEtAvsr68e8xSIMTKp1J8X61CXipHjRBBvgOkcwpuS-436RCQR3cg_uaCQ4Ac63C6N6G94FG6zukbSYRbgBaBQqKcOBbqEYD0hCa8BaXg6sCM");
        HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJjZmQ1NzM3NTk4YjA0YjQ3YTQyOTQ4YzczNTNkODk3MCIsImNvbXBhbnlJZCI6IjIwMiIsInJvbGUiOiIiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidXNlckFjY291bnQiOiJ3eHIiLCJ0ZW5hbnRJZCI6IjIwIiwidXNlclR5cGUiOiJVU0VSX0IiLCJ0b2tlblR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJ1c2VyTmFtZSI6Ind4ciIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NjkyNzI5MDAsIm5iZiI6MTY2OTI2NTcwMH0.LX4HmxmxuH80eNpBuDurp8POOGwX2hhqcLR4ULCCSnGhhYH61OaTYym4rn_CGM2J15EBVg0EpcJAfabePtQAS6pbeNv60jf-5s-V4zCPyqGKatduFbx1uG1Bw3TPiPCoTdhKkWb_pwRAfchhFMeibMrbS9W3JSs6eJ1mpZODOtM");
        HdlToLcUtils.getInstance().setSubAccessToken("St_00003ee84eda32b14126af958052f20a");
//        HdlToLcUtils.getInstance().openActivity();