After some android
apps installed, I found that it will change to odex
file (not apk
) in smartphone. How does it happens? Who can teach me, I am very interested about it.
Its normally located in the Secure file system under apps,each app with have its icon and the odex file with the same name .
Stock Android implements an odex file structure, with odex meaning “optimized” dalvik executable file. As your likely aware, Android apps on your device are packaged as . apk files. That all being said, what this means is that for pretty much all of your apks there is a corresponding odex file.
odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process. By deodexing these APKs, a developer actually puts the . odex files back inside their respective APK packages.
The blog article is mostly right, but not complete. To have a full understanding of what an odex file does, you have to understand a little about how application files (APK) work.
Applications are basically glorified ZIP archives. The java code is stored in a file called classes.dex and this file is parsed by the Dalvik JVM and a cache of the processed classes.dex file is stored in the phone's Dalvik cache.
An odex is basically a pre-processed version of an application's classes.dex that is execution-ready for Dalvik. When an application is odexed, the classes.dex is removed from the APK archive and it does not write anything to the Dalvik cache. An application that is not odexed ends up with 2 copies of the classes.dex file--the packaged one in the APK, and the processed one in the Dalvik cache. It also takes a little longer to launch the first time since Dalvik has to extract and process the classes.dex file.
If you are building a custom ROM, it's a really good idea to odex both your framework JAR files and the stock apps in order to maximize the internal storage space for user-installed apps. If you want to theme, then simply deodex -> apply your theme -> reodex -> release.
To actually deodex, use small and baksmali:
https://github.com/JesusFreke/smali/wiki/DeodexInstructions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With