The Checks Editor lets you add, edit, and remove Checks in the Dotfuscator Config Editor.
Use this editor when you want to configure runtime protection features directly in the Dotfuscator configuration file instead of configuring them in source code with Check attributes.
Checks Table
The Checks table lists the Checks configured in the current Dotfuscator configuration file. It also lists Checks configured in the application source code with Check attributes.
The table includes the following columns:
| Column | Description |
|---|---|
| First column | Displays icons when Checks are defined in source code with Check attributes. |
| Check Type | Shows the type of Check, such as Debugging Check, Tamper Check, Shelf Life Check, or Root Check. |
| Description | Shows the locations in the input assemblies where the Check is configured. |
Method signatures in the Description column may be abbreviated. If a Check has more than one location, the column displays only the common namespace. To see the full method signatures, view the tooltip for the Check description.
Add a Check
To add a Check to the configuration file:
- In the Checks Editor, select the button for the Check type you want to add:
- Add Debugging Check...
- Add Tamper Check...
- Add Shelf Life Check...
- Add Root Check...
- In the grid on the left side of the editor, configure the Check properties.
- In the code tree on the right side of the editor, select the locations in the input assemblies where you want to inject the Check.
- Select OK.
A new row displays in the Checks table for the Check.
Edit a Check
To edit a Check:
- Select the Check in the Checks table.
- Select Edit.
- Update the Check properties or locations.
- Select OK.
Remove a Check
To remove a Check from the configuration file:
- Select the Check in the Checks table.
- Select Remove.
This removes the Check from the configuration file.
Work with Checks Defined in Source Code
The Checks table can display Checks that are defined in source code with Check attributes.
When a Check is defined in source code, the Checks table uses icons in the first column to show how that Check is configured:
| Icon state | Meaning |
|---|---|
| No icon | The Check was added in the Config Editor and does not override a Check defined in source code. |
| Source-code Check icon | The Check is fully specified in source code. |
| Override icon | A Check in the configuration file overrides at least one Check defined in source code. |
A Check defined in source code can be overridden by a Check in the configuration file. Dotfuscator then ignores the source-code Check and uses the Check configured in the Config Editor instead.
This can happen in either of the following cases:
- You edit the properties of a source-code Check in the Config Editor.
- You add a location to a source-code Check in the Config Editor.
- You add a location to a config Check, and that location already has a source-code Check with the same Check type.
Because Dotfuscator cannot modify source code, changing a source-code Check in the Config Editor creates a config Check with the updated values or additional locations.
If you remove a config Check that overrides a source-code Check, the source-code Check takes effect again.
Edit Check Properties
Check properties define how the Check operates and reacts.
Most property fields accept one of the following values:
- Free text, usually for string properties
- A value from a drop-down list
- A date selected from a date picker
Some properties display a ... icon. Select this icon to open an additional editor for the property.
Owner Type Selection Dialog
An Owner property specifies a type in the application. For example, ApplicationNotificationSinkOwner specifies the type that declares an Application Notification sink.
To select the owner type, select the ... icon for the Owner property.
Browse Dialog
For Shelf Life Checks, you can select the ... icon for the ActivationKeyFile property to browse for a Shelf Life Activation Key.
You can also use this dialog to browse for a PrivateKeyFile.
Disable Checks
You can disable Checks in the Feature subsection of Settings Tab > Options in the Dotfuscator Config Editor.
The Disable Checks option works as a master switch for the Checks feature.
| Disable Checks value | Behavior |
|---|---|
| No | Dotfuscator injects Checks according to the Check settings configured in Dotfuscator and any Check attributes contained in the input assemblies. |
| Yes | Dotfuscator does not inject Checks of any kind. |
Even when Checks are disabled, Dotfuscator still honors each input assembly’s Strip Check Attributes option.
Assembly-level Check Options
Dotfuscator lets you control how Check attributes are handled for each input assembly.
These settings are available at the assembly level.
Honor Check Attributes
Set Honor Check Attributes to True to have Dotfuscator process Check attributes and inject the corresponding Checks.
Set Honor Check Attributes to False to have Dotfuscator ignore Check attributes.
This option is enabled by default.
Setting this option to False can be useful for testing scenarios or advanced scenarios where assemblies are processed by Dotfuscator multiple times.
Strip Check Attributes
Set Strip Check Attributes to True to have Dotfuscator remove Check attributes from the protected output assembly.
Set Strip Check Attributes to False to leave the Check attributes in the protected output assembly.
This option is enabled by default.
Setting this option to False can be useful for testing scenarios or advanced scenarios where assemblies are processed by Dotfuscator multiple times.
Honor and Strip Check Attributes Combinations
| Honor Check Attributes | Strip Check Attributes | Result |
|---|---|---|
| True | True | Default settings. Dotfuscator injects Checks based on attributes declared in the assembly and removes the attributes from the output assembly. |
| False | True | Dotfuscator does not inject Checks based on attributes declared in the assembly and removes the attributes from the output assembly. This is useful for creating test builds that do not include Checks functionality. |
| True | False | Dotfuscator injects Checks based on attributes declared in the assembly and leaves the attributes in the output assembly. This combination is not recommended. |
| False | False | Dotfuscator does not inject Checks based on attributes declared in the assembly and leaves the attributes in the output assembly. This is useful for assemblies that need to be obfuscated but need to have Checks added in a later step. |