PDA

View Full Version : [ubuntu] how can i editing .class java files ??



MBG1987
August 12th, 2009, 10:01 PM
I already have java program for mobile phones ,and i extracted it to .class files ,and i want to edit that files to get what i want ,how can i do that ??!

vegesm
August 12th, 2009, 10:06 PM
The class files are compiled java binaries. You can't edit them easily. If you want to edit the Java source code then you have to download the .java files.

slakkie
August 12th, 2009, 10:09 PM
Get a java decompiler like jad: http://en.wikipedia.org/wiki/JAD_%28JAva_Decompiler%29

Works really well, I've used it in the past. Only problem is that comments are lost and you get syntax like public function get_string(String a), instead of the usual logic var names. But it works.

Had to decompile my own project once after I deleted my own java files. Took me hours to get the comments back and usefull names, but at least my pc didn't eat my homework!

MBG1987
August 12th, 2009, 10:13 PM
If you want to edit the Java source code then you have to download the .java files.

tnx ,but what program do so ?

Skrynesaver
August 12th, 2009, 10:20 PM
If they are supplied as class files, you don't have the source, as a result you'll either have to run a java decompiler (http://www.faqs.org/docs/Linux-HOWTO/Java-Decompiler-HOWTO.htm) on the class file. As Slakkie said above, it's not perfect, but it will give you the logic back in java, after that you have to try and work out what it's at.

credobyte
August 12th, 2009, 11:15 PM
If you don't have it's source code ( .java ), decompiling and editing class files might be illegal ( not always ). As said above, reverse engineering is all you can do in this case ..

Defyinggravitygaming
July 6th, 2012, 12:14 AM
I already have java program for mobile phones ,and i extracted it to .class files ,and i want to edit that files to get what i want ,how can i do that ??!


U can install eclipse from the Ubuntu software center :D

lisati
July 6th, 2012, 12:26 AM
With that, this old thread can go back to sleep. A lot can change in three years!