There are a number of obfuscation tools for .NET code available on the market, as can be seen on the MSDN C# Programming Tools page, for example. In order to successfully obfuscate yFiles WPF-based applications, a suitable tool needs to meet the following requirements:
The yFiles WPF diagramming library has been prepared so that obfuscation tools that lack support for generic types and methods, which are used intensively throughout the library, should work as well. Specifically, this includes Dotfuscator Community Edition that comes bundled with Visual Studio 2010.
Dotfuscator Professional Edition, in contrast, provides dedicated support for generic types and methods and thus presents the better choice when obfuscating a yFiles WPF-based application, especially when the application itself also uses generic types and methods.
When obfuscating a yFiles WPF-based application using a member of the Dotfuscator product family, for example, a sample XML configuration file to obfuscate the yFiles WPF part would look like that shown in Example A.3, “A sample Dotfuscator configuration file”.
During the obfuscation process, Dotfuscator may emit a warning that the yFiles WPF DLLs "appear to be already obfuscated." This warning is perfectly alright, it refers to the private and internal parts of the API that are already name-obfuscated as a factory default. See also the section called “Obfuscation Requirements”.
Example A.3. A sample Dotfuscator configuration file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE dotfuscator
SYSTEM "http://www.preemptive.com/dotfuscator/dtd/dotfuscator_v2.1.dtd">
<dotfuscator version="2.1">
<!-- Input: yFiles WPF assemblies, application executable. -->
<input>
<asmlist>
<inputassembly>
<option>honoroas</option>
<option>stripoa</option>
<file dir=".\build" name="myApplication.exe" />
</inputassembly>
<!-- From the following list of yFiles WPF assemblies only those that
are actually part of the licensed distribution need to be
included. -->
<inputassembly>
<option>honoroas</option><!-- Required. -->
<option>stripoa</option><!-- Optional. -->
<file dir=".\lib" name="yWorks.yFilesWPF.Algorithms.dll" />
</inputassembly>
<inputassembly>
<option>honoroas</option><!-- Required. -->
<option>stripoa</option><!-- Optional. -->
<file dir=".\lib" name="yWorks.yFilesWPF.Viewer.dll" />
</inputassembly>
<inputassembly>
<option>honoroas</option><!-- Required. -->
<option>stripoa</option><!-- Optional. -->
<file dir=".\lib" name="yWorks.yFilesWPF.Adapter.dll" />
</inputassembly>
</asmlist>
</input>
<output>
<file dir=".\dotfuscated-app" />
</output>
<tempdir>
<file dir="C:\Temp" />
</tempdir>
<renaming>
<option>keepnamespace</option>
<option>enhancedOI</option>
<excludelist>
<type name="myCompany[\.]myApplication[\.].*" regex="true">
<method name=".*" regex="true" />
<field name=".*" regex="true" />
</type>
</excludelist>
<mapping>
<mapoutput overwrite="true">
<file dir=".\" name="dotfuscation-myApplication-map.xml" />
</mapoutput>
</mapping>
</renaming>
</dotfuscator>
|
Copyright ©2008-2011, yWorks GmbH. All rights reserved. |