Jar File - Prevent Access to Source Code

前端 未结 10 1371
别那么骄傲
别那么骄傲 2021-01-19 16:40

I want to hand over a small Java app as a runnable jar but I do not want anybody to have access to my source code. Am I right in presuming that there is no source code (.jav

10条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-19 17:33

    Normally there isn't but you can use the jar -tvf command to check it.

    However I have to warn you that it's extremely easy to decompile most .class files into reasonably readable java source code.

    To avoid this, you'll have to use an obfuscator, but that needs some extra effort on your behalf. (E.g. RetroGuard.)

    Having said that, ask yourself the question: "Is my code really that valuable or special that I need to do all this?" Usually the answer is no, most of the code we write is nothing special.

提交回复
热议问题