[COMPLETE GUIDE][IN-DEPTH] Difference between Odexed and De-Odexed Roms

Was this Guide Helpful for you?

  • Yes

    Votes: 19 95.0%
  • No

    Votes: 1 5.0%

  • Total voters
    20
Search This thread

adityab721

Senior Member
Jan 3, 2013
183
143
24
Mumbai
Many users or I'd rather say many 'Young Developing Developers' are often found looking for answers related to Odex and De-Odex Roms in several places (once upon a time even I was one of them!). Well, I cannot promise to answer everything, but if you’re trying to compare the difference between a odexed and deodexed ROM, you’ve come to the right place!

guidetoodexdeodex2.png

Explaining Odexed vs. Deodexed Android ROMs

You’re bound to have come across the term ‘deodexed’ if you’ve ever installed a custom firmware on your device, since almost all ROM developers choose to deodex their offerings. What this means for the average user, however, is a different story. To understand the concept, you’ll first need to grasp what odex files are, and why are the present in the OS in the first place.

Android (being based on Linux) uses application packages, or APKs, as they’re normally called, to tell the operating system what app to load and execute. If you’re at all familiar with Android, you’ll know that the OS works on the basis of partitions, out of which those apps that are contained in the /system partition are system apps (and cannot be changed or modified without having root level access, since they’re a part of the OS itself), while those contained within the /data partition are user apps and can be freely modified. The /system partition is the first one to load when the operating system boots up, hence giving priority to the apps contained within. It is with these apps that odex and deodex deal with.


What Are The Two Possibilities

Coming back to Android applications, there are two possible routes to follow, based on the fact that each app is comprised of an APK and a cache part that tells the Android Dalvik Virtual Machine (VM) what components does the app come with.

The cache for each APK is contained separately in a .odex file, which loads into the virtual machine at the time of boot, thus speeding up boot times. (Odexed)
The cache for each APK is contained within the APK itself as a classes.dex file, making the boot times slower as Dalvik VM is built up. (Deodexed)
Now, ideally, most OEMs choose to opt for the first route, for two major reasons. First, it makes modifying the system apps more difficult (thus making the OS more stable and secure), and two, faster load times for the OS itself, since the cache is built as part of the virtual machine itself. Confused? Allow me to explain.


Clearing Up the Confusion

In normal cases, where an Android firmware is odexed, the .odex files for each /system APK (which are stored outside of the APKs themselves) are written into the Dalvik Virtual Machine when the OS boots up. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster. Ultimately, for the user, it means that boot times are significantly sped up, and you can put your device to use much sooner.

As opposed to the above, in a deodexed (custom) ROM, there is no cache information within the Dalvik Virtual Machine at the time of boot, so when the system status up, it only gets to know which apps to load once the /system partition APKs are actively accessed. This, in effect, will result in a much longer boot time, since each APK will be processed one by one, and you will be able to use your device long after you’ve powered it up.


Deodex is Slower, Then Why Bother?

In real life, that’s not the case. With deodexed ROMs, only the first ever boot after clearing Dalvik cache is slower, and all subsequent ones will be the same as any odexed ROM. This is owing to the fact that during the first boot, all cache information is written to the virtual machine anyway, and hence, it will behave as any other firmware (until you clear the Dalvik cache once again).

Why ROM developers do it is because of the modification possibilities that it entails, especially theming. Since in a deodexed scenario, all the application code is contained within one single APK, the developer can simply modify the APKs values to apply any custom look and feel to the app itself, without breaking any functionality. This also opens up possibilities for changing different parameters of the app without affecting how others will operate. Since a dodexed package has no external dependencies, it gives more freedom to modify what they wish. On the other hand, with an odexed ROM, theming is absolutely impossible, since the .odex part of the application will always be in conflict.


The Bottom Line

It all boils down to this: while an odexed firmware is faster and more secure, a deodexed one gives more modification freedom, and is the only way possible to change the look and feel of system apps. In actual terms, deodexed ROMs are only slower in the first ever boot, after which they are the same speed as the former ones. Also, deodex doesn’t entail any serious security risks to your device, either, and you can rest assured that the millions of users opting for these aren’t suffering.


So what would be my preference?

If you are a guy like me who is always tweaking his mobile, trying new stuffs; then i will recommend you to have a de-odexed rom. But if you want to play a safe game, dont like modifying your phone then go for the odexed one!


:good::good::good:Feel Free to Hit thanks if this guide Helped you!:good::good::good:



If you have any doubts or confusion feel free to comment below! Your feedbacks are also welcomed!


android.jpg


Source:
Redmond Pie
Few editings by Me!:D
 
Last edited:

Tianhe

Senior Member
Mar 16, 2011
659
152
Well written. However, it might be interesting to note that deodexing also doesn't increase free system space and I have experienced lags while operating the phone itself! But deodexed ROMs are obviously easier for Devs to work on. Meanwhile, I am happy with Xposd!
 

donnie.darko

Senior Member
Aug 9, 2013
62
5
Patna
Really. Thanks! I've already read an article about this but this one is really the best. Thanks again

All our eyes are burnt by heaven and earth, it's such a strange celebration!
 

JavaScout

Senior Member
Apr 3, 2012
679
275
Thanks, very clear. A little OT: is it possible to grab sgs3 calculator apk, without odex, and install it as a regular apk under custom deodexed rom?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    Many users or I'd rather say many 'Young Developing Developers' are often found looking for answers related to Odex and De-Odex Roms in several places (once upon a time even I was one of them!). Well, I cannot promise to answer everything, but if you’re trying to compare the difference between a odexed and deodexed ROM, you’ve come to the right place!

    guidetoodexdeodex2.png

    Explaining Odexed vs. Deodexed Android ROMs

    You’re bound to have come across the term ‘deodexed’ if you’ve ever installed a custom firmware on your device, since almost all ROM developers choose to deodex their offerings. What this means for the average user, however, is a different story. To understand the concept, you’ll first need to grasp what odex files are, and why are the present in the OS in the first place.

    Android (being based on Linux) uses application packages, or APKs, as they’re normally called, to tell the operating system what app to load and execute. If you’re at all familiar with Android, you’ll know that the OS works on the basis of partitions, out of which those apps that are contained in the /system partition are system apps (and cannot be changed or modified without having root level access, since they’re a part of the OS itself), while those contained within the /data partition are user apps and can be freely modified. The /system partition is the first one to load when the operating system boots up, hence giving priority to the apps contained within. It is with these apps that odex and deodex deal with.


    What Are The Two Possibilities

    Coming back to Android applications, there are two possible routes to follow, based on the fact that each app is comprised of an APK and a cache part that tells the Android Dalvik Virtual Machine (VM) what components does the app come with.

    The cache for each APK is contained separately in a .odex file, which loads into the virtual machine at the time of boot, thus speeding up boot times. (Odexed)
    The cache for each APK is contained within the APK itself as a classes.dex file, making the boot times slower as Dalvik VM is built up. (Deodexed)
    Now, ideally, most OEMs choose to opt for the first route, for two major reasons. First, it makes modifying the system apps more difficult (thus making the OS more stable and secure), and two, faster load times for the OS itself, since the cache is built as part of the virtual machine itself. Confused? Allow me to explain.


    Clearing Up the Confusion

    In normal cases, where an Android firmware is odexed, the .odex files for each /system APK (which are stored outside of the APKs themselves) are written into the Dalvik Virtual Machine when the OS boots up. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster. Ultimately, for the user, it means that boot times are significantly sped up, and you can put your device to use much sooner.

    As opposed to the above, in a deodexed (custom) ROM, there is no cache information within the Dalvik Virtual Machine at the time of boot, so when the system status up, it only gets to know which apps to load once the /system partition APKs are actively accessed. This, in effect, will result in a much longer boot time, since each APK will be processed one by one, and you will be able to use your device long after you’ve powered it up.


    Deodex is Slower, Then Why Bother?

    In real life, that’s not the case. With deodexed ROMs, only the first ever boot after clearing Dalvik cache is slower, and all subsequent ones will be the same as any odexed ROM. This is owing to the fact that during the first boot, all cache information is written to the virtual machine anyway, and hence, it will behave as any other firmware (until you clear the Dalvik cache once again).

    Why ROM developers do it is because of the modification possibilities that it entails, especially theming. Since in a deodexed scenario, all the application code is contained within one single APK, the developer can simply modify the APKs values to apply any custom look and feel to the app itself, without breaking any functionality. This also opens up possibilities for changing different parameters of the app without affecting how others will operate. Since a dodexed package has no external dependencies, it gives more freedom to modify what they wish. On the other hand, with an odexed ROM, theming is absolutely impossible, since the .odex part of the application will always be in conflict.


    The Bottom Line

    It all boils down to this: while an odexed firmware is faster and more secure, a deodexed one gives more modification freedom, and is the only way possible to change the look and feel of system apps. In actual terms, deodexed ROMs are only slower in the first ever boot, after which they are the same speed as the former ones. Also, deodex doesn’t entail any serious security risks to your device, either, and you can rest assured that the millions of users opting for these aren’t suffering.


    So what would be my preference?

    If you are a guy like me who is always tweaking his mobile, trying new stuffs; then i will recommend you to have a de-odexed rom. But if you want to play a safe game, dont like modifying your phone then go for the odexed one!


    :good::good::good:Feel Free to Hit thanks if this guide Helped you!:good::good::good:



    If you have any doubts or confusion feel free to comment below! Your feedbacks are also welcomed!


    android.jpg


    Source:
    Redmond Pie
    Few editings by Me!:D
    2
    well written bro!

    Thanks for your appreciation!

    Sent from my GT-I9082 using XDA Premium 4 mobile app
    2
    Well written. However, it might be interesting to note that deodexing also doesn't increase free system space and I have experienced lags while operating the phone itself! But deodexed ROMs are obviously easier for Devs to work on. Meanwhile, I am happy with Xposd!

    Agreed!:laugh:
    1
    Thankx!

    well written bro!
    1
    well explained

    Thankyou bro!

    Sent from my GT-I9082 using XDA Premium 4 mobile app