Creating Time-Limited (Trial) Java Applications with Stringer Java Obfuscator

Using 2.1.5 (and higher) version of Stringer Java Obfuscator you might easilly create time-limited/trial versions of your applications/libraries. This approach also works for subscriptions.

How does it work?

A new parameter has been added in 2.1.5 version of Stringer Java Obfuscator - trialExpirationTime. Its value points to the end of working period of an application. By default, the value is to be set in seconds (unix time/Epoch), but you could use a date pattern via trialExpirationTimePattern parameter (syntax is similar to SimpleDateFormat class).

Here is an example of using the option in CLI:

    java -jar stringer.jar -configFile mycfg.xml -trialExpirationTimestamp 1462359651 original.jar trial.jar

Example for Ant:

        <stringer srcFile="${dist}/HelloWorld.jar"

Example for Maven:



  1. In order to check that the expiration time is set correctly, please find a line in verbose log that looks like: trialExpirationTimestamp: 1462359651(05/04/2016 @ 11:00am (UTC))

  2. Stringer Java Obfuscator should be set to protect your application with use of String Encryption (at least). We strongly recommend to use Integrity Protection, as well.

  3. Using Maven/Ant you might easilly generate a needed timestamp, and then use it to protect your applications, thus you have right trial/subscription versions for your customers.

Here is a task for Ant:

    <format property="trial.period.ts" pattern="yyyyMMdd" offset="+1" unit="month"/>

This task creates trial.period.ts property with the value of +1 month from the current date.

For Maven you could use nl.fizzit.maven.plugins:maven-tstamp-plugin:


Do not forget that those tasks should be performed before calling Stringer Java Obfuscator.

In the next part we will tell you how to make a zero-cost licensing mechanism with use of Stringer Java Obfuscator and a few dozens of lines of Java code.

Stay tuned!