Smart Obfuscation automatically identifies common application patterns and applies protection rules that help preserve application functionality.
Many frameworks and technologies rely on code elements that are accessed dynamically at runtime. Because these dependencies are not always visible through normal static references, obfuscation features such as Renaming or Removal can sometimes affect application behavior.
Smart Obfuscation uses static analysis to identify known usage patterns and automatically adjusts protection settings when necessary. This reduces the need for manual exclusions and helps prevent common compatibility issues.
Smart Obfuscation is enabled by default and is recommended for most applications.
Why Smart Obfuscation Is Needed
Some application behaviors cannot be identified using simple exclusion rules.
For example, consider an enumeration value that is converted to a string using the ToString() method.
Status.Pending.ToString()If the resulting string value is used elsewhere in the application, renaming the enumeration member could change the application's behavior.
Because this dependency is determined by how the code is used rather than by its name or location, it cannot be reliably identified through traditional exclusion rules.
Smart Obfuscation recognizes scenarios like this and automatically applies the appropriate protection settings.
Supported Technologies and Patterns
Smart Obfuscation recognizes a variety of common frameworks, technologies, and coding patterns, including:
- Windows Presentation Foundation (WPF)
- Windows Communication Foundation (WCF)
- Windows Workflow
- Windows Cardspace
- Data-bound Windows Forms controls
- Enumerated type values used as strings
- Late calls in VB applications
- Custom Serialization
- Web Services
Additional technologies and patterns may also be recognized.
How Smart Obfuscation Works
Smart Obfuscation analyzes assemblies during processing and identifies code elements that may require special handling.
Depending on what it discovers, Smart Obfuscation may:
- Exclude elements from Renaming.
- Exclude elements from Removal.
- Identify Removal entry points.
- Generate warnings when manual review is required.
- Generate notifications when actions are applied automatically.
These actions help preserve application functionality while maintaining the highest possible level of protection.
Notifications and Warnings
Smart Obfuscation reports its findings through notifications and warnings.
Notifications
A notification indicates that Smart Obfuscation identified a compatibility concern and automatically applied the appropriate action.
In most cases, no additional user action is required.
Warnings
A warning indicates that Smart Obfuscation detected a potential issue but could not determine the correct action automatically.
When this occurs, manual review is required.
For example:
FrameworkElementRule flagged something in Method
Namespace.ContextMenu::void OnApplyTemplate()
for the following reasons:
Examine possible name arguments to
System.Windows.FrameworkElement::FindName
and manually exclude the referenced elements.In this scenario:
- Locate the specified method.
- Review calls to
FindName. - Determine whether the referenced elements require exclusion from Renaming.
- Add exclusions if necessary.
Warnings should be reviewed before releasing a protected application.
When to Disable Smart Obfuscation
Smart Obfuscation is enabled by default and should generally remain enabled.
You may consider disabling it when:
- You want more aggressive obfuscation.
- You have verified that Smart Obfuscation exclusions are not required.
- You are troubleshooting a protection-related issue.
After disabling Smart Obfuscation, thoroughly test the protected application to verify correct functionality.
Smart Obfuscation Reports
Dotfuscator can generate a Smart Obfuscation report in XML format.
The report lists all items identified by Smart Obfuscation, including:
- The rule that identified the item.
- The affected code element.
- The action taken.
- The reason for the action.
- Whether the entry is a warning or a notification.
The contents of the report depend on the configured reporting verbosity.
Reporting Levels
| Level | Description |
| All | Reports notifications and warnings. |
| Warnings Only | Reports warnings only. |
| None | Suppresses reporting. |
Report Contents
Each report entry contains information about the affected code element, including:
- Item type (type, method, field, property, and so on)
- Full signature
- Rule name
- Action taken
- Explanation of the action
Additional conventions used in the report include:
| Convention | Description |
| Nested types | Parent and nested types are separated by /.
|
| Instance constructors | Displayed as .ctor. |
| Static constructors | Displayed as .cctor. |
Configuring Smart Obfuscation
Smart Obfuscation is enabled by default and should generally remain enabled.
You may choose to disable Smart Obfuscation if you have verified that more aggressive obfuscation does not affect application functionality.
You can also configure:
- Reporting verbosity
- Smart Obfuscation report generation
- Report output location
- Report overwrite behavior
These settings are available through the Config Editor and the Dotfuscator configuration file.
For detailed configuration instructions and reporting options, see The Smart Obfuscation Editor.