Solution Advice: More safety

Try our best to protect java program


Introduction

Jar2Exe has provided a way to protect java program, that is to encrypt and hide jar files into exe file. Those protected programs cannot be extracted by compress software.

But as a software, we always cannot say our program is 100% safe. So what we can do is to increase the difficulty and cost of crack. In this chapter, we will discuss some third-party tools to co-operate with Jar2Exe.


Solution

Before "jar file encryption" by Jar2Exe, we can select "symbol obfuscation" by ProGuard. And after exe file created by Jar2Exe, we can select "exe file encryption" by ASProtect, from StarForce company.

Obfuscation of ProGuard let your java program not readable, but some other one can access your program as a whole jar file. Encryption of Jar2Exe let your java program not accessible but still runnable. "Exe file encryption" of ASProtect let the whole exe file encrypted again, unable to trace.


Features used

Following features and third-party tools are selected in this solution:

Feature Advice Introduction How to enable

Obfuscation by
ProGuard

Recommended

Obfuscation by ProGuard let your java program not readable after de-compiled.

Download from ProGuard homepage

Encryption by
Jar2Exe

Recommended

Encryption by Jar2Exe let the whole jar file not accessible but still runnable.

At Jar2Exe Step 4, check the encrypt option

Self checksum
by Jar2Exe

Must be disabled

Self checksum let generated exe file refuse to run when it is modified. If you want to use "exe file encryption" by ASProtect , 'Self checksum' must be disabled, then the exe file can be re-encrypted.

This option is hidden and forced to be enabled when Jar2Exe is in trial period, only Activated Jar2Exe can disable this option.

Purchase and Activate Jar2Exe, then at Step 6, uncheck 'Self checksum'.

Exe encryption
by ASProtect

Recommended

Exe encryption let the exe file encrypted again, unable to trace or debug.

Download and purchase a ASProtect license


Steps with demo

The following steps will show obfuscation by ProGuard and jar file encryption by Jar2Exe and exe file encryption by ASProtect.

  1. The demo program is a simple calculator. ( Source code)
  2. Compile and pack into a jar file: SimpleCalc.jar. ( Jar file)
  3. Use ProGuard to obfuscate jar file:
    1. Download and install ProGuard from http://proguard.sourceforge.net/#downloads.html
    2. Launch ProGuard by clicking ProGuard\bin\proguardgui.bat
    3. At "Input/Output" step, click "Add input" to select SimpleCalc.jar, click "Add output" to set a "SimpleCalc_obfuscated.jar".
    4. As a demo, we keep all options as default value, click "Next" until finish, we get a new obfuscated jar file.
    5. Run obfuscated file, to verify the obfuscated file is still runnable. ( Obfuscated jar file)
  4. Encrypt obfuscated jar file into an exe file by Jar2Exe:
    1. Start Jar2Exe, at step 1, click Browse Jar and select SimpleCalc_obfuscated.jar
    2. At step 4, check the Encrypt and hide class files option.
    3. Please refer to other solutions for other options of Jar2Exe according to your program.
    4. At step 6, 'Self checksum' must be unchecked if you're going to encrypt it again by ASProtect
    5. Run generated exe file, to verify the generated file is runnable. ( Generated exe file by Jar2Exe)
  5. Encrypt generated exe file by ASProtect
    1. Open ASProtect download site http://www.asprotect.com/downloads.html
    2. We select to download and install ASProtect Free Trial in our demo.
    3. Launch ASProtect, at "Application info" tab, select "SimpleCalc_obfuscated.exe" as "File to protect", set "SimpleCalc_encrypted.exe" as Output.
    4. At "Options" tab, check "Resources protection", check "Anti-debugger"
    5. At "Protect" tab, click Go to do encryption
    6. The 'SimpleCalc_encrypted.exe" may NOT able to run because the "extra data" is corrupted.
  6. Fix Extra Data, the generated file of ASProtect may be NOT runnable, because "extra data" is corrupted, so we need to do a little fix.
    1. Download the little fix tool FixExtraData.exe
    2. Run FixExtraData.exe, use SimpleCalc_obfuscated.exe and SimpleCalc_encrypted.exe as arguments
      C:\> FixExtraData.exe SimpleCalc_obfuscated.exe SimpleCalc_encrypted.exe
    3. Then the SimpleCalc_encrypted.exe should be fixed and runnable.
  7. All these steps are a bit complex, if you failed, please contact support@jar2exe.com for help.

Download

Comments

Hi

Hi

I want to enable checksum and sign the exe later. But im unable to do so. Please suggest a method

Hi

Hi

I want to enable checksum and sign the exe later. But im unable to do so. Please suggest a method

Add new comment