wxr
2022-06-13 acf6f2bfdd9c4fa2500cc746e1064f375dc633d1
备份
6个文件已修改
158 ■■■■ 已修改文件
Crabtree/ON/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Resources/Resource.designer.cs 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/HDL/Operation/MyEnum.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/MigrationServer.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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:versionCode="202206091" android:versionName="2.706091">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtree" android:versionCode="202206131" android:versionName="2.706131">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="28" />
    <!-- 在安卓P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Crabtree/ON/Resources/Resource.designer.cs
@@ -25,6 +25,7 @@
        
        public static void UpdateIdValues()
        {
            global::DroidService.Resource.String.library_name = global::com.hdl.on.Resource.String.library_name;
            global::Xamarin.Essentials.Resource.Attribute.font = global::com.hdl.on.Resource.Attribute.font;
            global::Xamarin.Essentials.Resource.Attribute.fontProviderAuthority = global::com.hdl.on.Resource.Attribute.fontProviderAuthority;
            global::Xamarin.Essentials.Resource.Attribute.fontProviderCerts = global::com.hdl.on.Resource.Attribute.fontProviderCerts;
@@ -4212,106 +4213,109 @@
            public const int hello = 2131558444;
            
            // aapt resource value: 0x7F0D002D
            public const int not_recognized_fingerprint_hint = 2131558445;
            public const int library_name = 2131558445;
            
            // aapt resource value: 0x7F0D002E
            public const int password_toggle_content_description = 2131558446;
            public const int not_recognized_fingerprint_hint = 2131558446;
            
            // aapt resource value: 0x7F0D002F
            public const int path_password_eye = 2131558447;
            public const int password_toggle_content_description = 2131558447;
            
            // aapt resource value: 0x7F0D0030
            public const int path_password_eye_mask_strike_through = 2131558448;
            public const int path_password_eye = 2131558448;
            
            // aapt resource value: 0x7F0D0031
            public const int path_password_eye_mask_visible = 2131558449;
            public const int path_password_eye_mask_strike_through = 2131558449;
            
            // aapt resource value: 0x7F0D0032
            public const int path_password_strike_through = 2131558450;
            public const int path_password_eye_mask_visible = 2131558450;
            
            // aapt resource value: 0x7F0D0033
            public const int pickerview_cancel = 2131558451;
            public const int path_password_strike_through = 2131558451;
            
            // aapt resource value: 0x7F0D0034
            public const int pickerview_day = 2131558452;
            public const int pickerview_cancel = 2131558452;
            
            // aapt resource value: 0x7F0D0035
            public const int pickerview_hours = 2131558453;
            public const int pickerview_day = 2131558453;
            
            // aapt resource value: 0x7F0D0036
            public const int pickerview_minutes = 2131558454;
            public const int pickerview_hours = 2131558454;
            
            // aapt resource value: 0x7F0D0037
            public const int pickerview_month = 2131558455;
            public const int pickerview_minutes = 2131558455;
            
            // aapt resource value: 0x7F0D0038
            public const int pickerview_seconds = 2131558456;
            public const int pickerview_month = 2131558456;
            
            // aapt resource value: 0x7F0D0039
            public const int pickerview_submit = 2131558457;
            public const int pickerview_seconds = 2131558457;
            
            // aapt resource value: 0x7F0D003A
            public const int pickerview_year = 2131558458;
            public const int pickerview_submit = 2131558458;
            
            // aapt resource value: 0x7F0D003B
            public const int search_menu_title = 2131558459;
            public const int pickerview_year = 2131558459;
            
            // aapt resource value: 0x7F0D003C
            public const int srl_component_falsify = 2131558460;
            public const int search_menu_title = 2131558460;
            
            // aapt resource value: 0x7F0D003D
            public const int srl_content_empty = 2131558461;
            public const int srl_component_falsify = 2131558461;
            
            // aapt resource value: 0x7F0D003E
            public const int srl_footer_failed = 2131558462;
            public const int srl_content_empty = 2131558462;
            
            // aapt resource value: 0x7F0D003F
            public const int srl_footer_finish = 2131558463;
            public const int srl_footer_failed = 2131558463;
            
            // aapt resource value: 0x7F0D0040
            public const int srl_footer_loading = 2131558464;
            public const int srl_footer_finish = 2131558464;
            
            // aapt resource value: 0x7F0D0041
            public const int srl_footer_nothing = 2131558465;
            public const int srl_footer_loading = 2131558465;
            
            // aapt resource value: 0x7F0D0042
            public const int srl_footer_pulling = 2131558466;
            public const int srl_footer_nothing = 2131558466;
            
            // aapt resource value: 0x7F0D0043
            public const int srl_footer_refreshing = 2131558467;
            public const int srl_footer_pulling = 2131558467;
            
            // aapt resource value: 0x7F0D0044
            public const int srl_footer_release = 2131558468;
            public const int srl_footer_refreshing = 2131558468;
            
            // aapt resource value: 0x7F0D0045
            public const int srl_header_failed = 2131558469;
            public const int srl_footer_release = 2131558469;
            
            // aapt resource value: 0x7F0D0046
            public const int srl_header_finish = 2131558470;
            public const int srl_header_failed = 2131558470;
            
            // aapt resource value: 0x7F0D0047
            public const int srl_header_loading = 2131558471;
            public const int srl_header_finish = 2131558471;
            
            // aapt resource value: 0x7F0D0048
            public const int srl_header_pulling = 2131558472;
            public const int srl_header_loading = 2131558472;
            
            // aapt resource value: 0x7F0D0049
            public const int srl_header_refreshing = 2131558473;
            public const int srl_header_pulling = 2131558473;
            
            // aapt resource value: 0x7F0D004A
            public const int srl_header_release = 2131558474;
            public const int srl_header_refreshing = 2131558474;
            
            // aapt resource value: 0x7F0D004B
            public const int srl_header_secondary = 2131558475;
            public const int srl_header_release = 2131558475;
            
            // aapt resource value: 0x7F0D004C
            public const int srl_header_update = 2131558476;
            public const int srl_header_secondary = 2131558476;
            
            // aapt resource value: 0x7F0D004D
            public const int status_bar_notification_info_overflow = 2131558477;
            public const int srl_header_update = 2131558477;
            
            // aapt resource value: 0x7F0D004E
            public const int touch_fingerprint_sensor_hint = 2131558478;
            public const int status_bar_notification_info_overflow = 2131558478;
            // aapt resource value: 0x7F0D004F
            public const int touch_fingerprint_sensor_hint = 2131558479;
            
            static String()
            {
Crabtree/SmartHome/HDL/Operation/MyEnum.cs
@@ -330,6 +330,13 @@
        /// </summary>
        InitializationGatewayACK = 0x3001,
        /// <summary>
        /// 设置网关远程
        /// 0 本地
        /// 4 远程
        /// </summary>
        //SetGatewayRemote = 0x3003,
        //SetGatewayRemoteACK = 0x3004,
        /// <summary>
        /// 写入秘钥
        /// 01 秘钥
        /// </summary>
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
@@ -955,6 +955,39 @@
                        Array.Copy (ddd, 0, newddd, 0, 20 < ddd.Length ? 20 : ddd.Length);
                        Array.Copy (newddd, 0, usefullBytes, 13, 20 < newddd.Length ? 20 : newddd.Length);
                    }
                    if (usefullBytes [2] == 254 && usefullBytes [3] > 4) {
                        #region
                        SuperWireless superWireless = new SuperWireless ();
                        string superWirelessPath = "Equipment_" + typeof (OnePortWirelessFR).Name + "_" + subnetID + "_" + deviceID;
                        var superWirelessbytes = IO.FileUtils.ReadFile (superWirelessPath);
                        if (superWirelessbytes.Length > 1) {
                            superWireless = Newtonsoft.Json.JsonConvert.DeserializeObject<SuperWireless> (MyEncodingUTF8.GetString (superWirelessbytes));
                        }
                        superWireless.SubnetID = subnetID;
                        superWireless.DeviceID = deviceID;
                        superWireless.ChNumberCount = usefullBytes [4];
                        superWireless.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]);
                        superWireless.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//=============
                        superWireless.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36];
                        superWireless.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40];
                        superWireless.IPMAC = usefullBytes [41] + "." + usefullBytes [42] + "." + usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46];
                        superWireless.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50];
                        superWireless.DHCP = usefullBytes [51] == 0 ? false : true;
                        if (usefullBytes.Length == 80) {
                            superWireless.EncryptionFlag = usefullBytes [53];
                            superWireless.Password = MyEncodingGB2312.GetString (usefullBytes, 54, 8).Trim ('\0');
                            superWireless.WirelessBand = usefullBytes [62];
                            superWireless.WirelessChannel = usefullBytes [63];
                            superWireless.WirelessPassword = MyEncodingGB2312.GetString (usefullBytes, 64, 16).Trim ('\0');
                        }
                        GateWayList.Add (superWireless);
                        Application.RunOnMainThread (() => {
                            GuideAddGateway.InitGatewayRowView (superWireless);
                        });
                        #endregion
                    } else {
                    switch (deviceType) {
                    case DeviceType.SuperWireless:
                        #region
@@ -1151,7 +1184,7 @@
                        break;
                    }
                    }
                    //GuideAddGateway.InitGatewayRowView (new Common () {
                    //    SubnetID = subnetID, DeviceID = deviceID, Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0')
                    //});
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
@@ -12,6 +12,7 @@
        {
        }
        public void ShouwAccountView ()
        {
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/MigrationServer.cs
@@ -13,7 +13,8 @@
        /// </summary>
        private bool finish = false;
        private string SeverAddr = "https://test-gz.hdlcontrol.com";//"https://bahrain-gateway.hdlcontrol.com"
        private string SeverAddr = "https://bahrain-gateway.hdlcontrol.com";
        //private string SeverAddr = "https://test-gz.hdlcontrol.com";
        FrameLayout contentView;
@@ -27,6 +28,7 @@
        string newUserId;
        Button btnSave;
        public MigrationServer ()
        {
@@ -76,6 +78,7 @@
                Text = "请输入密码,确认迁移",
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = SkinStyle.Current.TextColor,
                IsMoreLines = true,
            };
            contentView.AddChidren (btnTipTitle);
@@ -152,7 +155,6 @@
                }
#if DEBUG
                //WriteSecretKey (1, 0, new byte [] {1,1,2,3,2,3,4,5,2,3,5,6 });
                //CheckGateway ();
@@ -608,12 +610,27 @@
                                        System.Threading.Thread.Sleep (100);
                                    } else {
                                        Application.RunOnMainThread (() => {
                                            btnTipMsg.Text = "初始化网关成功,正在迁移账号信息。";
                                            btnTipMsg.Text = "初始化网关成功,正在打开网关远程配置。";
                                            btnTipMsg.TextColor = SkinStyle.Current.TextColor;
                                        });
                                        break;
                                    }
                                }
                                //开启网关远程
                                var setRemoteResult = SetGatewayRemote (common.SubnetID, common.DeviceID);
                                if (setRemoteResult) {
                                    Application.RunOnMainThread (() => {
                                        btnTipMsg.Text = "网关远程已开启,正在迁移账号信息。";
                                        btnTipMsg.TextColor = SkinStyle.Current.TextColor;
                                    });
                                } else {
                                    Application.RunOnMainThread (() => {
                                        btnTipMsg.Text = "网关远程开启失败。";
                                        btnTipMsg.TextColor = SkinStyle.Current.DelColor;
                                    });
                                    return;
                                }
                                //迁移账号
                                var moveAccontResult = Account2New (pwd);
                                if (moveAccontResult) {
@@ -820,6 +837,24 @@
        }
        
        /// <summary>
        /// 设备网关开启远程
        /// </summary>
        private bool SetGatewayRemote(byte subnetId, byte deviceId)
        {
            var sendByte = new byte [67];
            sendByte [0] = 4;
            var result = Control.ControlBytesSendHasReturn (Command.SetGateWayModelInfo, subnetId, deviceId, sendByte);
            if (result == null) {
            } else {
                if(result.Length>0 && result[0] == 248) {
                    return true;
                }
            }
            return false;
        }
        /// <summary>
        /// 写入homeId
        /// </summary>
        /// <param name="subnetId"></param>