|
@@ -854,30 +854,39 @@ namespace MOKA_Factory_Tools
|
|
}
|
|
}
|
|
else if (keyjson.Length > 0)
|
|
else if (keyjson.Length > 0)
|
|
{
|
|
{
|
|
|
|
+ #region 解决Json对象空导致的Bug.
|
|
|
|
+ Func<JToken, string> GetJsonValue = (JsonObj) =>
|
|
|
|
+ {
|
|
|
|
+ if (JsonObj == null )
|
|
|
|
+ return "";
|
|
|
|
+
|
|
|
|
+ return JsonObj.Value<string>();
|
|
|
|
+ };
|
|
|
|
+ #endregion
|
|
JObject jObject = JObject.Parse(keyjson);
|
|
JObject jObject = JObject.Parse(keyjson);
|
|
- keyInfo.DID.data = jObject["did"].Value<string>();
|
|
|
|
- keyInfo.Mac.data = jObject["mac"].Value<string>();
|
|
|
|
- keyInfo.HDCP.data = jObject["hdcp"].Value<string>();
|
|
|
|
- keyInfo.HDCP22.data = jObject["hdcp22"].Value<string>();
|
|
|
|
- keyInfo.WiDi.data = jObject["widi"].Value<string>();
|
|
|
|
- keyInfo.Widevine.data = jObject["widevine"].Value<string>();
|
|
|
|
- keyInfo.ESN.data = jObject["esn"].Value<string>();
|
|
|
|
- keyInfo.CI_plus.data = jObject["cikey"].Value<string>();
|
|
|
|
- keyInfo.MGK.data = jObject["mgk"].Value<string>();
|
|
|
|
- keyInfo.Attestation.data = jObject["attestation"].Value<string>();
|
|
|
|
- keyInfo.Fairplay.data = jObject["fairplay"].Value<string>();
|
|
|
|
- keyInfo.ECP.data = jObject["ecp"].Value<string>();
|
|
|
|
- keyInfo.WiFi_MAC.data = jObject["wifimac"].Value<string>();
|
|
|
|
- keyInfo.BT_MAC.data = jObject["btmac"].Value<string>();
|
|
|
|
- keyInfo.LEK.data = jObject["lek"].Value<string>();
|
|
|
|
- keyInfo.PEK.data = jObject["pek"].Value<string>();
|
|
|
|
- keyInfo.Playready.data = jObject["playready"].Value<string>();
|
|
|
|
- keyInfo.Hashkey.data = jObject["hash"].Value<string>();
|
|
|
|
- keyInfo.YouTube_KEY.data = jObject["youtubekey"].Value<string>();
|
|
|
|
- keyInfo.ACASKey_Data.data = jObject["acaskey_data"].Value<string>();
|
|
|
|
- keyInfo.ACASKey_Tool.data = jObject["acaskey_tool"].Value<string>();
|
|
|
|
- keyInfo.DAK.data = jObject["dak"].Value<string>();
|
|
|
|
- keyInfo.FVP.data = jObject["FVP"].Value<string>();
|
|
|
|
|
|
+ keyInfo.DID.data = GetJsonValue(jObject["did"]);
|
|
|
|
+ keyInfo.Mac.data = GetJsonValue(jObject["mac"]);
|
|
|
|
+ keyInfo.HDCP.data = GetJsonValue(jObject["hdcp"]);
|
|
|
|
+ keyInfo.HDCP22.data = GetJsonValue(jObject["hdcp22"]);
|
|
|
|
+ keyInfo.WiDi.data = GetJsonValue(jObject["widi"]);
|
|
|
|
+ keyInfo.Widevine.data = GetJsonValue(jObject["widevine"]);
|
|
|
|
+ keyInfo.ESN.data = GetJsonValue(jObject["esn"]);
|
|
|
|
+ keyInfo.CI_plus.data = GetJsonValue(jObject["cikey"]);
|
|
|
|
+ keyInfo.MGK.data = GetJsonValue(jObject["mgk"]);
|
|
|
|
+ keyInfo.Attestation.data = GetJsonValue(jObject["attestation"]);
|
|
|
|
+ keyInfo.Fairplay.data = GetJsonValue(jObject["fairplay"]);
|
|
|
|
+ keyInfo.ECP.data = GetJsonValue(jObject["ecp"]);
|
|
|
|
+ keyInfo.WiFi_MAC.data = GetJsonValue(jObject["wifimac"]);
|
|
|
|
+ keyInfo.BT_MAC.data = GetJsonValue(jObject["btmac"]);
|
|
|
|
+ keyInfo.LEK.data = GetJsonValue(jObject["lek"]);
|
|
|
|
+ keyInfo.PEK.data = GetJsonValue(jObject["pek"]);
|
|
|
|
+ keyInfo.Playready.data = GetJsonValue(jObject["playready"]);
|
|
|
|
+ keyInfo.Hashkey.data = GetJsonValue(jObject["hash"]);
|
|
|
|
+ keyInfo.YouTube_KEY.data = GetJsonValue(jObject["youtubekey"]);
|
|
|
|
+ keyInfo.ACASKey_Data.data = GetJsonValue(jObject["acaskey_data"]);
|
|
|
|
+ keyInfo.ACASKey_Tool.data = GetJsonValue(jObject["acaskey_tool"]);
|
|
|
|
+ keyInfo.DAK.data = GetJsonValue(jObject["dak"]);
|
|
|
|
+ keyInfo.FVP.data = GetJsonValue(jObject["FVP"]);
|
|
|
|
|
|
WriteDID.Checked = (keyInfo.DID.Length > 0 && m_writedid.Text != LResource.Skip);
|
|
WriteDID.Checked = (keyInfo.DID.Length > 0 && m_writedid.Text != LResource.Skip);
|
|
if (WriteDID.Checked)
|
|
if (WriteDID.Checked)
|