One click ODEXing a ROM for more RAM and better speed.

Did you find this post useful?


  • Total voters
    45
Search This thread

nibras_reeza

Senior Member
Feb 8, 2011
852
415
Colombo
nibras.co.cc
Here's an alternative way to gain more RAM and performance without odexing.
Get more RAM and faster responses by disabling verify-bytecode!

This process will usually give just as much as performance boost as odexing SYSTEM and USER app.

AS WITH ANY MODDING PROCEDURE/SCRIPTS FOR YOUR PHONE, THIS SCIPT ALSO COMES WITH NO WARRANTY. AUTHOR HOLDS NO RESPONSIBILITY FOR ANY DIRECT AND INDIRECT CONSEQUENCES OF RUNNING THIS SCRIPT. MAKE SURE YOU HAVE MADE A NAND BACKUP BEFORE PROCEEDING. MAKE SURE YOU HAVE AT LEAST 15% FREE ON /SYSTEM, THIS IS IMPORTANT BECAUSE IF YOU RUN OUT OF SPACE THINGS WILL GO BADLY WRONG..

Requires busybox.

If your system partition is almost full, have a look at http://xdaforums.com/showthread.php?t=734236.

This script will *attempt* to odex all apks found at /system/app. Theming would be impossible once the ROM is odexed. Themes applied at the time of odexing will be preserved. If you plan on applying a theme, apply it before odexing. If you want to theme after odexing, you must deodex the ROM before theming. If you change themes often, odexing is not for you.

Quick Instructions for Windows:
  • Connect the phone with USB cable and enable USB debugging. (No wireless or Android Terminal shell)
  • Put the phone in airplane mode.
  • Download and extract the attached file and run odex.bat

Instructions for advanced users:
This attachment contains a folder called odex. Push that folder to data and set the permission of odex.sh to 4755. Mount system as r/w(could be done via adb remount system). Next, execute odex.sh. All of this should be done via USB using ADB shell. Do not use wireless adb or Android Terminal.

Advantages:
  • More free space in system partition.
  • Faster booting.
  • More free RAM(I was able to gain 20-30MB.)
  • Faster access to system apps.

Disadvantages:
  • Cannot be themed after odexing.
  • APK tweaks cannot be applied.
  • Might break some of the non-AOSP system apps such as Root Explorer if they are installed as system app.

Acknowledgments:
Only the odex.bat was created by me. Similar projects were done in past but most of the downloads are broken. So, I collected together different stuff from different places to put together this package.
  • adb.exe is from the RATC batch ROOT.
  • adb dlls are from Android SDK
  • odex.sh is from Paul O Brian from MoDaCo (pastebin.com/EZLWUdea)
  • zip, zipalign and dexopt-wrapper are from XDA (http://xdaforums.com/showthread.php?t=734236)

Next aim: Odex for apps in data/app



Update:
I got 1017 on quadrant and 61.8fps on swiftdroid 2.0 M6 overclocked to 844MHz(offline mode with wifi on. No apps except system apps). It must be noted that sometimes odexed ROM performs slightly slower in benchmarks but the difference is very small. However, this does not mean their performance is lower. Odex means apps could load fast thereby making app switching, app loading really fast. And, it also reduces system RAM usage which means more apps could stay in memory making multi-tasking easier. Odexing is something like swap or compcache. Sacrifice something to gain something else. This is for some people who think odexing is useless. The drop in speed is so small that it cannot be noticed without a benchmark but the performance of the phone increases noticeably due to more space in dalvik and RAM. :)
 

Attachments

  • odex-WinXP.zip
    404.2 KB · Views: 2,558
Last edited:

tweakradje

Senior Member
Nice work.

Few remarks.
1) you need busybox installed for find
2) "busybox --install" defaults to /usr/bin (not available on android)
use "busybox --install ." when you cat-ed it to /system/xbin ;)

Something seems not OK though with the odex.sh script?

Code:
Unable to create './Contacts.odex': File exists
        zip warning: name not matched: classes.dex

zip error: Nothing to do! (./Contacts.apk)
Unable to open './Contacts.apk' as zip archive
failed on './Contacts.apk.new' - No such file or directory
Unable to create './VoiceSearch.odex': Permission denied
Unable to create './Music.odex': File exists
        zip warning: name not matched: classes.dex
Cheers
 
Last edited:
  • Like
Reactions: nibras_reeza

nibras_reeza

Senior Member
Feb 8, 2011
852
415
Colombo
nibras.co.cc
Hmm, sorry, I just started to assume busybox is default since the two ROMs of concern(Joe's. Gingerbread and swiftdroid) had busybox.

Those apks are already odexed. You are on a partially odexed rom. Nothing to worry.
Nice work.

Few remarks.
1) you need busybox installed for find
2) "busybox --install" defaults to /usr/bin (not available on android)
use "busybox --install ." when you cat-ed it to /system/xbin ;)

Something seems not OK though with the odex.sh script?

Code:
Unable to create './Contacts.odex': File exists
        zip warning: name not matched: classes.dex

zip error: Nothing to do! (./Contacts.apk)
Unable to open './Contacts.apk' as zip archive
failed on './Contacts.apk.new' - No such file or directory
Unable to create './VoiceSearch.odex': Permission denied
Unable to create './Music.odex': File exists
        zip warning: name not matched: classes.dex
Cheers



Sent from my GT540 using XDA App
 
Last edited:

nibras_reeza

Senior Member
Feb 8, 2011
852
415
Colombo
nibras.co.cc
That depends on the theme. A theme that modifies odexed system apks will break things while an apk that modifies only the unodexed system apks will work. So, for most users, it would be safer to say that you shouldn't apply themes.

Sent from my GT540 using XDA App
 

mikegapinski

Senior Member
Jun 7, 2011
794
2,841
Szczecin
if you want to get even more ram odex your framework ... On my froyo with odexed framework i got 123mb ram with stock autokiller values :) This is only odexing system/app so you are able to theme your framework without problems ...
 
  • Like
Reactions: nibras_reeza

nibras_reeza

Senior Member
Feb 8, 2011
852
415
Colombo
nibras.co.cc
if you want to get even more ram odex your framework ... On my froyo with odexed framework i got 123mb ram with stock autokiller values :) This is only odexing system/app so you are able to theme your framework without problems ...
I will try that. I was trying to odex data/apps. I odexed quadrant apk and saw a small gain of around 1% but it could be purely due to error or differences in conditions.

Framework isn't odexed doesn't mean all themes would work. Some themes modify other apks for more customizations. So, if you apply such a theme, it will break things. Better be safe than sorry. Saying that most themes would work, people might try to flash all themes thinking it won't break anything. It's just safer to deodex before theming. Of course, if you know what theme modify only framework and what theme modifies other apks, this shouldn't be a concern.


Update: odexing framework apk has reduced free memory to 60MB from previous 75MB
 
Last edited:

nibras_reeza

Senior Member
Feb 8, 2011
852
415
Colombo
nibras.co.cc
Might try add this into my app Root Toolbox if that's ok?
Hmm. You can but it's not a good idea. I tried odexing via terminal emulator but it fails.
Basically, this would not work if you try via root toolbox or rather it increases chances of being bricked. However, I noticed you had the scripts needed to flash an update.zip. If that's the case, you'll need to prepare an update.zip in real time and flash it via recovery.

http://xdaforums.com/showthread.php?t=734236 This script moves the apps to SD and odexes. You will have to remove the appsupdate.sh and instead create an update.zip from odexed apps in sdcard. My script on the other hand, directly odexes without any user interaction.

On the other hand, I'd be glad to see this being simplified enough to pressing a button in root tool box. Only the bat script is mine. The rest are from other sources. I guess it shouldn't be a problem as long as you give credit to Paul O Brian from MoDaCo and the person who wrote deoxopt-wrapper.

And, btw, I noticed a small issue in your app. It has NO WARNINGS and NO CONFIRMATIONS! This is a real downer for an app like Root Toolbox which could brick your phone. You should ask for user confirmation whenever an user attempts to do a task that might brick your phone.
 

lukemovement1

Senior Member
Mar 12, 2011
462
72
Bristol
I am planning on adding the confirmation dialogs as soon as I can get back to my computer. For the odexing at runtime ill see if it works with app that don't have a GUI. If not ill do some kind of update.zip.
 

Danzano

Senior Member
May 21, 2011
3,075
463
Auckland
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
starting odexing...it might take a few minutes to finish...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...
this process connot access the file because it is being used by another process...


this process connot access the file because it is being used by another process...
your device is now odexed

is this right or is something wrong?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Here's an alternative way to gain more RAM and performance without odexing.
    Get more RAM and faster responses by disabling verify-bytecode!

    This process will usually give just as much as performance boost as odexing SYSTEM and USER app.

    AS WITH ANY MODDING PROCEDURE/SCRIPTS FOR YOUR PHONE, THIS SCIPT ALSO COMES WITH NO WARRANTY. AUTHOR HOLDS NO RESPONSIBILITY FOR ANY DIRECT AND INDIRECT CONSEQUENCES OF RUNNING THIS SCRIPT. MAKE SURE YOU HAVE MADE A NAND BACKUP BEFORE PROCEEDING. MAKE SURE YOU HAVE AT LEAST 15% FREE ON /SYSTEM, THIS IS IMPORTANT BECAUSE IF YOU RUN OUT OF SPACE THINGS WILL GO BADLY WRONG..

    Requires busybox.

    If your system partition is almost full, have a look at http://xdaforums.com/showthread.php?t=734236.

    This script will *attempt* to odex all apks found at /system/app. Theming would be impossible once the ROM is odexed. Themes applied at the time of odexing will be preserved. If you plan on applying a theme, apply it before odexing. If you want to theme after odexing, you must deodex the ROM before theming. If you change themes often, odexing is not for you.

    Quick Instructions for Windows:
    • Connect the phone with USB cable and enable USB debugging. (No wireless or Android Terminal shell)
    • Put the phone in airplane mode.
    • Download and extract the attached file and run odex.bat

    Instructions for advanced users:
    This attachment contains a folder called odex. Push that folder to data and set the permission of odex.sh to 4755. Mount system as r/w(could be done via adb remount system). Next, execute odex.sh. All of this should be done via USB using ADB shell. Do not use wireless adb or Android Terminal.

    Advantages:
    • More free space in system partition.
    • Faster booting.
    • More free RAM(I was able to gain 20-30MB.)
    • Faster access to system apps.

    Disadvantages:
    • Cannot be themed after odexing.
    • APK tweaks cannot be applied.
    • Might break some of the non-AOSP system apps such as Root Explorer if they are installed as system app.

    Acknowledgments:
    Only the odex.bat was created by me. Similar projects were done in past but most of the downloads are broken. So, I collected together different stuff from different places to put together this package.
    • adb.exe is from the RATC batch ROOT.
    • adb dlls are from Android SDK
    • odex.sh is from Paul O Brian from MoDaCo (pastebin.com/EZLWUdea)
    • zip, zipalign and dexopt-wrapper are from XDA (http://xdaforums.com/showthread.php?t=734236)

    Next aim: Odex for apps in data/app



    Update:
    I got 1017 on quadrant and 61.8fps on swiftdroid 2.0 M6 overclocked to 844MHz(offline mode with wifi on. No apps except system apps). It must be noted that sometimes odexed ROM performs slightly slower in benchmarks but the difference is very small. However, this does not mean their performance is lower. Odex means apps could load fast thereby making app switching, app loading really fast. And, it also reduces system RAM usage which means more apps could stay in memory making multi-tasking easier. Odexing is something like swap or compcache. Sacrifice something to gain something else. This is for some people who think odexing is useless. The drop in speed is so small that it cannot be noticed without a benchmark but the performance of the phone increases noticeably due to more space in dalvik and RAM. :)
    2
    ugh...

    Not really an "android boss" are you? Google it or search the forums.

    Indeed... @androidboss, here you go. :)
    1
    Nice work.

    Few remarks.
    1) you need busybox installed for find
    2) "busybox --install" defaults to /usr/bin (not available on android)
    use "busybox --install ." when you cat-ed it to /system/xbin ;)

    Something seems not OK though with the odex.sh script?

    Code:
    Unable to create './Contacts.odex': File exists
            zip warning: name not matched: classes.dex
    
    zip error: Nothing to do! (./Contacts.apk)
    Unable to open './Contacts.apk' as zip archive
    failed on './Contacts.apk.new' - No such file or directory
    Unable to create './VoiceSearch.odex': Permission denied
    Unable to create './Music.odex': File exists
            zip warning: name not matched: classes.dex
    Cheers
    1
    if you want to get even more ram odex your framework ... On my froyo with odexed framework i got 123mb ram with stock autokiller values :) This is only odexing system/app so you are able to theme your framework without problems ...
    1
    Should work in *most* cases.

    Try the other disable verify bytecode tweak. It gives you the best of both worlds.

    i just did and my phone immediately felt snappier. i tried it in the past but it broke my v6 but not anymore. :)



    Sent from my GT540 using XDA App