Note: The directory names are conventional so they could be any name. Additionally, the contents of each directory could be spread across multiple folders.
Mandatory:
.apk
file. This is required to install or update the app on an Android
device.Optionals:
.jar
and/or Android .aar archive files mostly for the
compilation phase..so
and/or static .a library files.An APK is essentially a ZIP archive with an .apk
extension.
While only AndroidManifest.xml and
META-INF are mandatory, an APK almost always includes
the following files and directories:
CERT.SF
and CERT.RSA signature files, as well as the
MANIFEST.MF manifest file.res/values.apk file.Note: An APK may contain further files and folders.
Awesome resource written by Michael Zent.
📁 res (without res/values) and
🗎 AndroidManifest.xml are compiled (aapt [compile]
tool)
🗎 R.java, 🗎 resources.asrc,
📁 res (compiled), 🗎 AndroidManifest.xml
(compiled)📁 java, 📁 libs,
🗎 R.java, 🗎 android.jar are compiled (java
compiler [e.g. javac] and/or kotlin compiler [e.g. kotlinc])
-> Java bytecode (.class) files. These are
then compiled/converted (d8 tool)
.dex) file/sNative code is embedded as dynamic shared libraries called
Shared Object (.so)
All the output are packaged (aapt [link] tool)
zipalign and apksigner to sign the APK and make it installable and updatable on an Android device.