Extract code from .aar file Android Extract code from .aar file Android android android

Extract code from .aar file Android


Just follow the steps to extract code from .aar fileEx: libraryproject.aar

1.Rename the library file extension to ".jar" ex.libraryproject.jar

2.Extract the file in a folder.

3.Folder will have AndroidManifest,resources and library files used in the android library project.

4.Folder also have classes.jar file which will have all the classes in the library.

5.To open classes.jar file use jd-gui tool.

6.In jd-gui tool File ->Open File->browse and select classes.jar file.

Late, but will help new viewers.


In android studio, open the Project Files view.

enter image description here

Find the .aar file and double click, choose "arhcive" from the 'open with' list that pops up. This will open a window in android studio with all the files, including the classes, manifest, etc.


.aar file has zip format, but it contains compiled code of the module only. If your .aar includes JNI, it will be in form of a shared library. You can use it as a prebuilt shared library as long as you can keep it unchanged. You cannot decompile it as easily as the .class files.