-1

I have a jar file name "mycode.jar". If I want to edit the code inside it is there any way to do it? Like in mycode.jar there is file name Demo.class. If I run this through JD GUI, I can only see the code of this Demo.class. So how can I edit this code.

  • 2
    Does this answer your question? [Changing the code of the class from jar file](https://stackoverflow.com/questions/11848161/changing-the-code-of-the-class-from-jar-file) – Gaurav Jeswani Nov 05 '20 at 12:28

1 Answers1

0
  • Extract the files using winrar or 7Zip
  • Make the desired chnages in the extracted files
  • Open the JAR file with WinRAR
  • Use the ADD button to replace the original file that you modified.

Now you have your class file. There is no easy way to edit class file, because class files are binaries (you won't find source code in there. maybe some strings, but not java code). To edit your class file you can use a tool like classeditor.

You have all the strings your class is using hard-coded in the class file. So if the only thing you would like to change is some strings you can do it without using classeditor.

nsola
  • 765
  • 6
  • 8