• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extracting code from a .jar file?  RSS feed

 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after converting my Project to .jar I gave it to a friend to test it and he told me that he could find the source code in something called the precompile or something like that
but I need to hide it completely so nobody can Extract it or see the source code,
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There is no reason to put the source code in the Jar file. And if done correctly, it should not be there.

Did you list the jar file to confirm that the source is not present?

Henry
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Or did you friend say "decompiler"? ....

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Or did you friend say "decompiler"? ....

Henry

I don't remember because it was on the phone the problem is he took a screenshot and showed me the code
and said I could Extract it.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Shalotut wrote:
I don't remember because it was on the phone the problem is he took a screenshot and showed me the code
and said I could Extract it.


Well, of the two problems, the first one is easy to fix -- and you should fix it. The second one is much harder to fix, and requires a discussion.

Regardless, it would be a good idea to figure out which problem it is...

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Ahmed Shalotut wrote:
I don't remember because it was on the phone the problem is he took a screenshot and showed me the code
and said I could Extract it.


Well, of the two problems, the first one is easy to fix -- and you should fix it. The second one is much harder to fix, and requires a discussion.

Regardless, it would be a good idea to figure out which problem it is...

Henry

Sure the main problem is it is  an Extractable file if I stop that sure he won't get the code but i don't know how
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Henry asked earlier, have you looked in the jar file yourself?
It's just a zip file with the extension changed, so you can open it easily enough and check yourself whether there are any .java files (ie the source code) in the jar file.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also, if there was a way to achieve what is wanted, without actually understanding (or caring) what the underlying issue is, don't you think that we would have mentioned that? ...

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:As Henry asked earlier, have you looked in the jar file yourself?
It's just a zip file with the extension changed, so you can open it easily enough and check yourself whether there are any .java files (ie the source code) in the jar file.

I didn't find that precompiled code but I don't like this to appear can make it unextractable?
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Also, if there was a way to achieve what is wanted, without actually understanding (or caring) what the underlying issue is, don't you think that we would have mentioned that? ...

Henry

didn't get what you are talking about.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Shalotut wrote:
I didn't find that precompiled code but I don't like this to appear can make it unextractable?


First, there is no such a thing as precompiled code with Java. You definitely misheard your friend on the phone.

Second, keep in mind that the JVM needs to extract the jar file too. Or else, it won't be able to run the jar file.... so, it isn't as simple as making the Jar file "unextractable". This is why we are trying to steer you into telling us what the underlying cause of the issue is -- which for some reason, you don't want to tell us.


Anyway... if you don't care, and only want to make it unextractable, I think there is a commercial product that will encrypt jar files, and with a classloader so that the JVM can extract it. I think I saw a reference of it mentioned on the ranch in the past.

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Ahmed Shalotut wrote:
I didn't find that precompiled code but I don't like this to appear can make it unextractable?


First, there is no such a thing as precompiled code with Java. You definitely misheard your friend on the phone.

Second, keep in mind that the JVM needs to extract the jar file too. Or else, it won't be able to run the jar file.... so, it isn't as simple as making the Jar file "unextractable". This is why we are trying to steer you into telling us what the underlying cause of the issue is -- which for some reason, you don't want to tell us.


Anyway... if you don't care, and only want to make it unextractable, I think there is a commercial product that will encrypt jar files, and with a classloader so that the JVM can extract it. I think I saw a reference to it mentioned on the ranch in the past.

Henry

didn't mean to hide the reason but simply I am going to sell the Project and I used some data structures like tree and graph to make it faster and don't want anybody to see how  I coded just for the privacy
this is the point
so you said it is possible and that won't disturb the JVM ? and please I want something to read about it a little if possible.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Shalotut wrote:
didn't mean to hide the reason but simply I am going to sell the Project and I used some data structures like tree and graph to make it faster and don't want anybody to see how  I coded just for the privacy


We didn't ask for the reason why you want this ... it is quite clear why anyone would want this.  What we ask for are for you to confirm the underlying issue -- which in turn, can make the solution ridiculously easy, or a bit hard to do.

Anyway, how about this?

Ahmed Shalotut wrote:
I don't remember because it was on the phone the problem is he took a screenshot and showed me the code
and said I could Extract it.


Can you show us the screenshot?


... OR ... can you run this command on your jar file? and show us the output?

jar -tvf  YOUR_JAR_FILE.jar

... and of course, use the name of your actual jar file.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!