ClassName Encryption

This feature is still in alpha stage, and only supports JavaSE App now.

The CLI Tool

There is a classname-encoder[.exe] in the Protecotor4J folder, that’s the tool performing ClassName Encryption. In order to run this tool, we need a configuration file first.

Configuration File

The template of the configuration is in the task-templates folder, the filename is classname-encryption.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
# the emaill address of your account
email: ''
# md5 of password
password: ''
jarsPath: []
# the classes to protect
classesToEncryptName: []
# the classes to exclude from encryption
protectInnerJars: false
exclude: []
outputFolder: ''
tempFolder: ''
stored: false

The account information

This feature is just valid for licensed user now, you need to fill your email address and the password in the configuration file.

jarsPath

The jarsPath field is an array, which you could specify one or multi jar files that need to be processed.

classesToEncryptName:

In this field, you can specify the classes that need to encrypt name. It can be a full class name, or wildcard- case ones, just like:

1
classesToProtect: [vlinx.test.TestClass1, vlinx.test.pack1.*, vlinx.test.pack1.**]

or

1
2
3
4
classesToProtect: 
- vlinx.test.TestClass1
- vlinx.test.pack1.*
- vlinx.test.pack1.**

* means all the classes in the package, but exclude the classes in the sub packages.

** means all the classes in the package including the classes in the sub packages.

protectInnerJars

If this value is true, the classes in the inner jars will be processed too.

exclude

In this field, you can specify the classes to exclude from encryption, the format is the same as classesToEncrypt field.

stored

If the app is spring-boot app, please set this value to true

Execute the encryption process

Please go to the Protector4J folder, the execute the command below

On Linux or macOS

1
./classname-encoder -t java -f path-of-task-file

On Windows

1
classname-encoder -t java -f path-of-task-file

-t task type

-f task file

You can execute classname-encoder --help to see the detail arguments.