From 3c9ad99d4a5eeeb53f7380315197e7133f84d10c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 27 十月 2020 14:57:33 +0800
Subject: [PATCH] 2020-10-27 1V2.510271 1.密码规则修改,修改为:密码必须为8-20个字符,包含字母、数字和符号。 2.APP本地增加登录,密码错误锁定,连续错误5次登录锁定,锁定5分钟。 3.登录界面,增加登录账号的邮箱格式匹配检测。 4.增加iOS越狱和Androidr Root检测,强制关闭APP。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs |   82 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 71 insertions(+), 11 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs
index 57b973d..0aeab48 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs
@@ -73,7 +73,7 @@
 
                     var btnPoint = new Button () {
                         Width = Application.GetRealWidth (10),
-                        Height = Application.GetRealHeight (10),
+                        Height = Application.GetRealWidth (10),
                         X = Application.GetRealWidth (50),
                         Gravity = Gravity.CenterVertical,
                         UnSelectedImagePath = "Item/Point.png",
@@ -390,13 +390,18 @@
                 alert.Show ();
             };
 
-            if (MainPage.LoginUser.AccountType != 1) {
+            //if (MainPage.LoginUser.AccountType != 1) {
+            //    rowView.AddRightView (btnDelFile);
+            //}
+
+            //2020-07-01 褰撳墠浣忓畢灞炰簬鑷繁鐨� 鍏佽鍒犻櫎澶囦唤
+            if (!MainPage.IsAdministrator) {
                 rowView.AddRightView (btnDelFile);
             }
 
             var btnPoint = new Button () {
                 Width = Application.GetRealWidth (10),
-                Height = Application.GetRealHeight (10),
+                Height = Application.GetRealWidth (10),
                 X = Application.GetRealWidth (25),
                 Gravity = Gravity.CenterVertical,
                 UnSelectedImagePath = "Item/Point.png",
@@ -434,8 +439,8 @@
             rowView.AddChidren (backupIcon);
 
             var Backup_restores = new Button () {
-                Width = Application.GetRealWidth (56),
-                Height = Application.GetRealHeight (57),
+                Width = Application.GetMinRealAverage (56),
+                Height = Application.GetMinRealAverage (57),
                 X = backupIcon.Right + Application.GetRealWidth (20),
                 UnSelectedImagePath = "Register/Backup_ restores.png",
                 SelectedImagePath = "Register/Backup_ restores_on.png",
@@ -920,7 +925,7 @@
             int index = 0;
             int indexCount = 0;
 
-            var mFileList = dataList.FindAll ((obj) => obj.BackupFileName != "null" && obj.BackupFileName != UserConfig.configFile && obj.BackupFileName != UserInfo.GlobalRegisterFile && obj.BackupFileName != "AccountListDB");
+            var mFileList = dataList.FindAll ((obj) => obj.BackupFileName != "null" && obj.BackupFileName != UserConfig.configFile && obj.BackupFileName != UserInfo.GlobalRegisterFile && obj.BackupFileName != "AccountListDB" && obj.BackupFileName != CommonConfig.ConfigFile);
             if (maxThreads > mFileList.Count) {
                 maxThreads = mFileList.Count;
             }
@@ -949,7 +954,7 @@
                 new System.Threading.Thread (() => {
 
                     for (var j = startIndex1; j <= endIndex1; j++) {
-                        var result = DownloadSomeDataBackup (mDownLoad, mUrlHead, dataList [j]);
+                        var result = DownloadSomeDataBackup (mDownLoad, mUrlHead, mFileList [j]);
                         if (result) {
                             index++;
                             Application.RunOnMainThread (() => {
@@ -1044,10 +1049,10 @@
         /// 澶氭涓婁紶澶氫釜鏂囦欢
         /// </summary>
         /// <param name="mBackupClassId"></param>
-        void UpLoadBackupFileToDBNew (string mBackupClassId, int maxThreads = 30)
+        void UpLoadBackupFileToDBNew (string mBackupClassId, int maxThreads = 20)
         {
             var backuplist = IO.FileUtils.ReadFiles ();
-            var mFileList = backuplist.FindAll ((obj) => obj != "null" && obj != UserConfig.configFile && obj != UserInfo.GlobalRegisterFile && obj != "AccountListDB");
+            var mFileList = backuplist.FindAll ((obj) => obj != "null" && obj != UserConfig.configFile && obj != UserInfo.GlobalRegisterFile && obj != "AccountListDB" && obj != CommonConfig.ConfigFile);
             if (mFileList.Count <= 0) return;
 
             if (maxThreads > mFileList.Count) {
@@ -1080,8 +1085,8 @@
                 var id = i;
                 var startIndex1 = startIndex;
                 var endIndex1 = endIndex;
-
-                var result = UploadDataBackup (upData, urlHead, mFileList, startIndex1, endIndex1);
+                //2020-06-10 淇敼澶у浘鐗囧ぇ鏂囦欢澶勭悊
+                var result = UploadDataBackupNew (upData, urlHead, mFileList, startIndex1, endIndex1);
                 if (result) {
                     index++;
                     Application.RunOnMainThread (() => {
@@ -1114,5 +1119,60 @@
 
         }
 
+
+        /// <summary>
+        /// 2020-06-05 闇�瑕佺瓑寰呬簯绔鍔犳帴鍙�
+        /// 澶勭悊澶ф枃浠跺拰鍥剧墖涓婁紶
+        /// 
+        /// </summary>
+        /// <param name="upData"></param>
+        /// <param name="mUrlHead"></param>
+        /// <param name="fileList"></param>
+        /// <param name="startIndex1"></param>
+        /// <param name="endIndex1"></param>
+        /// <returns></returns>
+        bool UploadDataBackupNew (UploadHomeAppGatewaySubFilesObj upData, string mUrlHead, List<string> fileList, int startIndex1, int endIndex1)
+        {
+            try {
+
+                var list = new List<FileInfoData> ();
+                for (var j = startIndex1; j <= endIndex1; j++) {
+                    var datainfo = new FileInfoData ();
+                    datainfo.BackupFileName = fileList [j];
+                    datainfo.BackupFileContent = Shared.IO.FileUtils.ReadFile (fileList [j]);
+
+                    if (datainfo.BackupFileContent.Length > 1024 * 10) {
+                        var upDataBig = new UploadHomeAppGatewaySubFilesBigObj ();
+                        upDataBig.RequestVersion = upData.RequestVersion;
+                        upDataBig.HomeId = upData.HomeId;
+                        upDataBig.BackupClassId = upData.BackupClassId;
+                        upDataBig.FileName = fileList [j];
+                        upDataBig.IsOtherAccountCtrl = upData.IsOtherAccountCtrl;
+
+                        var revertObj5 = MainPage.RequestHttpsNewBig (API.UploadHomeAppGatewaySingleSubFile, datainfo.BackupFileContent, upDataBig, mUrlHead);
+
+                    } else {
+                        list.Add (datainfo);
+                    }
+                }
+
+                //鏁寸悊鏁版嵁
+                UploadHomeAppGatewaySubFilesObj mUpData = upData;
+                mUpData.UploadSubFileLists = list;
+
+                var requestJson2 = Newtonsoft.Json.JsonConvert.SerializeObject (mUpData);
+                var revertObj2 = MainPage.RequestHttps (API.UploadHomeAppGatewaySubFiles, requestJson2, mUrlHead);
+                if (revertObj2.StateCode.ToUpper () == "SUCCESS") {
+                    return true;
+                } else {
+                    //鎻愮ず閿欒
+                    return false;
+                }
+            } catch {
+                return false;
+            }
+        }
+
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0