How to edit .jar file in Android Studio

13,629

Jar files are compressed archives (zipped files) of .class files( and few other resources). .class files are compiled .java files. You can not edit a compiled file in normal situation unless you decompile to get source code, edit the code and recompile again.

Decompiling is a tedious process, thus getting a source code is the best option here.

Note: You can rename the .jar file to a .zip file and can open it using any compression tool such as winrar or winzip to see the content.

Share:
13,629

Related videos on Youtube

Taylor Courtney
Author by

Taylor Courtney

College student with high aspirations. Currently write Android apps and server side php programs with MySQL databases for Pillo. Follow me on Twitter @TaylorRCourtne.

Updated on June 04, 2022

Comments

  • Taylor Courtney
    Taylor Courtney almost 2 years

    How can I edit code in a .class file in a .jar file using Android Studio? I have already tried to edit it of course. The class I am trying to edit is a read only for some reason.

    • Flatlineato
      Flatlineato about 9 years
      I'm not a java expert but jar file is a package of compiled code. You can't edit jar file. You mast find source of the class or decompile jar file end recreate it.
    • Taylor Courtney
      Taylor Courtney about 9 years
      This doesn't relate... Read the question.