To sum up the relevant information, let me quote from the Q&A eldarerathis linked above (all credits go to him, as this is from his answer there):
A .dex
file is basically a compiled bytecode version of an app that has been built for the Dalvik VM which Android's apps run on. I believe it is short for Dalvik Executable, but I'm not sure if I'm remembering that correctly.
An .odex
file is an Optimized .dex file (hence the 'o'), meaning that it has basically been pre-compiled for a specific platform. The advantage to this is that startup time is much faster since the VM doesn't have to perform any optimizing at startup/runtime. The disadvantages are 1) That it takes up some extra space and 2) An odexed app won't run properly if it's put onto another device, and it must have the associated .odex file to run at all.
When you install an app, Android will ananyze the .apk
and setup the device's Dalvik Cache with an optimized version of its code, so the app will start and run faster (after a factory-reset of your device, it does so for all pre-installed apps -- and after wiping the Dalvik cache, which is possible from the recovery menu with most CustomROMs, even for all user apps -- which is why the first boot takes so much longer than subsequent boots).
However, when an "odex" is found, it would simply be copied to the Dalvik Cache. As eldarerathis pointed out, the .odex
was built for specific hardware (reminds me of Assembly) -- so if that "specific hardware" is not the one used by the current device, you will certainly run into trouble.
Odex-MyCoolApp
? Or is there an entry for both the app and its .odex file? – Matthew Read Jul 23 '12 at 17:51