3

I saw an application (forgot the name) on my cousin's Galaxy Mini while inside Link2SD app. It has the -Odex- text beside its name. It was the only application like that on Link2SD. I got curious so I asked him but apparently, he doesn't know either which is why I'm now turning to here, what exactly is an "odex" app?

Based on some googling, I got to the knowledge that it's some kind of broken down "thing" like its in separate pieces. They also talk about "deodexing" but they are always talking about roms and not apps. So as added question, how do I "deodex" that application? (I'm a bit OCD like that :P)

Propeller
  • 2,466
  • 18
  • 48
  • 66

1 Answers1

7

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.

Izzy
  • 91,166
  • 73
  • 343
  • 943