Browse Source

修复上报IDM时,把小米的key也上报导致的问题。

Wang Jeff 2 years ago
parent
commit
5aa387663b

+ 9 - 5
FactoryTool_CShare/Business/V2Method.cs

@@ -477,7 +477,7 @@ namespace MOKA_Factory_Tools
             return result;
             return result;
         }
         }
 
 
-        public static string GetReportJson(string order, string sn, bool isNodid, string clientType, string swVer, string pid, ref KeyInfo keyinfo)
+        public static string GetReportJson(string order, string sn, bool isNodid, string clientType, string swVer, string pid, ref KeyInfo keyinfo, bool bMIEnable, ref MIKey mIKey)
         {
         {
             Func<string, string, JObject, bool> AddJsonItem = (name, value, jobj) =>
             Func<string, string, JObject, bool> AddJsonItem = (name, value, jobj) =>
             {
             {
@@ -536,7 +536,8 @@ namespace MOKA_Factory_Tools
                 if (keyinfo != null)
                 if (keyinfo != null)
                 {
                 {
                     AddKeyJson2(keyinfo.DID, postJson, "deviceid");
                     AddKeyJson2(keyinfo.DID, postJson, "deviceid");
-                    AddKeyJson2(keyinfo.Mac, postJson, "mac");
+                    if ( !bMIEnable || (mIKey != null && mIKey.EthernetMac == null))
+                        AddKeyJson2(keyinfo.Mac, postJson, "mac");
                     AddKeyJson2(keyinfo.HDCP, postJson, "hdcpkey");
                     AddKeyJson2(keyinfo.HDCP, postJson, "hdcpkey");
                     AddKeyJson2(keyinfo.HDCP22, postJson, "hdcpkey2");
                     AddKeyJson2(keyinfo.HDCP22, postJson, "hdcpkey2");
                     AddKeyJson2(keyinfo.ESN, postJson, "netfilxesn");
                     AddKeyJson2(keyinfo.ESN, postJson, "netfilxesn");
@@ -545,9 +546,12 @@ namespace MOKA_Factory_Tools
                     AddKeyJson2(keyinfo.Attestation, postJson, "attestation");
                     AddKeyJson2(keyinfo.Attestation, postJson, "attestation");
                     AddKeyJson2(keyinfo.MGK, postJson, "mgk");
                     AddKeyJson2(keyinfo.MGK, postJson, "mgk");
                     AddKeyJson2(keyinfo.Fairplay, postJson, "fairplay");
                     AddKeyJson2(keyinfo.Fairplay, postJson, "fairplay");
-                    AddKeyJson2(keyinfo.DSN, postJson, "dsn");
-                    AddKeyJson2(keyinfo.WiFi_MAC, postJson, "wifimac");
-                    AddKeyJson2(keyinfo.BT_MAC, postJson, "btmac");
+                    if (!bMIEnable || ( mIKey != null && mIKey.DSN == null))
+                        AddKeyJson2(keyinfo.DSN, postJson, "dsn");
+                    if (!bMIEnable || (mIKey != null && mIKey.WIFIMAC == null))
+                        AddKeyJson2(keyinfo.WiFi_MAC, postJson, "wifimac");
+                    if (!bMIEnable || (mIKey != null && mIKey.BTMac == null))
+                        AddKeyJson2(keyinfo.BT_MAC, postJson, "btmac");
                     AddKeyJson2(keyinfo.LEK, postJson, "lek");
                     AddKeyJson2(keyinfo.LEK, postJson, "lek");
                     AddKeyJson2(keyinfo.PEK, postJson, "pek");
                     AddKeyJson2(keyinfo.PEK, postJson, "pek");
                     AddKeyJson2(keyinfo.Playready, postJson, "playready");
                     AddKeyJson2(keyinfo.Playready, postJson, "playready");

+ 2 - 2
FactoryTool_CShare/Views/OperationPanel.cs

@@ -4739,7 +4739,7 @@ namespace MOKA_Factory_Tools
             {// 在线抄写;
             {// 在线抄写;
                 if (WriteDID.Checked)
                 if (WriteDID.Checked)
                 {
                 {
-                    string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo);
+                    string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable, ref _MiKey);
                     if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow,  false, "", FunctionSettingNow.ReportTimeOut))
                     if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow,  false, "", FunctionSettingNow.ReportTimeOut))
                     {
                     {
                         TestResult = 1;
                         TestResult = 1;
@@ -4759,7 +4759,7 @@ namespace MOKA_Factory_Tools
                     if (SN.Trim().Length > 0)
                     if (SN.Trim().Length > 0)
                     {
                     {
                         keycontent += "nodid=true&";
                         keycontent += "nodid=true&";
-                        string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo);
+                        string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable, ref _MiKey);
                         if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow, false, "", FunctionSettingNow.ReportTimeOut))
                         if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow, false, "", FunctionSettingNow.ReportTimeOut))
                         {
                         {
                             TestResult = 1;
                             TestResult = 1;