Bläddra i källkod

修复Bug:小米禁用DSN后,抄写工具闪退问题。

jianfeng1.wang 2 år sedan
förälder
incheckning
76f1d850d2
1 ändrade filer med 11 tillägg och 3 borttagningar
  1. 11 3
      FactoryTool_CShare/Views/OperationPanel.cs

+ 11 - 3
FactoryTool_CShare/Views/OperationPanel.cs

@@ -2248,8 +2248,8 @@ namespace MOKA_Factory_Tools
                         goto end;
                     }
 #else
-                    devicecode = "277";
-                    psn = keyInfo._PSN.data = "FZ1BBCP2706XXNXB00037";
+                    devicecode = "2C5";
+                    psn = keyInfo._PSN.data = "FZ7BBCP2A11XXNXM00008";
 #endif
                 }
 
@@ -2345,7 +2345,7 @@ namespace MOKA_Factory_Tools
                 if (midListNow.keytype.ContainsKey("DSN"))
                 {
                     // 预防切了pid后,deviceCode变化了;
-                    if (keyInfo.DSN.data.IndexOf(devicecode) == -1)
+                    if ( keyInfo.DSN.data != null &&  keyInfo.DSN.data.IndexOf(devicecode) == -1)
                     {
                         ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, keyInfo.DSN.data);
                         Log.WriteErrorLog(ErrMsg);
@@ -2406,6 +2406,14 @@ namespace MOKA_Factory_Tools
                     SetCheckboxStatus(WriteDSN, true);
                     keyInfo.DSN.data = _MiKey.DSN;
                     keyInfo.DSN.enable = true;
+
+                    // 预防切了pid后,deviceCode变化了;
+                    if (keyInfo.DSN.data != null && keyInfo.DSN.data.IndexOf(devicecode) == -1)
+                    {
+                        ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, keyInfo.DSN.data);
+                        Log.WriteErrorLog(ErrMsg);
+                        goto end;
+                    }
                 }
                 else if (!midListNow.keytype.ContainsKey("DSN"))
                 {