PreEmptive Protection - Dotfuscator
Community Edition User Guide

Shelf Life Check

With the Shelf Life Check, Dotfuscator injects code that detects if the application is being run after a specified expiration date.

A Shelf Life Activation Key is required to use this feature.

Configuration

Shelf Life Checks can be added to your code by following the Check configuration instructions, using the InsertShelfLifeAttribute in step 2.

In the output assemblies, whenever a method that was annotated with InsertShelfLifeAttribute is called, the injected code will first check if the current date is after the configured expiration date. If the Check detects the application is expired, it will transmit Check Telemetry and exit the application, if these are configured.

Supported Application Types

Dotfuscator Community Edition (Dotfuscator CE) can inject Shelf Life Checks into all .NET assemblies except for the following:

  • Managed C++ assemblies containing native and managed code
  • Multi-module assemblies
  • Silverlight assemblies
  • Windows Phone assemblies
  • WinRT assemblies
  • Xamarin assemblies

Shelf Life Activation Keys

A Shelf Life Activation Key is a data file that is required to inject Shelf Life Checks (and Sign-of-Life messaging). To obtain a Shelf Life Activation Key, contact PreEmptive Solutions. PreEmptive will issue you a Shelf Life Activation Key for use with Dotfuscator CE.

Expiration Date

The expiration date for a Shelf Life Check is specified as a string, in one of two formats:

  • For an absolute date, a date in the form "YYYY-MM-DD".

  • For a relative date, an integer indicating the number of days beyond the Dotfuscator build that the expiration should occur.

For instance, if the build is done on August 1, 2016, and the expiration should be on August 31, 2016, the Expiration Date can be written either "2016-08-31" or "30".

Exit Behavior

Shelf Life Checks do not support Actions. A configuration equivalent to the use of an "Exit" Action can be done by setting the ExpirationNotificationSinkElement property of the InsertShelfLifeAttribute to "DefaultAction".

When a Shelf Life Check with this configuration detects expired application usage, it will cause the application to exit immediately with exit code 0.

Testing

To test how the Shelf Life Checks injected into your application react to expired application usage, the simplest method is to temporarily configure the Checks with an expiration date in the past. Once you have tested that the application acts as it should when it is expired, you will need to change the expiration date back to the intended date before building the project for distribution.

Dotfuscator Version 5.30.0.5167. Copyright © 2017 PreEmptive Solutions, LLC