我有一个 C# 解决方案,其中包含两个项目,一个是主应用程序,另一个是许可证项目。项目进展顺利。我已经使用 json 序列化许可证详细信息。现在我需要对我的许可项目进行混淆,以使其免受欺诈或黑客的侵害。我已用于Dotfuscator
混淆目的。我已经使用下面的行来反序列化应用程序收到的许可证详细信息。
xmlDocument.LoadXml(xml);
details = xmlDocument.SelectSingleNode("/license/details");
licenseDetails = JsonConvert.DeserializeObject<LicenseDetails>(details.InnerText);
此行在混淆后返回未知对象I
,但在混淆之前它运行良好。
混淆前的返回值
licenseDetails == Shared.Licensing.Client.LicenseDetails
混淆后的返回值
licenseDetails = I
我的 XML 文件是
<?xml version="1.0" encoding="utf-8"?>
<license>
<details>{"Product":"Outlook Templates","ProductVersion":"1.0.0.0","Username":"Demo","Serial":"1fKxUCJylsm+qVUccjUn8gYNVgDc4pE5OuqYs48vkaQ=","RegistrationDate":"\/Date(1326202832909+0200)\/","ExpirationDate":"\/Date(1330387200000)\/","PayloadEntries":[{"ValueType":2,"EntryName":"MaxNumProviders","Operation":1,"EntryValue":"3"},{"ValueType":2,"EntryName":"MaxNumQuick","Operation":1,"EntryValue":"5"},{"ValueType":2,"EntryName":"ExpirationDaysOffset","Operation":1,"EntryValue":"30"}]}</details>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>c/BK0YOhnW8cXUGxTJx3mpWQj1U=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>gWYcpr3OBhUoiPEFyWskgoRcDw5rO2RWNbMulXSXg2tsKWebEFqgptCUfr7JRvvSjm4kALyvU7mZviJI/peJWmJC69gs7QDMEOWLvrOa0TL1qyO5K5onCBZopJUdrPE0PJCVYRacasI3DvTOSo+IDEOSFVpEWZNcERhB6ZkOFrU=</SignatureValue>
</Signature>
</license>
我不知道在混淆过程中出了什么问题。