From 7ef8b17bb52b7e535cf5b348acaa43670e77152a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 31 七月 2023 13:48:20 +0800
Subject: [PATCH] Update HdlEzvizDroid.dll
---
HDL_ON/Common/ApiUtlis.cs | 185 +++++++++++++++++++++++++++++----------------
1 files changed, 118 insertions(+), 67 deletions(-)
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index a177095..5272390 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -78,7 +78,10 @@
public void DownloadData()
{
if (MainPage.InternetStatus == 0 || MainPage.NoLoginMode)
+ {
+ DownloadDataComplete = true;
return;
+ }
endTime1 = DateTime.Now.AddSeconds(25);
complateDevice = complateScene = false;
@@ -101,6 +104,19 @@
code = Ins.HttpRequest.RefreshToken();
if (code != StateCode.SUCCESS)
{
+ if (waitPage != null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ catch { }
+ });
+ }
MainPage.Log($"鍒锋柊token澶辫触");
return;
}
@@ -109,6 +125,19 @@
code = Ins.HttpRequest.GetHomePager();
if (code != StateCode.SUCCESS)
{
+ if (waitPage != null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ catch { }
+ });
+ }
MainPage.Log($"鍒锋柊浣忓畢淇℃伅澶辫触");
return;
}
@@ -117,6 +146,19 @@
code = Ins.HttpRequest.GetUserInfo();
if (code != StateCode.SUCCESS)
{
+ if (waitPage != null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ catch { }
+ });
+ }
MainPage.Log($"鍒锋柊涓汉淇℃伅澶辫触");
return;
}
@@ -140,6 +182,7 @@
// return;
//}
+ //return;
try
{
@@ -172,9 +215,9 @@
if (deviceResult.Code == StateCode.SUCCESS)
{
FunctionList.List.ClearDatas();
- MainPage.Log($"============璁惧============寮�濮�" + FunctionList.List.Functions.Count);
+ //MainPage.Log($"============璁惧============寮�濮�" + FunctionList.List.Functions.Count);
//MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
- //MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
+ MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
if (deviceList == null)
{
@@ -225,15 +268,14 @@
}
}
//澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
- int iiii = 0;
+ //int iiii = 0;
foreach (var newFunction in deviceList.list)
{
newFunction.AssembleStatus();
newFunction.SaveFunctionFile();
FunctionList.List.IniFunctionList(newFunction.savePath,true);
- MainPage.Log($"============璁惧============{iiii++}");
+ //MainPage.Log($"============璁惧============{iiii++}");
}
-
@@ -254,8 +296,10 @@
string videoList = videoInfo.Data.ToString();
FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList);
- foreach (var video in FunctionList.List.videoIntercom)
+ for(int i =0;i< FunctionList.List.videoIntercom.Count;i++)
{
+ var video = FunctionList.List.videoIntercom[i];
+
if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString())
{
UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken;
@@ -265,27 +309,37 @@
isInterphoneType_HDL = true;
DB_ResidenceData.Instance.SupportFacePass = true;
DB_ResidenceData.Instance.SaveResidenceData();
-
- Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
+ DB_ResidenceData.Instance.SupportFVDevice = true;
}
else if (video.interphoneType == InterphoneType.FREEVIEW.ToString())
{
+#if __IOS__
+ try
+ {
+ FunctionList.List.videoIntercom.Remove(video);
+ --i;
+ }catch(Exception ex)
+ {
+ MainPage.Log($"ios 鍏ㄨ閫氬紓甯� : {ex.Message}");
+ }
+
+#else
//涓哄叏瑙嗛�氬彲瑙嗗璁�
DB_ResidenceData.Instance.SupportFacePass = true;
Entity.DB_ResidenceData.Instance.SupportVisitorManage = true;
Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
-
- //isInterphoneType_HDL = true;
isInterphoneType_FREEVIEW = true;
-
+#endif
}
}
}
+
//======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃====================
//濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲�
if (HDLLinphone.Current.CheckIncomingCallThreadIsNull())
{
+
//褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶�
if (isInterphoneType_HDL)
{
@@ -311,23 +365,29 @@
}
}
+
+
//======================鐧诲綍鍏ㄨ閫�====================
if (isInterphoneType_FREEVIEW)
{
#if __IOS__
- List<VisitorTempPassword> dataList = new List<VisitorTempPassword>();
- Dictionary<string, object> dictionary = new Dictionary<string, object>();
- dictionary.Add("homeId", Entity.DB_ResidenceData.Instance.CurrentRegion.id);
- var requestJson = HttpUtil.GetSignRequestJson(dictionary);
- ResponsePackNew pack = HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetExtMemberInfo, requestJson);
- if(pack!= null)
- {
- var data = Newtonsoft.Json.JsonConvert.DeserializeObject<FreeviewMemberInfo>(pack.Data.ToString());
- //鐧诲綍鍏ㄨ閫�
- Shared.IOS.HDLFVSDK.Video.Init("", data.extUserId, DB_ResidenceData.Instance.CurrentRegion.id, "78FF1E4D-FC0A-4E71-9B79-0448E4460BD7", "T0001", "120.77.53.170:9700", "120.77.53.170:21664");
-
- }
+ //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion;
+ //string errorVersion = "16.2.0";
+ //if (systemVersion.CompareTo(errorVersion) < 0)///鍏ㄨ閫氫笉鍏煎ios16浠ヤ笂鐨勭郴缁燂紝涓嶈鍔犺浇杩欎釜鍏�
+ //{
+ // List<VisitorTempPassword> dataList = new List<VisitorTempPassword>();
+ // Dictionary<string, object> dictionary = new Dictionary<string, object>();
+ // dictionary.Add("homeId", Entity.DB_ResidenceData.Instance.CurrentRegion.id);
+ // var requestJson = HttpUtil.GetSignRequestJson(dictionary);
+ // ResponsePackNew pack = HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetExtMemberInfo, requestJson);
+ // if (pack != null)
+ // {
+ // var data = JsonConvert.DeserializeObject<FreeviewMemberInfo>(pack.Data.ToString());
+ // //鐧诲綍鍏ㄨ閫�
+ // Shared.IOS.HDLFVSDK.Video.Init("", data.extUserId, DB_ResidenceData.Instance.CurrentRegion.id, "78FF1E4D-FC0A-4E71-9B79-0448E4460BD7", "T0001", "120.77.53.170:9700", "120.77.53.170:21664");
+ // }
+ //}
#endif
}
@@ -347,9 +407,7 @@
}
-#if DEBUG
- DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true;
-#endif
+ //======================缇ゆ帶====================
if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
{
var pack = Ins.HttpRequest.GetGroupControlList();
@@ -382,6 +440,7 @@
}
readSidList.Clear();
}
+ //FunctionList.List.Functions.AddRange(FunctionList.List.groupControls);
}
if (readSidList.Count > 0)
{
@@ -412,14 +471,7 @@
}
}
}
-
-
- //})
- //{ IsBackground = true }.Start();
-
- ////===================鍦烘櫙==========================
- //new System.Threading.Thread(() =>
- //{
+ //======================鍦烘櫙====================
try
{
complateScene = false;
@@ -480,21 +532,17 @@
{
complateScene = true;
}
+
+ //======================瀹夐槻====================
+ GetSecurityList();
})
{ IsBackground = true }.Start();
//===================璇诲彇閫昏緫鍒楄〃==========================
Logic.LogicList.Clear();//涓婚〉涓嬫媺寮哄埗鍒锋柊鑷姩鍖栧垪琛�
- //UI.UI2.Intelligence.Automation.MainView.GetLogicList();
-
-
- //======================瀹夐槻====================
- GetSecurityList();
//======================娉ㄥ唽鎺ㄩ��====================
httpRequest.RegisteredPush();
-
-
}
catch (Exception ex)
{
@@ -592,40 +640,43 @@
/// </summary>
public void GetSecurityList()
{
- var pack = Ins.HttpRequest.GetSecurityList();
- if (pack.Code == StateCode.SUCCESS)
+ lock (FunctionList.List.securities)
{
- var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString());
- var sidList = new List<string>();
- foreach (var function in packList)
+ var pack = Ins.HttpRequest.GetSecurityList();
+ if (pack.Code == StateCode.SUCCESS)
{
- sidList.Add(function.sid);
- }
- var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>());
- var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString());
- if (infoList != null)
- {
- var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_"));
- if (filePathList != null)
+ var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString());
+ Console.WriteLine("瀹夐槻鎬绘暟锛�" + packList.Count);
+ var sidList = new List<string>();
+ foreach (var function in packList)
{
- foreach (var file in filePathList)
+ sidList.Add(function.sid);
+ }
+ var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>());
+ var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString());
+ if (infoList != null)
+ {
+ var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_"));
+ if (filePathList != null)
{
- FileUtlis.Files.DeleteFile(file);
+ foreach (var file in filePathList)
+ {
+ FileUtlis.Files.DeleteFile(file);
+ }
+ }
+ FunctionList.List.securities.Clear();
+ foreach (var function in infoList)
+ {
+ function.SaveFile();
+ FunctionList.List.IniFunctionList(function.savePath, true);
}
}
- FunctionList.List.securities.Clear();
- foreach (var function in infoList)
- {
- function.SaveFile();
- FunctionList.List.IniFunctionList(function.savePath, true);
- }
}
- }
- else
- {
- MainPage.Log($"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{pack.Code}; Msg:{pack.message}");
+ else
+ {
+ MainPage.Log($"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{pack.Code}; Msg:{pack.message}");
+ }
}
-
}
/// <summary>
--
Gitblit v1.8.0