wei
2021-09-23 a3b92962f31cb3bbebaba37475b3a8417831520f
合并嘉乐本地加密代码
4个文件已添加
20个文件已修改
587 ■■■■ 已修改文件
DLL/Shared.Droid.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Shared.IOS.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Shared.IOS.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/Constant.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 108 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_TcpServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewApiRes.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Device/DeviceModule.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs 231 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Shared.Droid.xml
@@ -1311,6 +1311,11 @@
            点击弹起事件
            </summary>
        </member>
        <member name="F:Shared.View.MouseUpOutsideEventHandler">
            <summary>
            点击弹起事件 UpOutside
            </summary>
        </member>
        <member name="F:Shared.View.MouseLongEventHandler">
            <summary>
            长按点击事件
@@ -4323,6 +4328,12 @@
            加载本地HTML
            </summary>
        </member>
        <member name="M:Shared.WebView.LoadHTMLString(System.String)">
            <summary>
            加载Html标签的富文本
            </summary>
            <param name="htmlStr"></param>
        </member>
        <member name="T:Shared.WebView.MyWebViewClient">
            <summary>
            MyWebViewClient
DLL/Shared.IOS.dll
Binary files differ
DLL/Shared.IOS.xml
@@ -1720,6 +1720,12 @@
            加载本地HTML
            </summary>
        </member>
        <member name="M:Shared.WebView.LoadHTMLString(System.String)">
            <summary>
            加载Html标签的富文本
            </summary>
            <param name="htmlStr"></param>
        </member>
        <member name="T:Shared.WebView.OnWKNavigationDelegate">
            <summary>
            OnWKNavigationDelegate
HDL-ON_Android/Assets/Language.ini
@@ -1082,6 +1082,7 @@
9066=Remarks
9067=Remarks cannot be blank.
9068=Do you want to unbind?
9069=Property notice
    
10000=Invalid password, please log in again.
10001=Fail to request server, please try again later.
@@ -2181,6 +2182,7 @@
9066=备注
9067=备注不能为空
9068=是否解除绑定?
9069=物业通知
 
10000=无效登录密钥,请重新登录!
10001=请求服务器失败,请稍后再试!
HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png
HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -499,6 +499,8 @@
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\security.png" />
    <AndroidAsset Include="Assets\Phone\Public\HookIcon.png" />
    <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Property.png" />
    <AndroidAsset Include="Assets\Phone\Collection\MesCenter\PropertyOn.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" />
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1351,6 +1351,8 @@
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\security.png" />
      <BundleResource Include="Resources\Phone\Public\HookIcon.png" />
      <BundleResource Include="Resources\Phone\Collection\MesCenter\Property.png" />
      <BundleResource Include="Resources\Phone\Collection\MesCenter\PropertyOn.png" />
    </ItemGroup>
    <ItemGroup>
      <ITunesArtwork Include="iTunesArtwork" />
HDL-ON_iOS/Resources/Language.ini
@@ -1082,6 +1082,7 @@
9066=Remarks
9067=Remarks cannot be blank.
9068=Do you want to unbind?
9069=Property notice
    
10000=Invalid password, please log in again.
10001=Fail to request server, please try again later.
@@ -2181,6 +2182,7 @@
9066=备注
9067=备注不能为空
9068=是否解除绑定?
9069=物业通知
 
10000=无效登录密钥,请重新登录!
10001=请求服务器失败,请稍后再试!
HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png
HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png
HDL_ON/Common/Constant.cs
@@ -244,7 +244,11 @@
        /// <summary>
        /// 物业通知,待确认修改
        /// </summary>
        Property,
        IMOU_VISAAL,
        /// <summary>
        /// 物业通知
        /// </summary>
        Notice,
    }
    /// <summary>
HDL_ON/Common/R.cs
@@ -2892,7 +2892,10 @@
        /// 是否解除绑定?
        /// </summary>
        public const int DoYouWantToUnbind = 9068;
        /// <summary>
        /// 物业通知
        /// </summary>
        public const int Propertynotice = 9069;
        #region 网络请求响应错误提示信息
HDL_ON/DAL/DriverLayer/Control.cs
@@ -63,7 +63,19 @@
        /// 是否搜索本地网关成功
        /// </summary>
        public bool IsSearchLocalGatewaySuccessful = false;
        /// <summary>
        /// 是否本地加密,目前只对A网关有用
        /// </summary>
        public bool IsLocalEncrypt;
        /// <summary>
        /// 判断是否本地加密并且加密key不为空
        /// </summary>
        public bool IsLocalEncryptAndGetAesKey {
            get {
                return IsLocalEncrypt && (!string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.localSecret));
            }
        }
        bool _GatewayOnline_Local = false;
        /// <summary>
        /// 网关在线-局域网
@@ -689,15 +701,45 @@
        /// <summary>
        /// 转换发送数据
        /// </summary>
        public byte[] ConvertSendBodyData(string topic, string bodyDataString)
        /// <param name="topic">主题</param>
        /// <param name="bodyDataString">body内容数据</param>
        /// <param name="isEncryption">是否要对body加密</param>
        /// <returns></returns>
        public byte[] ConvertSendBodyData(string topic, string bodyDataString, bool isEncryption = true)
        {
            string topicString = "Topic:" + topic + "\r\n";
            byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString);
            string lengthString = "Length:" + bodyBytes.Length.ToString() + "\r\n" + "\r\n";
            //string topicString = "Topic:" + topic + "\r\n";
            //byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString);
            //string lengthString = "Length:" + bodyBytes.Length.ToString() + "\r\n" + "\r\n";
            string sendDataString = topicString + lengthString + bodyDataString;
            byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString);
            MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n");
            //string sendDataString = topicString + lengthString + bodyDataString;
            //byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString);
            //MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n");
            //***************************************************************
            //2021-09-23 增加本地通信加密处理
            //1.拼接头
            string topicString = "Topic:" + topic + "\r\n";
            //2.Body字符串转为byte数组
            byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString);
            //判断是否需加密Body数据
            if (isEncryption && IsLocalEncryptAndGetAesKey)
            {
                bodyBytes = Securitys.EncryptionService.AesEncryptPayload(bodyBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret);
                //bodyDataString = Encoding.UTF8.GetString(bodyBytes);
                //MainPage.Log($"转换HDL-Link数据 加密key:" + DB_ResidenceData.Instance.CurrentRegion.localSecret);
            }
            //3.拼接body的Length长度数据
            string lengthString = "Length:" + bodyBytes.Length.ToString() + "\r\n" + "\r\n";
            string topicAndLengthString = topicString + lengthString;
            byte[] topicAndLengthBytes = Encoding.ASCII.GetBytes(topicAndLengthString);
            //4.拼接合并 Topic 和 body的byte数组数据
            byte[] sendDataBytes = new byte[topicAndLengthBytes.Length + bodyBytes.Length];
            topicAndLengthBytes.CopyTo(sendDataBytes, 0);
            bodyBytes.CopyTo(sendDataBytes, topicAndLengthBytes.Length);
            //var sendDataString = Encoding.UTF8.GetString(sendDataBytes);
            //MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n");
            //***************************************************************
            return sendDataBytes;
        }
@@ -708,15 +750,19 @@
        public void ConvertReceiveData(byte[] receiveBytes)
        {
            var reString = Encoding.UTF8.GetString(receiveBytes);
            AnalysisReceiveData(reString);
            AnalysisReceiveData(reString, receiveBytes);
        }
        /// <summary>
        /// 转换接收到的数据
        /// </summary>
        /// <param name="receiveString">转String后的数据</param>
        /// <param name="originalReceiveBytes"原始Bytes数据</param>
        /// <returns></returns>
        public LocalCommunicationData AnalysisReceiveData(string receiveString)
        public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes)
        {
            LocalCommunicationData receiveObj = new LocalCommunicationData();
            MainPage.Log($"局域网信息: \r\n{receiveString}");
            var res = receiveString.Split("\r\n\r\n");
@@ -738,8 +784,7 @@
                    }
                }
                MainPage.Log($"局域网信息: {receiveObj.Topic}  : 内容: {res[1]}");
                //MainPage.Log($"局域网信息: {receiveObj.Topic}  : 内容: {res[1]}");
                //验证有效数据长度
                //if (res[1].Length != receiveObj.Length)
@@ -748,6 +793,40 @@
                //    return receiveObj;
                //}
                receiveObj.BodyDataString = res[1];
                //2021-09-23 过滤不需要解密的主题 目前搜索网关主题不加密
                if (receiveObj.Topic != CommunicationTopic.SearchLoaclGatewayReply)
                {
                    //判断当前网关是否开启了本地加密
                    if (IsLocalEncryptAndGetAesKey)
                    {
                        MainPage.Log($"局域网信息 开始解密");
                        if (originalReceiveBytes != null)
                        {
                            //拿到原始Bytes数据去解密
                            byte[] topicBytes = Encoding.UTF8.GetBytes(res[0]);
                            byte[] bodyBytes = new byte[receiveObj.Length];
                            Array.Copy(originalReceiveBytes, topicBytes.Length + 4, bodyBytes, 0, receiveObj.Length);
                            byte[] receiveBytes = Securitys.EncryptionService.AesDecryptPayload(bodyBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret);
                            var revString = Encoding.UTF8.GetString(receiveBytes);
                            receiveObj.BodyDataString = revString;
                            MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString);
                        }
                        else
                        {
                            //目前不拿原始Bytes数据 解密不了
                            //byte[] receiveBytes = Encoding.UTF8.GetBytes(res[1]);
                            //MainPage.Log($"局域网信息 receiveBytes {receiveBytes.Length}");
                            //receiveBytes = Securitys.EncryptionService.AesDecryptPayload(receiveBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret);
                            //MainPage.Log($"局域网信息 解密后:receiveBytes {receiveBytes.Length}");
                            //var revString = Encoding.UTF8.GetString(receiveBytes);
                            //receiveObj.BodyDataString = revString;
                            //MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString);
                        }
                    }
                }
                if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply || receiveObj.Topic == CommunicationTopic.GatewayBroadcast)
                {
@@ -772,7 +851,10 @@
                        {
                            Ins.GatewayId = device.device_mac;
                        }
                        reportIp = device.ip_address;//主播地址也能控制设备//"239.0.168.188";//
                        reportIp = device.ip_address;//主播地址也能控制设备//"239.0.168.188";//
                        //2021-09-23 新增获取当前网关是否本地加密
                        Ins.IsLocalEncrypt = device.isLocalEncrypt;
                        //MainPage.Log("网关本地加密状态:" + device.local_encrypt.ToString());
                    }
                }
                else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" ||
HDL_ON/DAL/DriverLayer/Control_TcpServer.cs
@@ -182,7 +182,7 @@
        void AnalysisTcpData(Socket socket, string tcpBodyDataString)
        {
            MainPage.Log($"0001 tcpDataString:\r\n {tcpBodyDataString}");
            var tcpDataObj = Control.Ins.AnalysisReceiveData(tcpBodyDataString);
            var tcpDataObj = Control.Ins.AnalysisReceiveData(tcpBodyDataString, null);
            if (tcpDataObj.BodyDataString == null)
            {
                return;
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -1128,7 +1128,7 @@
                var sendJob = new JObject { { "id", Control.Ins.msg_id.ToString() }, { "time_stamp", Utlis.GetTimestamp ()} };
                var bodyString = JsonConvert.SerializeObject(sendJob);
                
                var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.SearchLoaclGateway, bodyString);
                var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.SearchLoaclGateway, bodyString, false);
                //组播发送
                packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("239.0.168.188"), 8585));
                packet.HaveSendCount = 4;
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -1004,7 +1004,15 @@
                    deviceName = OnAppConfig.Instance.PhoneName,
                    deviceType = deviceType,
                    produce = isProduce,
                };
                mAddpushinfoObj.languageType = Utlis.GetPostLanguageType();
#if DEBUG
                //List<string> communityCodes = new List<string>();
                //communityCodes.Add("");
                //mAddpushinfoObj.communityCodes = communityCodes;
#endif
                //var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj);
                var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj);
@@ -1061,7 +1069,7 @@
            }
            else if (queryType == 4)
            {
                pushType = PushType.Property.ToString();
                pushType = PushType.Notice.ToString();
            }
            var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj()
            {
@@ -1198,16 +1206,13 @@
        /// </summary>
        /// <param name="msgId"></param>
        /// <returns></returns>
        public bool PushSerivceDeleteMessage(string msgId)
        public bool PushSerivceDeleteMessage(PushMsgIdObj mPushMsgIdObj)
        {
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            if (mPushMsgIdObj == null) return false;
            try
            {
                var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj()
                {
                    msgId = msgId
                });
                var requestJson = HttpUtil.GetSignRequestJson(mPushMsgIdObj);
                var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Deletepushinfo, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
@@ -1266,6 +1271,18 @@
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 获取物业公告详情
        /// </summary>
        /// <param name="noticeId"></param>
        /// <returns></returns>
        public ResponsePackNew GetPropertyNoticeDetails(string noticeId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("noticeId", noticeId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_GetNoticeInfo, requestJson);
        }
        #endregion
        #region 检测更新
@@ -1286,9 +1303,9 @@
        #endregion
#endregion
        #region 获取天气部分
#region 获取天气部分
        /// <summary>
        /// 获取指定经纬度的城市信息
        /// </summary>
@@ -1356,10 +1373,10 @@
            });
        }
        #endregion
#endregion
        #region 备份部分
#region 备份部分
        ///// <summary>
        ///// 获取住宅备份列表
        ///// </summary>
@@ -1405,11 +1422,11 @@
                var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(d);
                var revertObj = RequestHttps("https://developer.hdlcontrol.com/api/UserBackupList", requestJson, true);
                var jt = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JObject>>(revertObj.ResponseData.ToString());
                #region 恢复房间数据
#region 恢复房间数据
                GetBackupRoom(jt,loading);
                #endregion
#endregion
               
                Application.RunOnMainThread(() => {
                    loading.Hide();
@@ -1830,10 +1847,10 @@
        }
        */
        #endregion
#endregion
        #region Kaede --设备功能——————————————————————————————————
#region Kaede --设备功能——————————————————————————————————
        /// <summary>
        /// 获取设备列表
        /// </summary>
@@ -2063,9 +2080,9 @@
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson);
        }
        #endregion
#endregion
        #region Kaede --场景功能--------------------------
#region Kaede --场景功能--------------------------
        /// <summary>
        /// 获取场景列表
        /// 房间ID可空,默认查询住宅下所有房间
@@ -2197,9 +2214,9 @@
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code;
        }
        #endregion
#endregion
        #region Kaede --房间功能--------------------------
#region Kaede --房间功能--------------------------
        /// <summary>
        /// 获取房间列表
        /// </summary>
@@ -2274,10 +2291,10 @@
            return pack;
        }
        #endregion
#endregion
        #region Kaede -- 安防接口____________________________
#region Kaede -- 安防接口____________________________
        /// <summary>
        /// 获取安防列表
        /// </summary>
@@ -2441,10 +2458,10 @@
            return pack;
        }
        #endregion
#endregion
        #region Kaede --第三方品牌功能--------------------------
#region Kaede --第三方品牌功能--------------------------
        /// <summary>
        /// 获取第三方品牌列表
        /// </summary>
@@ -2469,9 +2486,9 @@
            return pack;
        }
        #endregion
#endregion
        #region ■ 萤石云SDK相关接口_________________________
#region ■ 萤石云SDK相关接口_________________________
        /// <summary>
        /// 河东获取萤石云子账号token的接口
        /// 2021-07-07 新方案接口调整对接
@@ -2484,10 +2501,10 @@
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
        }
        #endregion
#endregion
        #region ■ 可视对讲_________________________
#region ■ 可视对讲_________________________
        /// <summary>
        /// 检查住宅是否绑定丰林
        /// </summary>
@@ -2500,9 +2517,9 @@
            var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson);
            return pack;
        }
        #endregion
#endregion
        #region ■ 门锁相关____________________________
#region ■ 门锁相关____________________________
        /// <summary>
        /// 获取门锁历史记录(按日期降序)
@@ -2571,8 +2588,8 @@
            return listSortLog;
        }
        #endregion
        #region ■ 音箱语言控制相关_________________________
#endregion
#region ■ 音箱语言控制相关_________________________
        /// <summary>
        /// 获取已授权的音箱列表
        /// </summary>
@@ -2636,7 +2653,7 @@
            var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
        }
        #endregion
#endregion
        /// <summary>
HDL_ON/DAL/Server/HttpUtil.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// 请求超时时间
        /// </summary>
        public const int TIME_OUT = 10;
        public const int TIME_OUT = 15;
        /// <summary>
        /// 特殊接口请求超时时间
        /// </summary>
@@ -50,7 +50,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttpsGet(string apiPath, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        public static ResponsePackNew RequestHttpsGet(string apiPath, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            return RequestHttps(Method.GET, apiPath, null, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout);
        }
@@ -67,7 +67,7 @@
        ///// <param name="mTimeout">请求超时时间,默认10</param>
        ///// <param name="urlHead"></param>
        ///// <returns></returns>
        //public static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10, bool needErrorTip = true)
        //public static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT, bool needErrorTip = true)
        //{
        //    var mResponsePackNew = RequestHttps(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout);
        //    if (needErrorTip)
@@ -90,7 +90,7 @@
        /// <param name="bodyParameterJson"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = 10)
        public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = TIME_OUT)
        {
            string urlHead = DB_ResidenceData.Instance.CurrentRegion.regionUrl;
            //var replaceToken = "";
@@ -111,7 +111,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttpsPost(string apiPath, string bodyParameterJson, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        public static ResponsePackNew RequestHttpsPost(string apiPath, string bodyParameterJson, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout);
        }
@@ -126,7 +126,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttpsPost(string apiPath, Dictionary<string, object> queryDictionary, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        public static ResponsePackNew RequestHttpsPost(string apiPath, Dictionary<string, object> queryDictionary, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            return RequestHttps(Method.POST, apiPath, null, queryDictionary, null, urlHead, replaceToken, mTimeout);
        }
@@ -143,7 +143,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            //Dome模式登录
@@ -258,7 +258,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            var responsePackNew = RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout);
            //*****************Token过期处理*****************
@@ -383,7 +383,7 @@
        /// <param name="replaceToken"></param>
        /// <param name="mTimeout"></param>
        /// <returns></returns>
        public static ResponsePackNew RequestHttpsUpload(Method method, string apiPath, object bodyParameterObject = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10)
        public static ResponsePackNew RequestHttpsUpload(Method method, string apiPath, object bodyParameterObject = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT)
        {
            #region HttpWebRequest
            try
HDL_ON/DAL/Server/NewAPI.cs
@@ -276,14 +276,28 @@
        #endregion
        #region ■ PushSerivce -- 推送服务接口___________________________
        /// <summary>
        /// 添加推送Token
        /// 注册推送接口
        /// 批量推送绑定家居社区接口
        /// 2021-09-09 对接新接口支持物业公告推送
        /// communityCodes 不传 默认所有住宅或者小区都收到推送
        /// </summary>
        public const string API_POST_PushSerivce_AddToken = "/smart-footstone/app/push-information/add";
        public const string API_POST_PushSerivce_AddToken = "/smart-footstone/app/push-information/addPushToken";
        /// <summary>
        /// 删除推送Token
        /// 注销推送接口
        /// 批量解绑家居社区
        /// 2021-09-09 对接新接口支持物业公告推送
        /// </summary>
        public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/delete";
        public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/unBindPushToken";
        ///// <summary>
        ///// 添加推送Token
        ///// </summary>
        //public const string API_POST_PushSerivce_AddToken = "/smart-footstone/app/push-information/add";
        ///// <summary>
        ///// 删除推送Token
        ///// </summary>
        //public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/delete";
        ///// <summary>
        /////// 获取推送消息记录
        /////// </summary>
@@ -308,6 +322,11 @@
        /// 通过主键id删除一条推送记录
        /// </summary>
        public const string API_POST_PushSerivce_Deletepushinfo = "/smart-footstone/app/message/delete_by_id";
        /// <summary>
        /// 获取物业公告详情
        /// </summary>
        public const string API_POST_PushSerivce_GetNoticeInfo = "/community-footstone/app/notice/info";
        #endregion
        #region ■  -- 检测更新接口___________________________
HDL_ON/DAL/Server/NewApiRes.cs
@@ -1067,6 +1067,15 @@
        /// 软件来源,Evoyo、ON、ON_Plus
        /// </summary>
        public string software = SoftwareType.ON_Plus.ToString();
        /// <summary>
        /// 小区codes(不传,默认绑定所有住宅和小区的推送)
        /// </summary>
        public List<string> communityCodes;
        /// <summary>
        /// 指定推送语言 (目前该参数还没用)
        /// 2021-09-13 增加当前APP使用的语言参数, 目前云端接口还没支持
        /// </summary>
        public string languageType;
    }
    /// <summary>
@@ -1116,6 +1125,10 @@
        /// 消息记录Id
        /// </summary>
        public string msgId;
        /// <summary>
        /// 删除物业公告要这个
        /// </summary>
        public string pushType;
    }
HDL_ON/Entity/Device/DeviceModule.cs
@@ -40,5 +40,14 @@
        /// 区分是bus设备,还是knx设备
        /// </summary>
        public string driver_code = "";
        /// <summary>
        /// 是否主网关
        /// </summary>
        public bool master;
        /// <summary>
        /// 是否开启了本地加密
        /// 2021-09-23 注意:为了兼容控制以前不加密网关要用这个新的字段,不能用local_encrypt,因为发现以前部分固件已经有这个标记并且回复true,但实际上通信还没加密的
        /// </summary>
        public bool isLocalEncrypt;
    }
}
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -122,6 +122,10 @@
        /// 调试权限是否打开
        /// </summary>
        public bool debugPerm;
        /// <summary>
        /// 网关本地通信加密Key,同一个住宅 密钥创建后就不变
        /// </summary>
        public string localSecret;
    }
}
HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs
@@ -14,6 +14,10 @@
        /// bodyView
        /// </summary>
        FrameLayout bodyView;
        /// <summary>
        /// mWebView
        /// </summary>
        public WebView mWebView;
        /// <summary>
        /// WebViewDialog
@@ -26,28 +30,37 @@
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="titleStr"></param>
        /// <param name="url"></param>
        public void LoadPage(string titleStr, string url)
        void AddBodyViewWithTittle(string titleStr)
        {
            bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
            this.AddChidren(bodyView);
            new TopViewDiv(this, bodyView, titleStr).LoadTopView();
            //WebView
            var webView = new WebView() {
            mWebView = new WebView()
            {
                Y = Application.GetRealHeight(64),
                Height = bodyView.Height - Application.GetRealHeight(64),
                X = Application.GetRealWidth(16),
                Width = bodyView.Width - Application.GetRealWidth(32)
            };
            bodyView.AddChidren(webView);
            bodyView.AddChidren(mWebView);
        }
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="titleStr"></param>
        /// <param name="url"></param>
        public void LoadPage(string titleStr, string url) {
            AddBodyViewWithTittle(titleStr);
            try
            {
                if (!string.IsNullOrEmpty(url))
                {
                    //加载网址
                    webView.LoadRequest(url);
                    mWebView.LoadRequest(url);
                }
            }
            catch
@@ -57,5 +70,34 @@
            this.Show();
        }
        /// <summary>
        /// 加载页面
        /// html富文本
        /// </summary>
        /// <param name="titleStr"></param>
        /// <param name="htmlStr"></param>
        public void LoadPageWithHtmlStr(string titleStr, string htmlStr)
        {
            AddBodyViewWithTittle(titleStr);
            try
            {
                if (!string.IsNullOrEmpty(htmlStr))
                {
                    //html富文本
                    mWebView.LoadHTMLString(htmlStr);
                }
            }
            catch
            {
            }
            this.Show();
        }
    }
}
HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
@@ -140,7 +140,7 @@
#endif
            };
#endregion
            #endregion
            #region 分享与功能
            shareMenuButton = new MenuButton()
@@ -160,7 +160,7 @@
            shareMenuButton.SelectAction = shateAction;
            #endregion
#region 报警类
            #region 报警类
            alarmMenuButton = new MenuButton()
            {
                X = shareMenuButton.Right,
@@ -175,9 +175,9 @@
                MenuButtonSelect(2);
            };
            alarmMenuButton.SelectAction = alarmAction;
#endregion
            #endregion
#region 系统信息
            #region 系统信息
            systemMenuButton = new MenuButton()
            {
                X = alarmMenuButton.Right,
@@ -194,16 +194,17 @@
            systemMenuButton.SelectAction = systemAction;
            #endregion
            #region 物业通知
            #region 物业通知 2021-09-15增加
            propertyMenuButton = new MenuButton()
            {
                X = systemMenuButton.Right,
                Y = Application.GetRealWidth(16),
            };
            //menuView.AddChidren(propertyMenuButton); //先屏蔽
            propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png";
            propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png";
            propertyMenuButton.TextButton.TextID = StringId.SystemMessage;
            menuView.AddChidren(propertyMenuButton);
            propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/PropertyOn.png";
            propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Property.png";
            propertyMenuButton.TextButton.TextID = StringId.Propertynotice;
            propertyMenuButton.TextButton.IsMoreLines = true;
            Action propertyAction = () =>
            {
                MenuButtonSelect(4);
@@ -211,12 +212,12 @@
            propertyMenuButton.SelectAction = propertyAction;
            #endregion
            //先屏蔽
            ////右paddingView
            //menuView.AddChidren(new Button() {
            //    Width = Application.GetRealWidth(15),
            //    BackgroundColor = CSS_Color.viewTranslucence
            //});
            //右paddingView
            menuView.AddChidren(new Button()
            {
                Width = Application.GetRealWidth(15),
                BackgroundColor = CSS_Color.viewTranslucence
            });
        }
@@ -295,6 +296,8 @@
                propertyMenuButton.IsSelected = true;
            }
            menuView.ScrollToX(selectId * Application.GetRealWidth(40));
            GetPushMessageList(showMesType);
        }
@@ -404,16 +407,17 @@
            btnDatetime.Text = GetUnixToDateTime(pushMessageInfo.createTime);
            //2020-12-23 去掉点击弹窗事件
            //EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            //{
            //    new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show();
            //};
            //rowView.MouseUpEventHandler = eventHandler;
            //btnTilte.MouseUpEventHandler = eventHandler;
            //btnSubtitle.MouseUpEventHandler = eventHandler;
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                OnClickPushMessageInfo(pushMessageInfo);
                //new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show();
            };
            rowView.MouseUpEventHandler = eventHandler;
            btnTilte.MouseUpEventHandler = eventHandler;
            btnSubtitle.MouseUpEventHandler = eventHandler;
        }
        /// <summary>
@@ -447,7 +451,13 @@
            {
                try
                {
                    var result = new HttpServerRequest().PushSerivceDeleteMessage(pushMessageInfo.id);
                    var delPush = new PushMsgIdObj()
                    {
                        msgId = pushMessageInfo.id,
                        pushType = pushMessageInfo.pushType
                    };
                    var result = new HttpServerRequest().PushSerivceDeleteMessage(delPush);
                    if (result)
                    {
                        PushMessageInfoList.Remove(pushMessageInfo);
@@ -512,7 +522,7 @@
        void GetPushMessageList(int queryType = 0)
        {
            bodyScrolView.RemoveAll();
            if(PushMessageInfoList == null)
            if (PushMessageInfoList == null)
            {
                PushMessageInfoList = new List<PushMessageInfo>();
            }
@@ -520,7 +530,7 @@
            {
                PushMessageInfoList.Clear();
            }
            YearMark = "";//标记清空
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId))
            {
@@ -542,7 +552,8 @@
                        //PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString());
                        //2021-08-28 改为分页接口
                        var mPushMesList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString());
                        if(mPushMesList != null) {
                        if (mPushMesList != null)
                        {
                            PushMessageInfoList = mPushMesList.list;
                        }
@@ -613,7 +624,107 @@
            }
        }
#region 测试
        /// <summary>
        /// 获取物业通知详情
        /// </summary>
        /// <param name="noticeId"></param>
        void GetPropertyNoticeDetails(string noticeId)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new Thread(() =>
            {
                try
                {
                    var result = new HttpServerRequest().GetPropertyNoticeDetails(noticeId);
                    if (result.Code == StateCode.SUCCESS)
                    {
                        var mPushNoticeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<PushNoticeInfo>(result.Data.ToString());
                        if (mPushNoticeInfo != null)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                new WebViewDialog().LoadPageWithHtmlStr(mPushNoticeInfo.title, mPushNoticeInfo.content);
                            });
                        }
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 通知信息点击事件
        /// </summary>
        /// <param name="pushMessageInfo"></param>
        void OnClickPushMessageInfo(PushMessageInfo pushMessageInfo)
        {
            if (pushMessageInfo.pushType == PushType.Notice.ToString())
            {
                //Utlis.WriteLine("物业通知");
                string noticeId = GetNoticeId(pushMessageInfo.messageExpand);
                if (!string.IsNullOrEmpty(noticeId))
                {
                    GetPropertyNoticeDetails(noticeId);
                }
                else
                {
                    Utlis.WriteLine("noticeId null");
                }
            }
            else
            {
                Utlis.WriteLine("其它通知类型");
            }
        }
        /// <summary>
        /// 解析messageExpand 提取targetId
        /// </summary>
        /// <param name="messageExpand"></param>
        /// <returns></returns>
        string GetNoticeId(string messageExpand)
        {
            try
            {
                if (!string.IsNullOrEmpty(messageExpand))
                {
                    var mMessageExpandInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageExpandInfo>(messageExpand);
                    if (mMessageExpandInfo != null)
                    {
                        var mExpantContentInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContentInfo>(mMessageExpandInfo.expantContent);
                        if(mExpantContentInfo != null)
                        {
                            return mExpantContentInfo.targetId;
                        }
                    }
                }
                return null;
            }
            catch
            {
                return null;
            }
        }
        #region 测试
#if DEBUG
        /// <summary>
        /// 
@@ -688,7 +799,7 @@
#endif
#endregion
        #endregion
        /// <summary>
        /// 标记所有推送消息已读
@@ -778,10 +889,10 @@
        /// 消息内容
        /// </summary>
        public string messageContent;
        ///// <summary>
        ///// 扩展数据
        ///// </summary>
        //public string messageExpand;
        /// <summary>
        /// 扩展数据
        /// </summary>
        public string messageExpand;
        ///// <summary>
        ///// 消息类型;0:提示;1:报警;2:丰林可是对讲呼叫;3:强制下线推送
        ///// </summary>
@@ -806,4 +917,56 @@
    }
    /// <summary>
    /// 物业公告详情
    /// </summary>
    [System.Serializable]
    public class PushNoticeInfo
    {
        /// <summary>
        /// 消息ID
        /// </summary>
        public string noticeId;
        /// <summary>
        /// 消息标题
        /// </summary>
        public string title;
        /// <summary>
        /// 富文本内容
        /// </summary>
        public string content;
    }
    /// <summary>
    /// 推送扩展信息
    /// </summary>
    [System.Serializable]
    public class MessageExpandInfo
    {
        /// <summary>
        /// expantContent
        /// </summary>
        public string expantContent;
    }
    /// <summary>
    /// 推送扩展信息
    /// </summary>
    [System.Serializable]
    public class ExpantContentInfo
    {
        /// <summary>
        /// targetId
        /// </summary>
        public string targetId;
        /// <summary>
        /// messageType
        /// </summary>
        public string messageType;
    }
}