not working as expected
net framework 4 confuserEX v 1.0.0
it does not work with below code and return nothing from Json !! although the code itself is working fine after normal compiling ...
JavaScriptSerializer Json = new JavaScriptSerializer(); Elements = Json.Deserialize<Elements>(JsonData);
There is a severe lack of details here.
Please specify what your settings for the obfuscation are. Please also add some more details regarding what Elements and JsonData contains. It would also help if you could provide me with the actual assembly you are trying to obfuscate for analysis.
In the mean time you can also try my fork of ConfuserEx. It contains lots of bug fixes. You find the latest version here: ConfuserEx - AppVeyor.
thanks for response
unfortunately, it doesn't work with new version too...
the setting of obfuscation is 'normal' without any additional option but generally it doesn't work with any config
the problem happened with the class below :
class Val { private string givenToken; private wholeTokenElement TokenElement;
public string accessToken;
public string expires;
public string expires_in;
public string email;
public string idToken;
public string userId;
public string displayName;
public string familyName;
public string givenName;
public string imageUrl;
public Val(string TheToken)
{
givenToken = TheToken;
GetWholeTokenElement(givenToken);
}
class wholeTokenElement
{
public string accessToken;
public string expires;
public string expires_in;
public string email;
public string idToken;
public string userId;
public string displayName;
public string familyName;
public string givenName;
public string imageUrl;
}
private void GetWholeTokenElement(string givenToken)
{
JavaScriptSerializer Json = new JavaScriptSerializer();
TokenElement = Json.Deserialize<wholeTokenElement>(givenToken);
accessToken = TokenElement.accessToken;
expires = TokenElement.expires;
expires_in = TokenElement.expires_in;
email = TokenElement.email;
idToken = TokenElement.idToken;
userId = TokenElement.userId;
displayName = TokenElement.displayName;
familyName = TokenElement.familyName;
givenName = TokenElement.givenName;
imageUrl = TokenElement.imageUrl;
}
}
when I gave it Json like below:
{'accessToken':'hfhffggfddhhdh','expires':1535545491,'expires_in':3597,'email':'[email protected]','idToken':'yytytytytytyytytyty','userId':'8776655','displayName':'JB','familyName':'JB','givenName':'JB','imageUrl':'http://WebPath.NET/File.Jpg'}
it just return nothing after obfuscating the code!!
thanks in advance
I guess the source of the problem is that you are referencing the private nested class as deserialization target. I'll look into that issue as soon as I can.
I separated the classes and the problem still exist... thanks in advance for your efforts
You are using the very old JSON serialisation that is part of .NET. The documentation suggests using Json.NET. Is that a option for you? Json.NET is properly supported by ConfuserEx.
I'll work on supporting the old serializer. But that may take some time.
used it, but it doesn't work also, the same issue!
@Json-WB don't select Renaming protection. It should work as expected (:
@XenocodeRCE I did not use this option at all!
@Json-WB Renaming is part of the "normal" preset. You can explicitly remove it by adding a new line in the configuration where you selected "normal". Choose "Remove" in the first combo box and "rename" in the second. That will disable the renaming.
The other alternative is add the attribute
[System.Reflection.Obfuscate(Exclude = false, Feature = "-rename")]
to the wholeTokenElement class or to every field in this class.
Wow, it's working with removing the rename from configuration but not working with attribute ... and after all this make ConfuserEx lose one of its feature !
You also have the [Serializable] attribute for JSON specific data ... not sure if ConfuserEx handle it
The [Serializable] attribute works. So does using JSON.net with explicit attributes that mark the names of the fields in the json file.