Odex script and optimised donut build - Touch CDMA Android Development

Our devices don't have very much flash memory and it's easy to fill up /data with apps but here is a quick solution that can give you a bit more space.
In /data is a directory called dalvik-cache, this is a cache of the classes.dex from every app on the device, including those in /system.
On most android devices this doesn't happen, the system applications and the framework are stored as optimised dex files with a .odex extension.
People have spent a lot of time figuring out how to recreate the apks from the odex files and this is good if you have enough space to put all your apps on the device twice because it allows them to be easily swapped for theming.
The attached script goes through each app and jar in /system, creates an odex file and deletes classes.dex. It will give you about 30M extra space on /data while making /system about 10% bigger.
To run it do the following:
Backup you device
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.
unzip odex.zip and then do:
adb push odex /data/odex
adb shell /data/odex/odex.sh
Wait till it finishes and then reboot the phone.
Another reason for odexing is that it boots very quickly and when testing kernels its nice not to have to wait too long.
If you want to see a simple odexed system try this:
http://www.mediafire.com/download.php?qjyniynyqzz
Rename it to androidinstall.tar and it will give you the donut system in the attached screenshots.
The main disadvantage of odexing is that it means you can't change the theme without reinstalling /system so find a theme you like before doing this to your device.
Thanks to Paul O'Brien for writing the original script.
Have fun.

dzo, once again, Thank you.
This should provide ALOT more breathing room in Eclair and Sense builds. Not to mention more flexibility for ROM devs too.
Thanks!

so would this only be useful for people who are making roms and stuff like that I'm kinda a noob still sorry

Unfortunately with my eclair build, /system is almost full
App2SD or /data on sd card look better
but that's device dependant
thank you for the tip anyway

I was about to ask if this will mess up the zipaligning but then I looked a the script and it also does zipaligning.

jadenj5 said:
so would this only be useful for people who are making roms and stuff like that I'm kinda a noob still sorry
Click to expand...
Click to collapse
The end user could run it, too...
Any thoughts on adding this to the install menu? That way you could install system, apply themes, then odex.

I updated the system tar in the first post to fix the broken calendar. I've been running this on my primary phone for a few days now and it seems much faster than it was. Perhaps there's are fewer file accesses with an odexed system and it needs to keep less data in the fs cache. Whatever the reason, give it a try.

is there anyway to do this from the phone without adb?

Include in vogue tools?
Thanks DZO, great that more performance can be squeezed out of our aging devices!
Just a thought: Could this be included in Vogue tools?

Two strange things with this build (on a Kaiser and I've added Wifi so maybe that has to do with it?)
- It never sleeps, I haven't run any Donut build for very long but I think I had this issue when trying the Warm Donut once.
If I turn off the screen (or if it times out by itself) this shows up in /dev/kmsg:
stop_drawing_early_suspend: timeout waiting for userspace to stop drawing
- When I run GPS Test and use the time screen the updates are irregular and sometimes skips a couple of seconds and sometimes several updates comes quickle after each other (with less than a second between them). I actually spent some time debugging my GPS code before I tried on eclair and realized it was not the GPS code that was causing it.
Perhaps both issues are related. I've a panel 1 Kaiser.
Other than that it feels very quick and snappy but no sleeping is terrible for the battery life.
Oh, and I tried turning off both wifi and background transfer but that doesn't help.

Tried this on Incubus's Tattoo and it got to HTCCamera.apk and failed:
Code:
--- BEGIN 'HTCCamera.apk' (bootstrap=0) ---
--- would reduce privs here
--- waiting for verify+opt, pid=3751
--- END 'HTCCamera.apk' --- status=0xff00, process failed
Unable to create '/tmp.odex': File exists
rm: cannot remove '/data/dalvik-cache/*': No such file or directory
It repeated Unable to create '/tmp.odex': File exists but i removed them from the code above because it's not necessary to have them in there 9473975394 times.
I rebooted and reinstalled the system to be safe.

preardon said:
Tried this on Incubus's Tattoo and it got to HTCCamera.apk and failed:
Code:
--- BEGIN 'HTCCamera.apk' (bootstrap=0) ---
--- would reduce privs here
--- waiting for verify+opt, pid=3751
--- END 'HTCCamera.apk' --- status=0xff00, process failed
Unable to create '/tmp.odex': File exists
rm: cannot remove '/data/dalvik-cache/*': No such file or directory
It repeated Unable to create '/tmp.odex': File exists but i removed them from the code above because it's not necessary to have them in there 9473975394 times.
I rebooted and reinstalled the system to be safe.
Click to expand...
Click to collapse
it might have something to do with most of the apk's already being odexed

I've posted an odex:ed and zipaligned CM5.0.7 port here: http://forum.xda-developers.com/showthread.php?t=700669
It also odexes every app in /data/app on boot (and clears the dalvik cache).

great donut build!
Thanks Dzo, you managed to pull together a great, snappy no frills donut build! it is fantastic on my Kaiser - and it is only a by-product of yet another great contributions of your! Thanks!

how is this donut build for use?

thoughtlesskyle said:
how is this donut build for use?
Click to expand...
Click to collapse
Great, I am using it daily on my kaiser at the moment. I understand that Kalt_Kaffe had problems with sleeping and battery life, but it works fine for me.

yea i shouldnt have the sleep and battery life problems because i run a vogue and they do things a little differently.
i wish i wasnt changing builds like every other day anymore

this is an excellent vanilla donut build dzo. it's very responsive and stable running from my sd card on the vogue so far. i really like myn's warm donut rom but it would frequently lock up requiring a restart; not the case with this build. thanks.
edit: is it possible to run the odex script again considering that i've been funning this build on my sd card? i wanted to odex the additional apps i added since the first install. also, would i have to manually remove the odexed files after updating an apk?

Had this running for a day on my old Kaiser and it's nearly as fast as my Hero! Fantastic work! Thanks!

This is the "snapiest" android build I have run on my vogue.
loving it thus far.

Related

Are there any detrimental effects from deleting .odex files?

I found that whenever I flash an updated ROM or apply some themes that quite a few of my apps stopped working and had to be re-installed, especially private apps. The fix has always been re-install. This drove me nuts as some of the apps required a reboot (i.e. mobiledefense) I took a look at my logcat and saw an error (sorry, don't have exact as I figured it out after closing the logcat) regarding a mismatch between odex and dalvik cache. I went through and deleted my app-private/*.odex files. They ALL started working without a reinstall. I have since gone through and removed all of my .odex files and have created a script to do so in assuming this could happen again.
I had a hard time figuring it out because it wasn't all apps, just some. What I discovered was the userinit.sh and user.conf here as a default set this:
odex_auto=1 # perform auto create or del odex for applications installed or removed within 3 days
So it would create .odex files within the parameters outlined. I've since turned it off.
I know .odex has something to do with optimization, and I noticed they are not re-created at any noticeable time. My question is, are there any detrimental effects from deleting them? Will it decrease performance or have any other ill effects on the applications?
If it actually helps performance, I can delete and rebuild them after I do a flash that has this issue. I just don't know if it is worth the effort.
Thanks for any input that may be coming!
Usually there isn't a problem deleting odex files since the system recreates them anyway, but on a similar note, instead of doing that, since you run latest Cyan recovery..go into console mode and type "FIX_PERMISSIONS", it should fix the force closes issues you may be having. This basically fixes the mismatch issues you may be having.
prash said:
Usually there isn't a problem deleting odex files since the system recreates them anyway, but on a similar note, instead of doing that, since you run latest Cyan recovery..go into console mode and type "FIX_PERMISSIONS", it should fix the force closes issues you may be having. This basically fixes the mismatch issues you may be having.
Click to expand...
Click to collapse
Thanks Prash. I've tried fix_permissions from the recovery console and even the new and improved one here previously, which I think is now integrated into Cyanogen's build with no luck. That's when I decided to look a little deeper. I don't know if it was a timing issue with the userinit being set the way it was, but deleting them always worked.
Question from this then for curiosity's sake. When do they get recreated? I have rebooted, updated (maybe not re-installed) numerous times and still don't have any new ones since disabling it in the userinit script.
I also remembered and re-found this, where Cyanogen himself said "Don't .odex your apps, it's a waste of time.".
So, I guess I'll start blowing them away Thanks!

New to Android or NAND?

I'm no longer keeping up with NAND on the vogue. So if anyone would like to keep me informed and email me or post me on any changes with NAND, ill be happy to add the news on the first post. The lock up issue with NAND has been fixed!
This is simply for any noobs or others who are having issues with Android and NAND.
IMPORTANT!!!
FOR VOGUE USERS ONLY
I am not responsible for any bricked or messed up devices. By continuing you are agreeing to my simple rule.
MY SIMPLE RULE: I owe you nothing.
I will help you through the way though if you bricked or need any sort of help.
How-to Video up NOW!!!
http://www.youtube.com/watch?v=3gTkJkOc7m4
​
First off, What is NAND?
To keep it simple...its your phones internal memory. Up untill recently we (Vogue Users) had to run Android off our SD cards using HARET. But thats another story.
What are the benefits of running from NAND? (based on what I have seen)
-Runs faster
-Longer Battery life
-faster boot up
-can be faster to put together.
-Easier to connect your vogue with android to your pc and sync
-Much more convenient.
So how do I start?
STEP1:
The Build
First you need to find a Build that is usable with NAND. Most Hero builds at this moment are not. Here are some links:
Donut 1.6
http://forum.xda-developers.com/showthread.php?t=591104
Hero
http://forum.xda-developers.com/showthread.php?t=603028
Cupcake 1.5
Method 1 from http://forum.xda-developers.com/showthread.php?t=593786
DO NOT DOWNLOAD ANYTHING JUST YET! I WILL TELL YOU WHEN A GOOD TIME WOULD BE
You may want to consider reading the rest...
STEP2:
Base Files (Most builds will supply these)
For all builds (Except the Link in Cupcake "instructions are givin in the download.) you will need a basic set of base files. The link below contains the 3 basic empty files for all builds and Systems.
http://cid-e5302e6abd554cb9.skydrive.live.com/self.aspx/XDA/Androidstuff.rar
IF
You are using Hero make sure you download hero.user.conf too:
http://cid-e5302e6abd554cb9.skydrive.live.com/self.aspx/XDA/hero.user.conf
-create a new folder called conf
-and place hero.user.conf in your new folder.
STEP3:
Rootfs
After you have the Base files you will need a rootfs. Depending on your Build, you may need a different type then the one I am going to supply you. Most builds will supply you with one. This one is DZO's rootfs.
http://cid-e5302e6abd554cb9.skydrive.live.com/self.aspx/XDA/rootfs.img
STEP4:
Prepare
-You need to clean out your storage on your SD. Make sure you delete everything.
-Create a file called android on your desktop.
-Download the base files, unzip, open folder, and place all 3 in your android folder
-Download the rootfs and place them in your android folder. Make sure you either download DZO's or the one your Build provides.
-Download a System.img. When you download a System most likely it will have a different name such as system-hero-123.img. You need to rename it system. So it should look like system.img . Then place it in your android folder.
-If you are using Hero place your conf folder in your android folder.
-Depending on your Build (mostly Hero) you may also need a Data file. The build you select should supply one. Download it and place it in your Android Folder
STEP5
Placing
Open up your android folder of all your collected files and select all, copy, and paste into your empty SD card.
STEP6
Unlocking
If you have never flashed a ROM before than you don't have HardSPL installed. So unlock your phone with...
http://forum.ppcgeeks.com/showthread.php?t=20370
Make sure you follow the forums directions.
STEP7
Method
Method1: The way I do it.
Download ROMUpdateUtility.rar
http://cid-e5302e6abd554cb9.skydrive.live.com/self.aspx/XDA/ROMUpdateUtility.rar
Extract to a newfolder
Download a kernel with your screen size
http://it029000.massey.ac.nz/vogue/files/?C=M;O=D
Don't know your screen size...check this out
http://forum.xda-developers.com/showthread.php?t=544906
After you have have gotten the kernel:
rename it to RUU_signed and place it in the ROMUpdateUtility folder you created.
NOW you need to plug your phone into your computer. Establish active sync. And run ROMUpdateUtility.
-Follow the Instructions on the screen.
Method 2 and 3 can be found here:
http://forum.xda-developers.com/showthread.php?t=593786
This also shows my method...but a little less detail. You can also find many other helpful things there.
If you fail OR think your bricked your phone.
You will need to download one of these depending on your carrier...Make sure you download the shipped gps rom. (If you are Verizon skip down)
http://forum.ppcgeeks.com/showthread.php?p=191607
Than you will put your phone in boot mode. Hold the Camera and Power button. While holding both of them...get a pen or something small and hit the little restart button on the bottom of your phone. You may have to hold it for like a second.
-you will see three color bars on your phone
-plug your phone into your computer
-run the backup
After your phone is all back to normal. Make sure you run internet explore on your phone. It will enable you to get data.
For Verizon follow the instructions here.
http://wiki.ppchaven.com/index.php?title=Pocket_PC_WIki:FIX_VERIZON_GPS
That is about it. I'm sure I forgot some stuff and will add on to this. Make sure you donate to the Devs for all their hard work.
DZO
http://forum.xda-developers.com/showthread.php?t=593786
jamezelle
http://forum.xda-developers.com/showthread.php?t=603028
plemen
http://forum.xda-developers.com/showthread.php?t=591104
vilord
http://forum.xda-developers.com/showthread.php?t=523692
They deserve it.
thank you this was very helpful
inphin1ty said:
thank you this was very helpful
Click to expand...
Click to collapse
No problem...
yea here is the md5sum: 9b08971e7f23619b6a9a4db9d52d857a
jamezelle said:
yea here is the md5sum: 9b08971e7f23619b6a9a4db9d52d857a
Click to expand...
Click to collapse
Whats that?
staud8469 said:
What are the benefits of running from NAND? (based on what I have seen)
1 Runs faster
2 Longer Battery life
3 faster boot up
4 can be faster to put together.
5 Easier to connect your vogue with android to your pc and sync
6 Much more convenient.
Click to expand...
Click to collapse
great thread. I've run both from nand and sdcard. i have not messed with ext2 on the sdcard.
I agree with 3 for sure. I would also add that there is a deep gratification in wiping win mo off the sdcard
6 is debatable, depends on which conveniences you want. changing lcd.density, changing resolution are all much faster running from the sdcard - no flashing or messing with build.prop, just edit default.txt and reboot (aside - if you have a non-sdhc card you can flash on the fly from the sdcard, but changing lcd.density still requires pulling and pushing files from the system, which is not as easy as changing the default.txt). also more convenient to back-up or revert to a data.img when running from sdcard. definitely booting straight into android is convenient, as is the new mass storage on boot method, as well as having a re-writable system (which you also have using ext2).
1 and 2, I honestly have not noted a significant difference in battery life. With a fast sdcard, I don't think there is a significant difference in speed either - dzo has said this in one of the non-vogue forums as well. i have not tried any sense builds from the sdcard though, and that's where you would notice the greatest difference in speed if there is any.
4 I agree with in general.
I think running from the nand is a huge advance, and great for everyone to try. but, running from the sdcard is still a decent way to use android. choosing between the two comes down to choosing which conveniences suit your usage style the most.
One last thing - please add vilord to your donate links (his google ion on vogue thread), he has been instrumental in developing the ril and advancing android on the vogue. srwalter also deserves mention for his reverse engineering of the libgps.so to bring gps first to cupcake and now to donut as well. jamezelle, plemen, mssmison, zenulator, enatefox, f00bar (no specific order) have all worked hard porting roms and working on things like compcache, swap, modem, etc, which has all been invaluable (zenulator and mssmison deserve special credit for spearheading the porting business). however the gruntwork of porting to the vogue has been done mainly by dzo who brought us the kernel and initial ril and now nand (he's just frickin amazing, he singlehandedly got the first functioning port to the vogue and others helped from there), then vilord who took the ril and really refined it. I guess suffice to say, there have been a lot of people involved along the way, thanks to all of them.
when i try to run android from both nand and haret i always get an error about not being able to mount sd card. does this mean i need to reformat the card? if so how do i do this?
Barogi44 said:
when i try to run android from both nand and haret i always get an error about not being able to mount sd card. does this mean i need to reformat the card? if so how do i do this?
Click to expand...
Click to collapse
When do you get this error? During linux kernel bootup?
Verizon users.
I just update a fix for Verizon users. Shows you how to get GPS too!
Also...there will be a video up soon. It seems that there are so many people having issues. So I will create a video from start to finish. Will be posted up late tonight/ tomorrow morning.
staud8469 said:
When do you get this error? During linux kernel bootup?
Click to expand...
Click to collapse
Yea.. i think i may need a new sd card. Can android boot from a 4gb card or is 2 the max?
Barogi44 said:
Yea.. i think i may need a new sd card. Can android boot from a 4gb card or is 2 the max?
Click to expand...
Click to collapse
i running with a 8gig PNY sdcard
it could theoretically run off of a 512, but you would be a little cramped on space
i guess android doesnt like some of them
so really it doesn't matter how big the card is? do they all have to be formatted to fat32?
Barogi44 said:
so really it doesn't matter how big the card is? do they all have to be formatted to fat32?
Click to expand...
Click to collapse
short answer, yes.
Hey guys...I will try my best to get that video up today. I am about to start recording it.
Am I correct in assuming that step 4-b is create a FOLDER name android on the desktop?
Can I delete those files from the SD when flashing is done?
THANK YOU for the N00B instruction, works great.
stopthebus said:
Am I correct in assuming that step 4-b is create a FOLDER name android on the desktop?
Can I delete those files from the SD when flashing is done?
THANK YOU for the N00B instruction, works great.
Click to expand...
Click to collapse
Yes that is correct, as for deleting the files...I would assume you could. But im not sure. Maybe they are still needed on boot. Never hurts to try though.
im not getting access to the internet after i flashed, am i suppose to edit anything?
im running the donut flash on my sprint vogue.
gigermunit said:
im not getting access to the internet after i flashed, am i suppose to edit anything?
im running the donut flash on my sprint vogue.
Click to expand...
Click to collapse
Wait...NVM you want data to work right?
If you are using donut...try to restart your phone one time. After it boots back up you should see a 3g symbol appear on the notification bar.
If that does not work...go to your apps and open modem. Click once on disconnect and then once more. Then click connect.
Tell me if that works...

Legendary Vogue Build, Nand added

HTC Legend build for the Vogue
As always, I take no responsibility for what this may or may not do to your phone. Do it at your own risk. This Build Overclocks your phone to 500, we've found that to be the fastest and most stable, however it may overheat and kill your cpu.
INSTRUCTIONS- YOU MUST FOLLOW!
Start by installing the androidinstall.tar to your sd or img file, (not nand)
Boot and wait a long time, there is no boot animation at all so the screen is blank., go through the setup.
After you've gotten rosie to load the first time, reboot and install the update.tar
This is going to set your lowmemoryparameters (androids build in taskkilller) to some very aggressive settings, as well it overclocks to 500. (I don't love it but it's the only way to run this rom nicely). Also the userinit sets compache with 96MB.
On reboot the phone/ril seems to be the last thing to kick in. (that or it just takes the png a bit to update) Don't worry about it, just be patient and it will enable your radio and connect.
For best results
Use system on sdcard partition, data on nand put a swap parition on your sdcard and edit the userinit.conf to use the swap parition as backing for compache. (this is how I'm running this build and it's good)
What doesn't work;
Bluetooth
Camera
What's cool;
The friend feed is actually cool
Hold the camera button for 2 seconds to view all the rosie screens.
Youtube works
Try something in flash, some works, some doesn't..
Notes
I don't expect to put alot of time into updating and tweaking this build as it is not my primary build that I work with. It is very hard to make 200MB nandable, but I may work on it in the future.
Tweaking;
If you want to play with the memory settings or the overclock just adjust the /system/bin/clock.sh or the /system/sysinit in the androidupdate.tar and re update.
Put your system on SDCARD partition, but put your data on nand. There's definitly a performance increase there.
New Version 03-20
Added LWP if using non rosie launcher
More speed tweaks.
Added HelixLauncher as a good alternative to rosie, to use clear defaults in settings -> manage applications -> HTC Sense. Than hold the cam button for 2 seconds to select different home app.
Next version
More space on /data
More speed tweaks
VogueSense Parts app
DOWNLOAD Works on Nand and Regular
https://sourceforge.net/projects/androidhtc/files/2010-03-20/legendnand.rar/download
Downloading! (37mn left ><)
Thank you for giving us an alternative to "standard" Eclair builds
Kiiv said:
Downloading! (37mn left ><)
Thank you for giving us an alternative to "standard" Eclair builds
Click to expand...
Click to collapse
a.) slow internet?
b.) need to use a different sourceforge mirror (cause I get 1MB/sec on sourceforge)?
mssmison said:
a.) slow internet?
b.) need to use a different sourceforge mirror (cause I get 1MB/sec on sourceforge)?
Click to expand...
Click to collapse
a.) slow internet
I have Darch's Legend on my Hero and LOVE it. Im tryin this on my son's vouge now!
edit...does it have the cool weather home screen animations?
Yes it does!!
Ahh ive recently switched back to windows mobile for speed and stability reasons..
but your builds and your reputation is the driving force for me to try this one.
Ill chime in on what i think.
screenshots?
It looks a little better than every other legend build.. lol seriously just google htc legend it looks the same as whatever pics and videos you'll see Except of course it's that tiny tiny bit blurry that everyone complains about with 320x480 on the vogue
k I've got a build done that should be fully nandable. but to be completely honest I don't really feel like wiping/testing today. I'll give it a shot this weekend and post if it works.
Otherwise the next update will include the ability to use livewallpapers (if your using a launcher other than rosie). and some other speed tweaks.
This is a nice build to play with it has the apps i need in the market I hope somebody can help speed it up
nand added.
Read first post.
is it possible to use it on polaris? not sure if the overclocking would suit the polaris
iseeka said:
is it possible to use it on polaris? not sure if the overclocking would suit the polaris
Click to expand...
Click to collapse
yeah sure, just open the update tar and in /system/bin delete the clock.sh file.
I haven't tried to put in wifi yet though
mssmison said:
HTC Legend build for the Vogue
For best results
Use system on sdcard partition, data on nand put a swap parition on your sdcard and edit the userinit.conf to use the swap parition as backing for compache. (this is how I'm running this build and it's good)
Click to expand...
Click to collapse
I would like to run this from ext2 partitions with Haret. Could someone please describe what partitions I should put on my sd card? (I know HOW to partition, just need some guidance as to sizes needed, especially if putting on a Linux swap.) Also, please describe what options to select on booting the first time. Running from Haret, do I really install data to NAND?! And, if so, without unlocking and flashing? Mssmison also mentions editing the userinit.conf, if using a swap partition. Please tell me which values need to be edited.
I am used to NoMoRootfs and the old sqsh running from Haret.
TIA.
I can't get this release to mount on my sd card I keep getting the wake up errors
sak211l said:
I can't get this release to mount on my sd card I keep getting the wake up errors
Click to expand...
Click to collapse
Me too. I tried to install the latest 3/20 nand builds into my sd, but failed. I will try the 3/29 builds
Can anyone tell me how fast this build runs?
I had the old SenseHero build from Jamezelle, but most of the time when the phone rang my phone was too slow to pick it up, and I missed the call.
I hope this one is faster
Deodex
Theres a way to make this build smaller
Deodex apps. This build has 21.8MB of .odex files.
tiagoclc said:
Theres a way to make this build smaller
Deodex apps. This build has 21.8MB of .odex files.
Click to expand...
Click to collapse
the files being odex'ed makes them faster. That's why I've left them like that
kiwilime said:
Can anyone tell me how fast this build runs?
I had the old SenseHero build from Jamezelle, but most of the time when the phone rang my phone was too slow to pick it up, and I missed the call.
I hope this one is faster
Click to expand...
Click to collapse
It's not atleast on my tilt its probably the worst sense build I have run yet props to mssmison on getting it ported though. Good job, it looks good but way too slow for me to run even on nand. back to playing with the other sense build on SDcard ext2 img, for some reason I cannot get any build installed to partitions I have tried with both cards

[Q] Odex vs. Deodex - what's better?

Hello,
I was wondering, what are the advantages of deodexing, aside from theming?
I've done some tests with my everyday stock ROM and found an odex ROM was faster. I understand that odex files are basically classes.dex, but specifically made for my platform, Android version and is not compressed, thus accelerating the start times.
I went as far as pushing the system apps updates in /system directly (by hand, I can tell you it gets old fast). But I still had low memory in /data. Then I remembered, automatic odex files are stored in dalvik-cache, and thus, when Maps, which has a very big odex file or so, first starts, even if it's on /system, you end up still needing space in /data to start.
So I searched how I could hand-do these odex files, and came across dexopt-wrapper. I loaded it up on my phone, and started odexing all these system apps that used to be odexed.
All in all, you lose room in /system (because odex+apk is slightly larger than the apk, but you're not supposed to have /system writable anyway), or you lose valuable space in /data, where you could put all your apps.
Basically:
I backed up my stuff with Titanium (after cleaning the cache). I was on Geo411m's ROM. I had around 25MB left on my phone.
I then reflashed FRG33 from the PASSIMG.zip
then updated with the FRG83D OTA (straight from Google, not through update.zip)
I updated all system apps through the Market
I used rageagainstthecage to shell root, to read the system and data partitions
I used dexopt-wrapper to create odex files for all the updated apks I had
I pushed everything in /system
Finally, I restarted. Before this, I booted Amon-RA's recovery to clear all the user data
I rooted (permanently this time), restored all my apps through Titanium Backup. I had 65 MB left. That's a 40 MB difference, just by odexing.
So now I wonder, knowing I don't plan on theming, is deodexing useful outside of this, and should I give up some space for something that eluded me?
Sorry for the lonnnnnng post
Thanks!
I'm not aware of any benefit of deodexeding, other than theming.
i've heard people say there is definitely a performance difference between the two, but i really dont know from personal experience. it probably doesnt matter for general usage...
I believe you're right, deodex takes up more of your internal space, which to me is a problem
Sent from my Nexus One using XDA App
When I first flash a new rom from recovery the odex rom will start faster,but I cant feel any difference between odex and deodex rom on speed when my defy is on.
Aside from the first load, deodexed system runs at the same speed as odexed, or with negligible differences (not 100% sure if system-odexed files that are created in Dalvik-cache are the same as .odex that are in the apks).
The disadvantage of deodexed system is extra size of Dalvik-cache. While it can be quite a difference for those using N1's tiny internal space w/o any sort of A2SD solution, it's negligible for those running A2SD or on phones with proper internal memory size.
The advantage of deodexed system is being able to modify the apps themselves, and the framework. In addition to theming, it allows for different kinds of modifications - like trackball wake, or RTL (Hebrew/Arabic) framework patching.
Quite an old thread you managed to dig...
kingdragonfly said:
When I first flash a new rom from recovery the odex rom will start faster,but I cant feel any difference between odex and deodex rom on speed when my defy is on.
Click to expand...
Click to collapse
Way to bump a 1.5 years old thread, lol.
Theshawty said:
Way to bump a 1.5 years old thread, lol.
Click to expand...
Click to collapse
maybe because you all people tell noobs to serch and don't ask. and when i find 4 years old thread is still very usefull
Sent from my Nexus 5 using Tapatalk
magik300 said:
maybe because you all people tell noobs to serch and don't ask. and when i find 4 years old thread is still very usefull
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
You felt it was worth a two year bump just to convey that? Oh, ok.
Sent from my HTC One using Tapatalk
I don't know about a 2 year bump, but a 1 year bump to agree that this is a nice simple thread that is exactly what it says on the tin.
Lol
Lol
Is there any good resource I can be pointed to learn about the difference between Odex/Deodex?
nice info from this thread, thanks!
Hi
I would like to start automatically my Htc n1 when i put in the charger.
There are some methods on the internet,for some other phones.
Can someone tell me wich and how the folder i must modify?
My phone doesn't start when it's plugged in and take the battery out and put it back(i dont know why).
Sorry to write to you here, but I see you are very good at what you do.
I thought you could help me.
Thanks

[Script/tool][Linux]Auto Deodexer shell script

I recently bought a Galaxy Mini 2, and the first thing I wanted to do was modding it!
But I couldn't do it on an odexed ROM, currently available ROMs are only the 4.x builds by TheWhisp and some tweaked ones I don't like, and xUltimate throws errors.
Also, the stock ROM contains 100+ packages to deodex, so I couldn't do it by hand quickly.
I wrote this script to do it for me. I'm not really experienced, and I don't know how far this can be from being optimized, clean and readable, but it works, and it should work for any device and ROM if used correctly.
This script deodexes all the apk and jar packages for system apps and framework, then zipaligns them for better memory optimization (memory consumption is a half of what's normally used on stock ROM). After that, it writes an updater-script and packages everything in a shiny flashable zip to use in recovery.
WARNING: Might cause boot-loops or force-closes. It's recommended to check that the cwm_deodex.zip file contains the .apk and .jar files and pick some random APKs and JARs to check that they contain the classes.dex file in their root. The APKs from framework should not contain the classes.dex, while the JARs should. It's also recommended to do a backup before flashing the deodex package, in case the cwm_restore.zip fails.
HOW TO USE:
Extract the attached zip wherever you want.
Pull all the files from /system/app and /system/framework from your phone and put them respectively in the directories"app_odexed", and "framework_odexed" (they're located under the extracted directory).
Check the API level for your device's Android version (if you don't know, check this). In deodex_app.sh and deodex_framework.sh there are four lines (two in deodex_app.sh and two in deodex_framework.sh) which begin in "java -jar baksmali.jar" and "java -jar smali.jar". Those lines contain an option "-a", followed by a number (by default "10"): you should change that number to your API level. If you are on ICS or later, you can just delete the "-a" option and the consecutive number.
Open a terminal in the directory where the deodex.sh file is and type "./deodex.sh", then you can have a coffee (or more, depending on how many files to deodex are there).
When you come back, you should find the cwm_deodex.zip waiting to be pushed to your device and flashed, and a cwm_restore.zip to flash if you need to restore the previous odexed files.
Notes:
The script doesn't stop on errors.
The cwm_restore.zip package doesn't really odex your ROM: it restores the odexed files you pulled from your device before deodexing. So yes, your ROM will get back to it's previous odexed state, but that package won't odex any ROM.
Changes:
-v1.1: Scripts and binaries moved to a "tools" subdirectory; now also creates a flashable zip to restore the old odexed files; reduced the amount of screen output.
-v1: Initial.
If you can suggest any correction to the script, please do it.
Also, since English is not my language, feel more-than-free to point out if there's something wrong or unclear in the post .
Great work
Could you write such a script for odexing too ?
Sent from my BL-S5570 using xda app-developers app
May be... But I don't see any benefits in an odexed ROM. It's just quicker when booting the first time.
Gspin96 said:
May be... But I don't see any benefits in an odexed ROM. It's just quicker when booting the first time.
Click to expand...
Click to collapse
The .odex file is kept in memory ...so higher ram usage but apps open a lot faster as they are already in memory ....also your internal memory is almost completely empty so you don't need to use sd-ext....
Sent from my GT-S5570 using Tapatalk 2
hsay said:
The .odex file is kept in memory ...so higher ram usage but apps open a lot faster as they are already in memory ....also your internal memory is almost completely empty so you don't need to use sd-ext....
Click to expand...
Click to collapse
Here is a quote from http://forum.xda-developers.com/showthread.php?p=39393263
R_a_z_v_a_n said:
Advanteges & Disadvantages
The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, since that would not only allow him to modify various APKs, but also leave room for post-install theming.
On the other hand, since the .odex files were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.
Click to expand...
Click to collapse
Also, keeping things in memory is an Android feature: if an app ran once, it is then kept in memory until you use a task killer (which is not recommended, as Android then would have to reload the app in RAM, slowing down and draining battery) or the system gets out-of-memory.
It's more correct to say that odex files are, ready to be loaded in RAM, because the Dalvik Machine doesn't need to optimize them. However, after the DM optimizes them on the first boot, they're kept in the dalvik cache, as ready to be loaded as an odexed app would be.
Anyway, for who wants to re-odex, there's an easy solution: you can use Titanium backup (menu->Integrate sys Dalvik into ROM).
Gspin96 said:
Anyway, for who wants to re-odex, there's an easy solution: you can use Titanium backup (menu->Integrate sys Dalvik into ROM).
Click to expand...
Click to collapse
That is not odexing ...its just an alternative.
Sent from my GT-S5570 using Tapatalk 2
Did you try? I did. It does indeed create the .odex files you want in /system/app.
Gspin96 said:
Did you try? I did. It does indeed create the .odex files you want in /system/app.
Click to expand...
Click to collapse
I stand corrected ...
But does it odex the framework files and other things?
Sent from my GT-S5570 using Tapatalk 2
I was editing that post because i saw that framework was not odexed.
Hell, I had found a link to a to a re-odexing script/tutorial here on xda in the galaxy 3 (not galaxy s3) forum, but I had to go leaving that post unedited.
I'll add a link to that tutorial on first post as soon as I'm on my PC again.
Thanks.
EDIT: this is the tut: http://forum.xda-developers.com/showthread.php?t=1402233
Gspin96 said:
I was editing that post because i saw that framework was not odexed.
Hell, I had found a link to a to a re-odexing script/tutorial here on xda in the galaxy 3 (not galaxy s3) forum, but I had to go leaving that post unedited.
I'll add a link to that tutorial on first post as soon as I'm on my PC again.
Thanks.
EDIT: this is the tut: http://forum.xda-developers.com/showthread.php?t=1402233
Click to expand...
Click to collapse
Btw even universal odex script by matrixdj96 works good and its here in the mini Dev section and bro hope no hard feelings.
Sent from my GT-S5570 using Tapatalk 2
I didn't see that script, it looks good (I won't try it, I'm going to mod framework).
bro hope no hard feelings
Click to expand...
Click to collapse
No, man. I've been feeling attacked somehow, but I know I shouldn't have.
New update: now it's a bit (really, just a very little bit) cleaner and also creates a .zip flashable which restores your ROM to its previous state (usually odexed, if it wasn't odexed, then you wouldn't have used the script).

Categories

Resources