JavaPackager icon indicating copy to clipboard operation
JavaPackager copied to clipboard

How to address the security issues with the exe generated by javapackager?

Open yok10056 opened this issue 2 years ago • 6 comments

Can he use ProGuard together with it? Currently, the generated exe is easily cracked by others, which is fatal for desktop applications.

yok10056 avatar Jun 01 '23 14:06 yok10056

hi @yok10056!

Yeah, good point!! I think you can set runnableJar option to point to your own obfuscated/minified JAR file. You also can bundle your own minified JRE using the jrePath option.

Maybe we can add a new feature to JavaPackager, so it automatically process JARS/MODS with ProGuard after generating those artifacts. It wouldn't be a bad idea.

I know there's an "official" ProGuardTask for Gradle and maybe we can use proguard-maven-plugin for Maven. This task could be done after generating the app and before generating installers/zipballs/tarballs.

fvarrui avatar Jun 01 '23 20:06 fvarrui

How is the usage of runnableJar?

yok10056 avatar Jun 04 '23 17:06 yok10056

You can build your own obfuscated JAR and set it in runnableJar property. See https://github.com/fvarrui/JavaPackager#plugin-configuration-properties and https://github.com/fvarrui/JavaPackager/blob/master/docs/maven/plugin-configuration-samples.md#bundle-your-own-fat-jar

fvarrui avatar Jun 06 '23 10:06 fvarrui

This issue is related to #334

fvarrui avatar Jun 06 '23 10:06 fvarrui

Hi @yok10056! Any news?

fvarrui avatar Jun 28 '23 00:06 fvarrui

You can refer to this demo. Although it is not perfect, it can achieve the effect of obfuscating the JAR package. It is hoped that javapackager can natively support obfuscation and encryption. https://gitee.com/12581/proguard-javapackager-gradle-demo

workcheng avatar Mar 13 '24 07:03 workcheng