Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Isn't there an official format specification of .apk?

I have seen some applications that reverse .apk files into elementary files. I would like to know where can I find the official specification of .apk files, but I reached nowhere! Could someone enlighten us about where to look, and what are the best resources about the specification if there is not a formal specification?

like image 363
Khaled Alshaya Avatar asked Jul 30 '11 00:07

Khaled Alshaya


1 Answers

I don't know if there's an official specification, but from browsing my app's file structure, I have deduced the following:

-The .apk is simply a zip file and can be opened as such in any suitable application (7zip, WinZip, WinRAR, any OS's default .zip tool).

-It must contain an AndroidManifest.xml file in the root directory (though this is a compiled .xml file and not human-readable).

-It must contain a classes.dex file containing the actual binary code compiled as Dalvik bytecode.

-It must contain a resources.arsc file. I believe it's an index of everything in the /res folder, but I'm not positive.

-It must contain a META-INF folder in the root containing CERT.RSA, CERT.SF, and MANIFEST.MF. These are the app's digital signature files.

-The app may contain the folders /assets, /res, and /raw that contain resource files like images and databases.

-The app may contain a /lib folder that contains folders for all the native code targets (like armeabi), which contain .so files (native code).

I probably missed a ton of things, but this should give you a good start.

like image 133
Shawn Walton Avatar answered May 11 '23 02:05

Shawn Walton