B4J Question JAR vs Exe

MarcRB

Active Member
Licensed User
Longtime User
Hello,

I will start using B4J for a commercial project. Because I believe in de future of B4J. Good work from Erel and his team. But......Someone told me:

"a .jar is a bad choiche for a commercial application, because it is very easy to de-compile it. The brainworks will be available for other developers who can copy your code into thier 'look a like' of your project. "
Is this true? Is it realy simple to de-compile to human readable sourcecode?

Are there other con's & pro's for jar vs exe?

Best regards,
Marc
 
Last edited:

warwound

Expert
Licensed User
Longtime User
FYI.

Download JDGUI and load your b4j .jar file.
See how it contains all of your source code?

And JDGUI offers an 'export as java file' option so you can turn your compiled .jar file back into the original .java classes.
That's how easy it is to decompile/reverse engineer a .jar file.

Similar methods can be used to decompile/reverse engineer an android .apk file.

I've not wrapped a .jar file into an .exe file yet but suspect that the .exe file is just a self extracting .zip file.
If that's correct then you could probably open the .exe file with WinZIP or WinRAR, extract the .jar and use JDGUI.

Martin.
 
Upvote 0

MarcRB

Active Member
Licensed User
Longtime User
@Warwound:
Thanks for the download link
I tried it and indeed it is simple to see the sourcecode. Bad new's for commercial projects.

@Erel:

It would be great to have the obfuscation implented in B4J. Is this a hot-item on your wishlist?
Can it be expected in the near future (next release) or does it have a lower priority?


Thanks to both of you.
Are there other pro's & con's for .jar vs .exe files?

Marc
 
Upvote 0

MarcRB

Active Member
Licensed User
Longtime User
I search in google for obfuscation jar files and found this
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or higher, or for Java Micro Edition.
 
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
jar
pro's
1.run under JVM, it's cross-platform supported
2.most B4J non-ui codes can be shared with B4A. B4J can build powerful web server and apps.

con's
1.each jar runs under a new JVM with the same thread name Java.exe thread. Need manually check if it is already running, and it's not difficult per Erel's workarounds.
2.JVM needs extra RAM on each thread. This is only an issue for very old computers.
3.Suface rt doesn't support Java
4.Some known bugs :JavaFx webview crashes sometimes.

Obfuscation is important for protection.

bz
 
Upvote 0
Top