Encrypt java program to prevent decompilation

Program brief

Using Virbox Protector Java Edition, you can directly drag the folder containing the jar package into the protection tool, and click the protection to select the item. After the protection, the encrypted jar package and the sjt file of the corresponding system will be generated.


sjt file introduction

sjt_windows_x86.dll: If the java version is Windows 32-bit, configure this dll in the Windows environment.

sjt_windows_x64.dll: If the java version is Windows 64 bit, configure this dll in the Windows environment.

sjt_linux_x86.so: If the java version is Linux 32-bit, configure this so file in the Linux environment.

sjt_linux_x64.so: If the java version is Linux 64-bit, configure this so file in the Linux environment.

sjt_linux_a32.so: If the java version is Arm Linux 32-bit, configure this so file to the ARM Linux environment.

sjt_linux_a64.so: If the java version is Arm Linux 64-bit, configure this so file to the ARM Linux environment.

1. Prepare tools

Put the jar package to be encrypted in a folder.

vbp-java-step1.png

2. Add directory

Drag the directory containing the jar package into the tool and set the password in the encryption option

vbp-java-step2.png

Encryption options-password settings

  • If the password is not set, the default password will be random.

  • It is recommended to set a password and keep in mind that when you update the jar package later, fill in this password when re-encrypting, you do not need to change the configuration sjt library.

3. Click Protect

Click [Protect selected items], after successful protection, a directory will be regenerated: ssp.java program, which contains the encrypted jar package and sjt file.

vbp-java-step3.png


vbp-java-step3-2.png

4. Run the encrypted jar

Run the encrypted jar package in two ways. 1. Add the sjt library file to the system environment variable; 2. Specify the sjt file directory when running the jar package.

Windows system

Add to system environment variables

1) You can store the sjt file in a fixed directory, and add sjt_windows_x64.dll or sjt_windows_x86.dll to the system environment variable.

Process of setting environment variables

My Computer-Properties-Advanced System Settings-Environment Variables-System Variables, new variable name JAVA_TOOL_OPTIONS, variable value-agentpath:C:\Users\test\Desktop\sjt\sjt_windows_x64.dll

vbp-java-step4.png

2) After configuring the environment, run the jar package directly or call the jar package directly.

Remarks

If the Java version is 64-bit, specify sjt_windows_x64.dll, if the Java version is 32-bit, use sjt_windows_x86.dll.

Linux system

Add to system environment variables

1) Add JAVA_TOOL_OPTIONS= -agentpath:/home/sense/Desktop/sjt_so/sjt_linux_x86.so  to the /etc/profile environment variable

vbp-java-step4-2.png

2) Enter the command source /etc/profile to make the modified file effective.

3) After configuring the environment, run the jar package directly or call the jar package directly.


Guess you like

Origin blog.51cto.com/senseshield/2542483