How to remove class file in .jar file and change it with my own implementation [duplicate] How to remove class file in .jar file and change it with my own implementation [duplicate] android android

How to remove class file in .jar file and change it with my own implementation [duplicate]


There are multiple ways to do this:

  1. Try to use winrar. You can open your jar in it, explore the directory containing the class file. You can delete and add class files.

  2. If you don't want to use winrar then do like this:

Extract the jar using this command

jar -xvf yourjar.jar

It will explode the jar. Delete the old class file and add your updated class file

Recreate the jar using the following command

jar -cvf yourjar.jar directoryofexploderjar/


  1. Extend class and rewrite method removing bug

  2. Use JDEC to decompile and replace class ( http://jdec.sourceforge.net/ )


Write your own class in the same package as the original one, make sure your classes are before the 3-rd party jar on the java classpath. This way you will override the original version, class loader will load your class.