I don't want anyone extract my.jar file. I so obfuscated my code in my.jar but I want anyone can't extract it . I also know Jar_Signing don't help me. how?
Asked
Active
Viewed 1,953 times
2 Answers
8
Not possible. If nobody could extract it, how would the JVM be able to get the class files out?

dty
- 18,795
- 6
- 56
- 82
-
1thanks for your opinion but I want for example prevent my.jar from extraction by password(for sample) and set this password fro jvm in start. – Sam Jan 25 '12 at 10:40
-
Ah, well you didn't say that in the question. I don't believe this is possible. And even if it was you'd have to supply the password to everyone who wanted to run/use your JAR - at which point they could just extract it! – dty Jan 25 '12 at 10:44
-
@MJM: Then you would have to distribute the password along with your JAR - and again the user could extract the JAR as the password is available... – home Jan 25 '12 at 10:44
-
But then you woudn't have any improved security, because the password could still be read by anybody. – kufi Jan 25 '12 at 10:45
-
3If you can manage that, a hacker can hack a JRE. If you don't want people to steal your code, don't distribute it. But this is nonsense anyway, since 1) Nobody wants to steal your code. 2) Even if they wanted to 'steal' your idea, there are legal ways to do it without ever looking at code. – Andrew Thompson Jan 25 '12 at 10:45
-
@AndrewThompson: I don't distribute my code so anyone can't found my password. – Sam Jan 25 '12 at 10:57
-
1@MJM - If you distribute the JAR file containing the code, you are distributing the code. – Stephen C Dec 19 '12 at 08:05
0
You could try to rename the classes with \x0 as prefix and corrupt the CRC32 of your classes. CRC32 isnt getting checked by the jvm but once you try to extract you jar with standard tools it will prevent the extraction.

Princekin
- 43
- 4