Reference
Command line
Every flag of the CLI, the environment variables it reads and its exit codes.
The CLI takes a configuration file and a few flags. Everything else is set in the configuration.
Usage
hashguard -config <config.json> [-input <in.jar>] [-output <out.jar>] [-libraries <paths>]
hashguard -licence-login [-licence-key <key>] Flags
| Flag | Value | Effect |
|---|---|---|
-config | path | The configuration file. Required for every run. |
-input | path | The jar to protect. Overrides input in the configuration. |
-output | path | The jar to write. Overrides output in the configuration. |
-libraries | paths | Library jars separated by the platform path separator (: on macOS and Linux, ; on Windows). Replaces libraries from the configuration. |
-licence-login | none | Stores a licence key in the operating system keyring and exits. Prompts for the key unless -licence-key is given. |
-licence-key | key | The key stored by -licence-login. |
The multi-slot flags -multislot, -outputdir and -keysoutput belong to the hardened runtime.
Environment variables
| Variable | Effect |
|---|---|
PLR_LICENCE_KEY | The licence key. Read before the keyring; use it in CI and on headless machines. |
Exit codes
| Code | Meaning |
|---|---|
0 | The protected jar was written. |
1 | The licence was rejected, or the run reported errors. |
2 | Invalid invocation: no -config, or missing values for the flags used. |
Examples
Protect the jar named in the configuration:
hashguard -config obfuscator-config.json Reuse one configuration for several jars:
hashguard -config obfuscator-config.json -input build/libs/core.jar -output dist/core.jar
hashguard -config obfuscator-config.json -input build/libs/tools.jar -output dist/tools.jar Store the licence key on a workstation:
hashguard -licence-login