2020-01-16 Version 2.50115-B3 1.优化MQTT连接。 2.增加本地通信加密。 3.增加配置网关提示语。 4.编辑定时器增加重复名字提示 5.更新规范翻译。
2个文件已删除
13个文件已修改
6128 ■■■■ 已修改文件
Crabtree/.vs/SmartHome/xs/UserPrefs.xml 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-shm 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-wal 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON.Ios/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Resources/Resource.designer.cs 5907 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideSettingGateway.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/UserPrefs.xml
@@ -1,52 +1,48 @@
<Properties StartupConfiguration="{9D9EF20B-6E65-4A65-92BF-567EBF1E1443}|Default">
  <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.4b65c46595" />
  <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/UI/SimpleControl/Phone/Guide/GuideAddResidence.cs">
    <Files>
      <File FileName="SmartHome/HDL/Operation/ResponseEntity/SendJson.cs" Line="464" Column="8" />
      <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" Line="43" Column="25" />
      <File FileName="SmartHome/UI/SimpleControl/MqttCommon.cs" Line="105" Column="16" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs" Line="2270" Column="76" />
      <File FileName="SmartHome/HDL/Operation/MyEnum.cs" Line="1214" Column="27" />
      <File FileName="SmartHome/UI/SimpleControl/CommonPage.cs" Line="453" Column="22" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs" Line="45" Column="56" />
      <File FileName="SmartHome/UI/SimpleControl/EquipmentPublicClass.cs" Line="120" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs" Line="44" Column="23" />
      <File FileName="SmartHome/HDL/Operation/Packet.cs" Line="69" Column="1" />
      <File FileName="SmartHome/HDL/Operation/Device/ButtonPanel.cs" Line="27" Column="9" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs" Line="482" Column="42" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs" Line="12" Column="28" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs" Line="35" Column="40" />
      <File FileName="SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs" Line="26" Column="47" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs" Line="1" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs" Line="80" Column="29" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs" Line="207" Column="21" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs" Line="1" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/MqttCommon.cs" Line="545" Column="39" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs" Line="524" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" Line="42" Column="56" />
      <File FileName="SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs" Line="69" Column="19" />
      <File FileName="ON/Properties/AndroidManifest.xml" />
      <File FileName="ON.Ios/Info.plist" />
      <File FileName="SmartHome/HDL/Operation/ResponseEntity/GetSensorPushHistory.cs" Line="1" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/R.cs" Line="368" Column="54" />
      <File FileName="ON.Ios/Resources/Language.ini" Line="213" Column="4" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Guide/GuideSettingGateway.cs" Line="867" Column="28" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs" Line="1" Column="1" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Guide/GuideAddResidence.cs" Line="1" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="SmartHome" expanded="True">
            <Node name="ON.Droid" expanded="True">
              <Node name="Properties" expanded="True" />
            <Node name="ON.Ios" expanded="True">
              <Node name="Resources" expanded="True" />
            </Node>
            <Node name="Shared" expanded="True">
              <Node name="DLL" expanded="True" />
              <Node name="HDL" expanded="True">
                <Node name="Operation" expanded="True">
                  <Node name="Device" expanded="True" />
                  <Node name="ResponseEntity" expanded="True" />
                </Node>
              </Node>
              <Node name="IO" expanded="True" />
              <Node name="Net" expanded="True" />
              <Node name="UI" expanded="True">
                <Node name="SimpleControl" expanded="True">
                  <Node name="Phone" expanded="True">
                    <Node name="Guide" expanded="True" />
                    <Node name="Light" expanded="True" />
                    <Node name="Music" expanded="True" />
                    <Node name="Register" expanded="True" />
                    <Node name="Room" expanded="True" />
                    <Node name="Schedule" expanded="True" />
                    <Node name="User" expanded="True">
                      <Node name="UserMiddle.cs" selected="True" />
                    <Node name="Alexa" expanded="True" />
                    <Node name="DoorLock" expanded="True" />
                    <Node name="Guide" expanded="True">
                      <Node name="GuideAddResidence.cs" selected="True" />
                    </Node>
                    <Node name="Register" expanded="True" />
                    <Node name="Schedule" expanded="True" />
                    <Node name="User" expanded="True" />
                  </Node>
                </Node>
              </Node>
@@ -64,11 +60,12 @@
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.254b82433419c7ca1850b1dfb524c79b7aeb0640" />
  <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.446FF651-C1E0-4C68-805D-F62274849738" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs" relfile="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs" line="69" column="1" />
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs" relfile="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs" line="72" column="1" />
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" relfile="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" line="375" column="1" />
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" relfile="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" line="507" column="1" />
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" relfile="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" line="463" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide
Binary files differ
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-shm
Binary files differ
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-wal
Binary files differ
Crabtree/ON.Ios/Info.plist
@@ -17,9 +17,9 @@
    <key>CFBundleIdentifier</key>
    <string>com.hdl.SimpleControl</string>
    <key>CFBundleShortVersionString</key>
    <string>2.5200112</string>
    <string>2.5200116</string>
    <key>CFBundleVersion</key>
    <string>2.50112</string>
    <string>2.50116</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
Crabtree/ON/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtree" android:versionName="2.50115" android:versionCode="20200115">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtree" android:versionName="2.50116" android:versionCode="20200116">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" />
    <!-- Required  一些系统要求的权限,此处是极光推送需求的权限,如访问网络等-->
    <permission android:name="com.hdl.on.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
Crabtree/ON/Resources/Resource.designer.cs
Diff too large
Crabtree/SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs
@@ -7,19 +7,19 @@
        //网络错误
        public readonly static string NetworkError = "Network Error";
        //原因
        public readonly static string Reason = " Reason: ";
        public readonly static string Reason = " Cause: ";
        //账号已注册,激活邮件已经重新发送
        public readonly static string AccountYesRegisterNoIsverify = "The account is registered and the activation email has been resent!";
        public readonly static string AccountYesRegisterNoIsverify = "Account is registered and activation email has been resent!";
        //账号未激活
        public readonly static string NOTVERIFY = "Account is not activated!";
        //账号或密码错误
        public readonly static string USERNAMEORPWDERROR = "Account or password error!";
        //账号不存在
        public readonly static string ACCOUNTNOEXISTS = "Account not exist!";
        public readonly static string ACCOUNTNOEXISTS = "Account does not exist";
        //登录失败,原因为:
        public readonly static string LoginFailed = "Login failed!";
        //无效登录Token
        public readonly static string NoLogin = "LInvalid Login Token!";
        public readonly static string NoLogin = "Invalid Login Token!";
        //名称已存在        
        public readonly static string NameExist = "Name already exists!";
        //添加失败
@@ -27,49 +27,48 @@
        //操作失败
        public readonly static string OperationFailed = "Operation failed!";
        //原密码和新密码相同
        public readonly static string NewPasswordAndOldPasswordEqual = "The old password and the new password are the same!";
        public readonly static string NewPasswordAndOldPasswordEqual = "New password should be different with the original one.";
        //原密码错误
        public readonly static string OldPwdNoYes = "Wrong original password!";
        //发送邮件失败
        public readonly static string SendEmailFail = "Send mail failed!";
        public readonly static string SendEmailFail = "Unable to send mail.";
        //当前提交HomeId与当前OldMac尚不存在绑定关系!
        public readonly static string NoBind = "There is no binding relationship between the currently submitted HomeId and the current OldMac!";
        public readonly static string NoBind = "The HomeId just submitted is not bound with current OldMac.";
        //Token 验证失败
        public readonly static string HomeIdAndTokenNoConsistent = "Token verification failed!";
        //
        public readonly static string CurrentHomeExixtsGatewayBind = "The home still has a gateway binding, please untie it first!";
        //住宅还存在网关绑定,请先解绑完再操作!
        public readonly static string CurrentHomeExixtsGatewayBind = "The home is bound with gateway already, please unbind first.";
        //交付备份, 不能删除!
        public readonly static string DeliveryBackNoUpdateDel = "Delivery backup, cannot be deleted!";
        public readonly static string DeliveryBackNoUpdateDel = "Backup delivered and cannot be deleted.";
        //住宅未绑定网关  请先绑定无线网关! 
        public readonly static string HomeNoRecord = "Please bind the gateway first!";
        public readonly static string HomeNoRecord = "Please bind gateway first!";
        //住宅不存在!
        public readonly static string HomeNoExist = "Home doesn't exist!";
        public readonly static string HomeNoExist = "Home does not exist!";
        //生成的Guid已存在
        public readonly static string GuidExist = "Guid Exist!";
        public readonly static string GuidExist = "Guid already exists.";
        //删除失败
        public readonly static string FailedDelete = "Failed to delete!";
        //子账号不存在
        public readonly static string SubAccountNoExists = "The sub account is not registered, please bind the registered sub account!";
        public readonly static string SubAccountNoExists = "Sub accound does not exist.";
        //不能添加自己为子账号
        public readonly static string SameAccount = "Can't add yourself as a sub-account!";
        //账号已存在此住宅
        public readonly static string SubAccountExist = "Account already exists!";
        //不能绑定主账号
        public readonly static string NoAddMainAccount = "Can't bind master account!";
        public readonly static string NoAddMainAccount = "Can't bind main account!";
        //获取住宅的网关列表失败!
        public readonly static string FailedGetGatewaysForHome = "Failed to get list of gateways for home!";
        public readonly static string FailedGetGatewaysForHome = "Unable to get gateway list for home!";
        //此网关已绑定到一个住所,请在绑定到另一个住所之前将其重置。或者长按网关按键3S,变成红灯常亮,然后重试!
        public readonly static string UnableToBindGateway = "This gateway is already bound to one residence, please reset it before binding to another residence.Or long press the gateway button 3S, the red light is always on, and then try again!";
        public readonly static string UnableToBindGateway = "This gateway has been bound to one residence, please unbind or reset before binding to another residence. (Press gateway button for 3s and the red light keeps on, then retry.)";
        //网关固件版本过低,请先升级!
        public readonly static string GatewayVersionLow = "The gateway firmware version is too low, please upgrade first!";
        public readonly static string GatewayVersionLow = "Please update firmware first.";
        //请先绑定无线网关  2020-01-11
        public readonly static string BindGatewayFirst = "Please bind the gateway first!";
        public readonly static string BindGatewayFirst = "Please bind wireless gateway first.";
        //您的帐户已在另一台设备使用远程连接登录!
        public readonly static string LoginInAnotherDevice = "Your account is signed in with a remote connection on another device!";
        //您并不具有此分享者此住宅的完全控制权限!
        //您并不具有此分享住宅的完全控制权限!
        public readonly static string InsufficientAuthority = "You don't have full control over this sharer's home!";
        //密码错误或者网关被其它住宅绑定,与网关通讯失败! 请长按网关按钮3S,进入红灯常亮,然后重新搜索!
        public readonly static string GatewayPasswordError = "The password is wrong or the gateway is bound by another home, communication with the gateway failed! Please long press the gateway button 3S, the red light is always on, and then search again!";
        //网关被其它住宅绑定,与网关通讯失败! 请长按网关按钮3S,进入红灯常亮,然后重新搜索!
        public readonly static string GatewayPasswordError = "Failed to communicate with gateway, as the gateway has already been bound to another residence. Please press the gateway button for 3s, and search again when the red light keeps on.";
    }
}
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
@@ -39,7 +39,7 @@
        //public static Button LogoButton = new Button ();
        public static string RequestVersion = "20200115";
        public static string RequestVersion = "20200116";
        public static UserInfo LoginUser;
        /// <summary>
        /// 是否是管理员权限(变更了,成员的时候,这个也为ture。为什么会声明这样变量,因为有些接口必须使用原来的Token)
Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs
@@ -46,6 +46,10 @@
            InitMqtt ();
        }
        /// <summary>
        /// 保活重连和重订阅 线程
        /// </summary>
        /// <returns></returns>
        public static async System.Threading.Tasks.Task InitMqtt ()
        {
            new System.Threading.Thread (async () => {
@@ -92,8 +96,6 @@
                        Topic = $"/BusGateWayToClient/{mMqttInfo.connEmqClientId}/Push/NotifySqueeze",
                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce
                    };
                    var topicFilters = new TopicFilter [] { topicFilterCommon, topicFilterGateWayInfoChange, topicFilterNotifySqueeze };
                    var result = await RemoteMqttClient.SubscribeAsync (topicFilters);
@@ -146,21 +148,11 @@
        public static async System.Threading.Tasks.Task StartCloudMqtt ()
        {
            //Application.RunOnMainThread (() => {
            //    if (5 < (DateTime.Now - dateTime).TotalSeconds) {
            //        return;
            //    }
            //    //MainPage.Loading.Start (Language.StringByID (Shared.SimpleControl.R.MyInternationalizationString.Connecting));
            //    dateTime = DateTime.Now;
            //});
            if (!MainPage.LoginUser.IsLogin) {
                return;
            }
            //追加:没有远程连接的权限
            if (remoteMqttIsConnecting
               || remoteIsConnected) {
                //System.Console.WriteLine ($"============>MqttremoteMqttIsConnecting:{remoteMqttIsConnecting}  remoteIsConnected:{remoteIsConnected} ");
            if (remoteMqttIsConnecting || remoteIsConnected) {
                return;
            }
@@ -268,9 +260,6 @@
                                if (CurRemoteMACInfo != null) {
                                    if (CurRemoteMACInfo.isValid == "InValid") {
                                        MainPage.AddTip ("Remote failed,gateway offline");
                                        //Application.RunOnMainThread (() => {
                                        //    MainPage.Loading.Hide ();
                                        //});
                                    } else {
                                        MqttRemoteSend (new byte [] { 0 }, 3);
                                    }
@@ -389,6 +378,11 @@
        public static async Task MqttRemoteSend (byte [] message, int optionType = 0)
        {
            try {
                if (!remoteIsConnected) {
                    System.Console.WriteLine ($"============>Mqtt 未连接 取消发送");
                    return;
                }
                var topicName = @"/" + MainPage.LoginUser.AccountString.ToLower () + @"/" + UserConfig.Instance.GatewayMAC.Replace (".", "") + @"/" + currentGuid;
                switch (optionType) {
                case 0:
@@ -541,7 +535,7 @@
            MainPage.LoginUser.LastTime = DateTime.Now.AddDays (-30);
            MainPage.LoginUser.SaveUserInfo ();
            DisConnectRemoteMqttClient ("LoginOut");
            DisConnectRemoteMqttClient ("挤下线");
            MainPage.ShowAlertOnMainThread (ErrorCode.LoginInAnotherDevice);
Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs
@@ -88,7 +88,7 @@
            ItemButton.MouseUpEventHandler += (sender, e) => {
                Action action = () => {
                    Application.RunOnMainThread (() => {
                        MainPage.Loading.Start ("please wait...");
                        MainPage.Loading.Start ("Please wait...");
                    });
                    System.Threading.Tasks.Task.Run (() => {
                        try {
@@ -111,7 +111,7 @@
                    System.Threading.Tasks.Task.Factory.StartNew (() => {
                        try {
                            Application.RunOnMainThread (() => {
                                MainPage.Loading.Start ("please wait...");
                                MainPage.Loading.Start ("Please wait...");
                            });
                            foreach (var newDevicePath in roomDeviceFilePathList) {
                                var common = Newtonsoft.Json.JsonConvert.DeserializeObject<Common> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (newDevicePath)));
@@ -384,7 +384,7 @@
                System.Threading.Tasks.Task.Factory.StartNew (() => {
                    try {
                        Application.RunOnMainThread (() => {
                            MainPage.Loading.Start ("please wait...");
                            MainPage.Loading.Start ("Please wait...");
                        });
                        var tempRoom = new Room ();
                        foreach (var device in alexaDeviceLista) {//特殊处理服务器与本地设备类型不一样的设备
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
@@ -527,7 +527,7 @@
        /// </summary>
        /// <param name="backBytes"></param>
        /// <returns></returns>
        static bool CheckIsSuccessfulWithBytes (byte [] backBytes)
        static bool CheckIsSuccessfulWithBytes (byte [] backBytes, string errorStr = "Modify gateway configuration failed!")
        {
            if (backBytes == null) {
                Application.RunOnMainThread (() => {
@@ -539,7 +539,7 @@
                return true;
            } else {
                Application.RunOnMainThread (() => {
                    new Alert ("", Language.StringByID (R.MyInternationalizationString.OperationFailed),
                    new Alert ("", errorStr,
                               Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                });
                return false;
@@ -611,12 +611,17 @@
                        //如果没加密,走修改加密方法
                        var result = SetGateWayLocalEncryption (common);
                        if (!result) {
                            MainPage.LoadingHide ();
                            Application.RunOnMainThread (() => {
                                MainPage.Loading.Hide ();
                                new Alert ("", ErrorCode.OperationFailed, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                            });
                            return result;//修改失败 返回goNext false
                        }
                        //修改成功,设置本地为加密方式
                        UserConfig.Instance.IsLocalEncrypt = true;
                        System.Console.WriteLine ($"============>LocalEncryptKey 加密成功Key为:{UserConfig.Instance.LocalEncryptKey}");
                        //System.Console.WriteLine ($"============>LocalEncryptKey 加密成功Key为:{UserConfig.Instance.LocalEncryptKey}");
                    }
                    goNext = true;
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideSettingGateway.cs
@@ -777,7 +777,8 @@
                } catch (Exception ex) {
                    Console.WriteLine (ex.Message);
                    Application.RunOnMainThread (() => {
                        new Alert ("", Language.StringByID (R.MyInternationalizationString.OperationFailed), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                        //修改网关连接模式失败
                        new Alert ("", "Failed to modify gateway connection mode!", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                    });
                    bool canRemove = false;
                } finally {
@@ -834,7 +835,7 @@
            byte [] backBytes = Control.ControlBytesSendHasReturn (Command.SetGateWayAdminInfo, gatewayDeicve.SubnetID, gatewayDeicve.DeviceID, adminBytes);
            return CheckIsSuccessfulWithBytes (backBytes);
            return CheckIsSuccessfulWithBytes (backBytes, "Failed to modify gateway administrator information!");
        }
        /// <summary>
@@ -842,7 +843,7 @@
        /// </summary>
        /// <param name="backBytes"></param>
        /// <returns></returns>
        private bool CheckIsSuccessfulWithBytes (byte [] backBytes)
        private bool CheckIsSuccessfulWithBytes (byte [] backBytes, string errorStr = "Modify gateway configuration failed!")
        {
            if (backBytes == null) {
                Application.RunOnMainThread (() => {
@@ -854,7 +855,7 @@
                return true;
            } else {
                Application.RunOnMainThread (() => {
                    new Alert ("", Language.StringByID (R.MyInternationalizationString.OperationFailed),
                    new Alert ("", errorStr,
                               Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                });
                return false;
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -95,8 +95,13 @@
            }
            var accountList = accountListDB.account;
            //自动填写账号
            if (string.IsNullOrEmpty (account)) {
                if (accountList.Count > 0) {
                    etAccount.Text = accountList [accountList.Count - 1];
                }
            
            }
            var accountListView = new VerticalScrolViewLayout () {
                Width = Application.GetRealWidth (500),
                Height = Application.GetRealHeight (85 * 2),
@@ -136,8 +141,8 @@
                Y = etPasswrod.Y + Application.GetRealHeight (12),
                Width = Application.GetRealWidth (73),
                Height = Application.GetRealHeight (60),
                UnSelectedImagePath = "CrabtreeAdd/ShowPW.png",
                SelectedImagePath = "CrabtreeAdd/HidePW.png",
                UnSelectedImagePath = "CrabtreeAdd/HidePW.png",
                SelectedImagePath = "CrabtreeAdd/ShowPW.png",
                BorderColor = SkinStyle.Current.Transparent,
                BorderWidth = 2,
                Radius = 1
@@ -428,10 +433,16 @@
            var revertObj = MainPage.RequestHttps (API.Login, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                if (!accountListDB.account.Contains (account)) {
                //if (!accountListDB.account.Contains (account)) {
                //    accountListDB.account.Add (account);
                //    accountListDB.SaveAccountListDB ();
                //}
                if (accountListDB.account.Contains (account)) {
                    accountListDB.account.Remove (account);
                }
                    accountListDB.account.Add (account);
                    accountListDB.SaveAccountListDB ();
                }
                var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes> (revertObj.ResponseData.ToString ());
                var revertData = responseDataObj;
Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs
@@ -577,17 +577,33 @@
                    //new Alert ("", "请填写定时器名称!", "Close").Show ();
                    new Alert ("", "Please set name for the timer!", "Close").Show ();
                    return;
                } else if (listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName) != null && !isEdit) {//2020-01-09 编辑的时候也提示重复名字
                    //if (isEdit) {
                    //}
                    new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show ();
                    return;
                }
                //else if (listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName) != null && !isEdit) {//2020-01-09 编辑的时候也提示重复名字
                //    //if (isEdit) {
                //    //}
                //    new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show ();
                //    return;
                //}
                if (timerControlDeviceList.Count == 0) {
                    new Alert ("", "Please choose at least one device!", "Close").Show ();
                    return;
                }
                var mTimer = listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName);
                if (isEdit) {
                    if (mTimer != null && mTimer.Id != timerTemp.Id) {
                        new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show ();
                        return;
                    }
                } else {
                    if (mTimer != null) {
                        new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show ();
                        return;
                    }
                }
                timerTemp.Periodicity = "";
                if (btnMonday.IsSelected == true && btnFriday.IsSelected == true && btnThursday.IsSelected == true && btnSunday.IsSelected == true && btnTuesday.IsSelected == true && btnSaturday.IsSelected == true && btnWednesday.IsSelected == true) {
                    timerTemp.TimerType = TimerType.EveryDay;