Extract code from .aar file Android

How do I extract code from aar file.[Accidentally my main project is on another system can't access only have aar file on my mail]

I need to extract the JNI code from aar file. I tried to change the extension to .jar but its extract .class only, Do anybody know how to extract that aar thing.


Just follow the steps to extract code from .aar file Ex: 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.


Only two steps:

  1. Rename the library file extension to ".jar", like: lib.jar

  2. Extract the file in a folder with Winrar, Winzip, etc.


Just open preferences, search for plugins and search Android Bundle Support plugin in the search bar. You need to install this plugin to open .aar and .jar files. https://plugins.jetbrains.com/plugin/10310-android-bundle-support/