1

We have decided to use the Dotfuscator to obfuscate our code. Ours is a Windows Phone application and we are using Dotfuscator Windows Phone Edition Version 4.9.7000.29303. We learnt that System.Reflection.ObfuscationAttribute class is not available in Silverlight, so it is not possible to use exclusion attributes on some types we need to exclude. We are now planning to use Rename>Exclude tab in dotfuscator and exclude types with some specific suffixes. Before implementation we created a trial project and tested obfuscation on it. We found in our testing that the output is not adhering to execution rules. Though the preview window is showing expected result but output still includes those types which should have been excluded. Please see the screen shot of the Dotfuscator window below. Preview window on the left hand side of the arrow is correctly displaying the shaded type which would be excluded from obfuscation, but on the right hand side of the arrow, output of the same still obfuscated those types. What is happening? Preview windows shows correct result but output is not ok

1 Answer 1

1

I don't entirely understand what you're trying to accomplish with the regular expression, but as far as using attributes to control obfuscation, there is a library you can include.

The library to include is typically in

C:\Program Files(x86)\PreEmptive Solutions\Dotfuscator (version and edition)\Attributes\Windows Phone\PreEmptive.ObfuscationAttributes.dll

Here is an example on how to exclude something from renaming for instance:

[Obfuscation(Feature = "renaming", Exclude = true)]
public int Foo{get;set;}

You can find more details about it controlling obfuscation with attributes at this link and the general users guide is available here

If you want to go the regex route instead, you can also look at the documentation for creating custom rules. You'll have to provide a bit more info for me to understand what you're trying to do for me to be able to help though. Given your screenshot, everything appears to be what I'd expect.

2
  • plz refer to screenshot again, in preview section Dotfuscator has grayed out App, MainPage, and testClass types on the basis of custom regex we supplied, meaning (as per the help documents), these types will be excluded from obfuscation. This is correct and we have no problem with the preview. But, see Output, the Dotfuscator still obfuscate, App, MainPage and testClass, which it should not as per preview. Can you please explain why this is expected? However, thank you so much for pointing towards PreEmptive's obfuscation attribute assembly, I think we can use it and avoid RegEx route.
    – amrahs
    Apr 5, 2013 at 2:58
  • @amrahs ahhh ok I see what you're meaning. You'll have to right click on your regex rule and then add that regex rule as a Method, Property, etc rule. What it was previously excluding was only the type name, not the entire type and all of it's members
    – Earlz
    Apr 5, 2013 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.