From 032a22c21bc9b2adb6b9ff3201433522a335df57 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 16 五月 2023 16:08:50 +0800
Subject: [PATCH] 安卓短信自动填充,首页插座改成总控

---
 SiriIntentsUI/Info.plist                                            |    4 
 HDL-ON_Android/Properties/AndroidManifest.xml                       |    3 
 HDL-ON_iOS/HDL-ON_iOS.csproj                                        |    6 --
 HDL_ON/UI/UI1-Login/LoginPageBLL.cs                                 |   22 +++++++
 HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs                           |   12 ++--
 HDL-ON_iOS/AppDelegate.cs                                           |    7 --
 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs                        |   50 ++++++++--------
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                             |   16 ++--
 /dev/null                                                           |    0 
 SiriIntents/Info.plist                                              |    4 
 DLL/Shared.Droid0512.dll                                            |    0 
 HDL-ON_Android/SplashActivity.cs                                    |    2 
 HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs |    4 +
 HDL_ON/DAL/DriverLayer/Control.cs                                   |    3 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                    |   31 ++++++++++
 DLL/Shared.Droid.dll                                                |    0 
 16 files changed, 105 insertions(+), 59 deletions(-)

diff --git a/DLL/Shared.Droid.dll b/DLL/Shared.Droid.dll
index dcfb70c..de703bc 100644
--- a/DLL/Shared.Droid.dll
+++ b/DLL/Shared.Droid.dll
Binary files differ
diff --git a/DLL/Shared.Droid0512.dll b/DLL/Shared.Droid0512.dll
new file mode 100644
index 0000000..dcfb70c
--- /dev/null
+++ b/DLL/Shared.Droid0512.dll
Binary files differ
diff --git a/DLL/Shared.Droid1.dll b/DLL/Shared.Droid1.dll
deleted file mode 100644
index dbf1276..0000000
--- a/DLL/Shared.Droid1.dll
+++ /dev/null
Binary files differ
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index b3ca131..b1617c2 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,6 +1,7 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202305122">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202305126">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
+	<uses-permission android:name="android.permission.RECEIVE_SMS" />
 	<!--鍙嬬洘-->
 	<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
 	<!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs
index 1fbe7c2..4271cff 100644
--- a/HDL-ON_Android/SplashActivity.cs
+++ b/HDL-ON_Android/SplashActivity.cs
@@ -103,7 +103,7 @@
             //#endif
             JPushInterface.Init(this);
 
-            //Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "316a8f5d83");
+            Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "316a8f5d83");
 
 
 
diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs
index 9064edf..f57bb02 100644
--- a/HDL-ON_iOS/AppDelegate.cs
+++ b/HDL-ON_iOS/AppDelegate.cs
@@ -4,9 +4,6 @@
 using Shared;
 using UIKit;
 using UserNotifications;
-using Microsoft.AppCenter;
-using Microsoft.AppCenter.Analytics;
-using Microsoft.AppCenter.Crashes;
 using HDL_ON.UI;
 using HDL_ON.DAL.Server;
 using Intents;
@@ -290,7 +287,7 @@
             Console.WriteLine("111111111111");
             SetCurrentLanguage();
             //Shared.Application.FontSize = 12;
-            Bugly.Bugly.StartWithAppId("b58fb35436");
+            Bugly.Bugly.StartWithAppId("1dc40c170a");
             //鍙栨秷EditText榛樿瀵嗙爜杈撳叆鏂瑰紡
             //Shared.Application.IsEditTextContentTypePassword = false;
             //榛樿浣跨敤鑻规柟瀛椾綋
@@ -303,8 +300,6 @@
             rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true };
             Window.RootViewController = rootViewController;
             Window.MakeKeyAndVisible();
-
-            AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e", typeof(Analytics), typeof(Crashes));
 
             SharedMethod.SharedMethod.sharedApp = application;
             //NSString* nsCount = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index b4c94f0..052dc20 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -123,12 +123,6 @@
       <PackageReference Include="MQTTnet">
         <Version>3.1.0</Version>
       </PackageReference>
-      <PackageReference Include="Microsoft.AppCenter.Analytics">
-        <Version>4.4.0</Version>
-      </PackageReference>
-      <PackageReference Include="Microsoft.AppCenter.Crashes">
-        <Version>4.4.0</Version>
-      </PackageReference>
       <PackageReference Include="ZXing.Net.Mobile">
         <Version>2.4.1</Version>
       </PackageReference>
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 7e94fb4..ce113f2 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -257,7 +257,8 @@
         public void SearchLoaclGateway()
         {
             //2021-01-15 : 浣忓畢娌℃湁缁戝畾缃戝叧鐨勬椂鍊欎笉鐢ㄦ悳绱紝骞朵笖涓嶈兘閾炬帴mqtt
-            if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId))
+            if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) ||
+                    !UserInfo.Current.IsLogin)
             {
                 return;
             }
diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
index b63cf28..abe6f65 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
@@ -112,7 +112,7 @@
         /// <summary>
         /// 楠岃瘉鐮佹枃鏈緭鍏ユ
         /// </summary>
-        EditText etVerificationCode;
+        TextView etVerificationCode;
         /// <summary>
         /// 鑾峰彇楠岃瘉鐮佹寜閽�
         /// </summary>
@@ -341,16 +341,16 @@
             //};
             //verificationCodeView.AddChidren(btnDividingLineVertical_VerificationCodeView1);
 
-            etVerificationCode = new EditText()
+            etVerificationCode = new TextView()
             {
                 X = Application.GetRealWidth(49),
                 Width = Application.GetRealWidth(61 + 84),
-                TextAlignment = TextAlignment.CenterLeft,
+                //TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.TextFontSize,
-                PlaceholderTextColor = CSS_Color.PromptingColor1,
-                PlaceholderText = Language.StringByID(StringId.PlsEntryVerificationCode),
-                IsNumberKeyboardType = true
+                //PlaceholderTextColor = CSS_Color.PromptingColor1,
+                //PlaceholderText = Language.StringByID(StringId.PlsEntryVerificationCode),
+                //IsNumberKeyboardType = true
             };
             verificationCodeView.AddChidren(etVerificationCode);
 
diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
index ecef487..066db11 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
@@ -145,14 +145,14 @@
             //    }
             //};
 
-            Action<View, string> textChangeEventHandler = (view, textStr) =>
-            {
-                LoadMothed_EnableResetButton();
-            };
-            //etAccount.TextChangeEventHandler += textChangeEventHandler;
-            etPassword.TextChangeEventHandler += textChangeEventHandler;
-            etRepeatPassword.TextChangeEventHandler += textChangeEventHandler;
-            etVerificationCode.TextChangeEventHandler += textChangeEventHandler;
+            //Action<View, string> textChangeEventHandler = (view, textStr) =>
+            //{
+            //    LoadMothed_EnableResetButton();
+            //};
+            ////etAccount.TextChangeEventHandler += textChangeEventHandler;
+            //etPassword.TextChangeEventHandler += textChangeEventHandler;
+            //etRepeatPassword.TextChangeEventHandler += textChangeEventHandler;
+            //etVerificationCode.TextChangeEventHandler += textChangeEventHandler;
         }
 
         /// <summary>
@@ -286,23 +286,23 @@
             };
 
             //楠岃瘉鐮佹枃鏈鐒︾偣鍙樺寲浜嬩欢
-            etVerificationCode.FoucsChanged += (sender, e) =>
-            {
-                if (etVerificationCode.Foucs)
-                {
-                    HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.GotFocus);
-                }
-                else
-                {
-                    if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
+            //etVerificationCode.FoucsChanged += (sender, e) =>
+            //{
+            //    if (etVerificationCode.Foucs)
+            //    {
+            //        HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.GotFocus);
+            //    }
+            //    else
+            //    {
+            //        if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
 
-                    HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Normal);
-                    if (etVerificationCode.Text.Length > 4)
-                    {
-                        LoadMothed_EnableResetButton();
-                    }
-                }
-            };
+            //        HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Normal);
+            //        if (etVerificationCode.Text.Length > 4)
+            //        {
+            //            LoadMothed_EnableResetButton();
+            //        }
+            //    }
+            //};
         }
 
 
@@ -401,7 +401,7 @@
                                     {
                                         //鐭俊鍙戦�侀棿闅�60s
                                         (sender as Button).IsSelected = false;
-                                        etVerificationCode.Foucs = true;
+                                        //etVerificationCode.Foucs = true;
                                     });
                                     //2.1鑾峰彇楠岃瘉鐮佸�掕鏃�
                                     new Thread(() =>
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 8fd4643..5ecb0a9 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -29,6 +29,30 @@
                     this.Y = 0;
                 });
             };
+            BaseActivity.SmsAction = (message) => {
+                Console.WriteLine($"鎺ユ敹鍒扮煭淇★細"+ message);
+
+                string pattern = @"銆怘DL銆�.*(\d{6}).*";
+
+                Regex regex = new Regex(pattern);
+
+                Match match = regex.Match(message);
+
+                if (match.Success)
+                {
+                    string code = match.Groups[1].Value;
+                    Console.WriteLine("楠岃瘉鐮佷负锛�" + code);
+                    if(loginType==0 && logintMode == 1)
+                    {
+                        etPassword.Text = code;
+                    }
+                    smsCode = code;
+                }
+                else
+                {
+                    Console.WriteLine("鏈壘鍒伴獙璇佺爜锛�");
+                }
+            };
 #endif
         }
 
@@ -45,6 +69,7 @@
             BaseActivity.HideKeyboardEvent = () => {
 
             };
+            BaseActivity.SmsAction = (sms) => { };
 #endif
             base.RemoveFromParent();
 
@@ -67,6 +92,10 @@
         int logintMode = 0;
         string account = "";
         string password = "";
+        /// <summary>
+        /// 鐭俊楠岃瘉鐮�
+        /// </summary>
+        string smsCode = "";
 #endregion
 
 #region 鎺т欢鍒楄〃
@@ -234,7 +263,6 @@
                     //etAccount.Text = "tf@smarttech.com.ua";
                     //etAccount.Text = "455740454@qq.com";
                     //etAccount.Text = "18688565449";
-                    etAccount.Text = "support7@hdlautomation.com";
                     //etAccount.Text = "18570064522";
                     //etAccount.Text = "18718417827";
                     //etAccount.Text = "18188019284";
@@ -253,6 +281,7 @@
                     //etAccount.Text = "13751916353";
                     etAccount.Text = "13549566666";
                     etAccount.Text = "18316672920";
+                    etAccount.Text = "support7@hdlautomation.com";
                 }
                 else
                 {
diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
index 849ce05..34968ff 100644
--- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -86,6 +86,9 @@
                         btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
                         return;
                     }
+#if __IOS__
+                    etPassword.Foucs = true;
+#endif
                     //鍔犺浇Loading鏁堟灉
                     var waitPage = new Loading();
                     bodyView.AddChidren(waitPage);
@@ -315,6 +318,7 @@
                 //}
                 //闅愯棌瀵嗙爜
                 etPassword.SecureTextEntry = true;
+                etPassword.IsNumberKeyboardType = false;
             }
             //楠岃瘉鐮佺櫥褰�
             else if (logintMode == 1)
@@ -342,6 +346,24 @@
                 }
                 //楠岃瘉鐮佷笉闇�瑕侀殣钘�
                 etPassword.SecureTextEntry = false;
+                etPassword.Text = smsCode;
+                etPassword.IsNumberKeyboardType = true;
+#if __IOS__
+                var currentInputMode = UIKit.UITextInputMode.CurrentInputMode;
+                var installedInputModes = UIKit.UITextInputMode.ActiveInputModes;
+                var temmm = new EditText()
+                {
+                    X = Application.GetRealWidth(78),
+                    Width = Application.GetRealWidth(61 + 84),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    Foucs = true,
+                    BackgroundColor  = 0x44330000,
+                };
+                passwordView.AddChidren(etPassword); 
+
+#endif
             }
         }
 
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 850ab99..5c82a1c 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -604,14 +604,14 @@
                         d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                         Control.Ins.SendWriteCommand(function, d);
                     }
-                    else if (function.spk == SPK.PanelSocket)
-                    {
-                        if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null)
-                        {
-                            d.Add("on_off_usb", function.trait_on_off.curValue.ToString());
-                        }
-                        Control.Ins.SendWriteCommand(function, d);
-                    }
+                    //else if (function.spk == SPK.PanelSocket)//鍘绘帀锛岀粺涓�澶勭悊鎬绘帶
+                    //{
+                    //    if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null)
+                    //    {
+                    //        d.Add("on_off_usb", function.trait_on_off.curValue.ToString());
+                    //    }
+                    //    Control.Ins.SendWriteCommand(function, d);
+                    //}
                     else
                     {
                         d.Add("on_off", function.trait_on_off.curValue.ToString());
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
index 6835fc1..a7a9b3e 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -19,6 +19,10 @@
                     {
                         return;
                     }
+                    if (updateTemp.sid != bodyView.function.sid)
+                    {
+                        return;
+                    }
                     var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
                     bodyView.btnTemp.Text = outinTemp.ToString();
                     //bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C";
diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist
index c6169ee..d47547f 100644
--- a/SiriIntents/Info.plist
+++ b/SiriIntents/Info.plist
@@ -11,9 +11,9 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.3.202304211</string>
+	<string>1.7.6</string>
 	<key>CFBundleVersion</key>
-	<string>1.3.04211</string>
+	<string>1.7.6</string>
 	<key>MinimumOSVersion</key>
 	<string>12.2</string>
 	<key>NSExtension</key>
diff --git a/SiriIntentsUI/Info.plist b/SiriIntentsUI/Info.plist
index f114d39..d8b4eff 100644
--- a/SiriIntentsUI/Info.plist
+++ b/SiriIntentsUI/Info.plist
@@ -15,9 +15,9 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.3.202304211</string>
+	<string>1.7.6</string>
 	<key>CFBundleVersion</key>
-	<string>1.3.04211</string>
+	<string>1.7.6</string>
 	<key>MinimumOSVersion</key>
 	<string>12.2</string>
 	<key>NSExtension</key>

--
Gitblit v1.8.0