ConfuserEx icon indicating copy to clipboard operation
ConfuserEx copied to clipboard

Constants protection breaks Newtonsoft JSON serialization

Open kryzys69 opened this issue 5 years ago • 5 comments

Hi. I've found that even simplest JSON serialization causes error when I use constants protection. I use:

  • latest build of ConfuserEx 1.5
  • target .NET framework 4.5.2
  • latest Newtonsoft.Json from Nuget
using System;
using Newtonsoft.Json.Linq;

namespace ConfuserJsonTest
{
    class Program
    {
        private const string json = "{ \"a\":1, \"b\":2 }";
        static void Main(string[] args)
        {
            JObject jo = JObject.Parse(json);
            Console.Out.Write(jo.ToString());
            Console.ReadLine();
        }
    }
}

fragment of .crproj

<protection id="constants">
    <argument name="cfg" value="false" />
</protection>

I think it could be connected to #270

Please let me know if I can help in any way.

kryzys69 avatar Jan 08 '21 00:01 kryzys69

@kryzys69: It would be very helpful if you could verify if the issue persists with the build you can download here.

mkaring avatar Jan 08 '21 07:01 mkaring

With the provided build this simple example works. But I use newer build (640) and it doesn't work there. If it would be helpful, I can post a callstack.

kryzys69 avatar Jan 08 '21 09:01 kryzys69

The pull-request for that issue has not been merged yet, due to the lack of feedback in #270 I'll merge it later today, so it's present in the master branch.

mkaring avatar Jan 08 '21 09:01 mkaring

Thanks for the info, I just saw this in issue #273. Thanks again for looking into this and hope it wasn't a problem

kryzys69 avatar Jan 08 '21 09:01 kryzys69

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Feb 11 '21 04:02 github-actions[bot]