yashsingh1/xdaforums huggingface dataset:
[Epic 4G Android Development] tanimn:
ACS Presents:​

One Click Odexer and Restoration Tool​

version 1.0 - by tanimn

*** PLEASE NANDROID BACKUP ***​

DETAILS:

OneClickOdexer is an odexing and restoration tool for deodexed roms. It will determine if it has been previously run and automatically odex your rom or restore it to a deodexed state. If a critical error occurs, it will return your phone to it's previous state. Care has been taken to only odex apps that come stock with an odex file.

With one click, it odexes.

With one click, it restores.

Complete details are available in the included README.TXT, including instructions for manual operation and running from the handset instead of through adb.

By changing from a deodexed to an odexed system you are modifying the method in which your dalvik virtual machine works. PLEASE backup your phone before using! I will accept no responsibility for your failure to follow this basic safety tenet.

PROS:

Increases speed by about 15%

Reduces memory usage

More space available on /data

Reduced use of dalvik-cache

CONS:

You might need to re-add some widgets and home screen icons after applying

You will need to restore your deodexed system to make any theme swaps (But that's just one click away...)

Exclusively for Samsung Epic 4g. Tested on DK28 and DI18 roms. Contact tanimn for porting instructions.

Thanks to raiderep for the idea, Paul O'Brien for the commands, and ACS for the help and support.

Downloads: (Please report mirrors)

MultiUpload
[Epic 4G Android Development] snowmanwithahat:
Sweet idea!

Sent from my Nexus S with a keyboard
[Epic 4G Android Development] Electrofreak:
Nice, thanks! :D
[Epic 4G Android Development] MysteryEmotionz:
Alot of work went into this and its well worth it.

Sent From Da Hood.
[Epic 4G Android Development] yogi2010:
hi, i am rooted with cwm 3.0.0.5(ext4).... is this program not compatible with that? it is saying it did not find root.... but i am definitely rooted and running cwm 3. thx
[Epic 4G Android Development] rjmjr69:
As always amazing work. Thank you the hard work long hours and dedication to your project and getting this out to the users benefit. I know everyone will enjoy the performance boost and ease of file conversion on the fly....:-) look out for some more great releases from ACS!
[Epic 4G Android Development] kennethpenn:
Looks really cool. I look forward to reviewing this tool!
[Epic 4G Android Development] MysteryEmotionz:
When using the one click you neef to have your screen set to always on. Adb ask for su permission. You'll get a su pop up on your phone and you have to hot allow

Sent From Da Hood.
[Epic 4G Android Development] yogi2010:
thx. got it to run but the phone seems to be not rebooting.... stuck at Samsung screen, then goes off and hangs at Samsung screen, etc etc.
[Epic 4G Android Development] tanimn:
If the script gets interrupted while it is going through the framework, this can happen. THIS is why you have that nandroid backup in cwm, right...?

If the script doesn't cause the phone to reboot on it's own, rerun the script before rebooting by hand, and restore a backup if your handset has stopped responding.
[Epic 4G Android Development] yogi2010:
yep, i have the backup. the script did finish and start the reboot itself... the reboot just keeps getting stuck at Samsung screen, then turning off, and getting stuck again and turning off. no biggie, i can always restore, just lettin ya know what happening.
[Epic 4G Android Development] MysteryEmotionz:
What rom are you running

Sent From Da Hood.
[Epic 4G Android Development] raiderep:
Thanx for doing this for us. It will really come in handy for re-odexing after adding mods and/or theming to a deodexed system.
[Epic 4G Android Development] yogi2010:
been running Viper 4.0.3 ext4.
[Epic 4G Android Development] tanimn:
Yeah, what he said... :)

Thanks. What rom is this happening with? I'd like to be able to reproduce it and find out what's going on...
[Epic 4G Android Development] MysteryEmotionz:
Look up ;)

Sent From Da Hood.
[Epic 4G Android Development] yogi2010:
no prob... it's happening with Viper 4.0.3 ext4. i just odined back to stock tho, and flashed Syndicate 1.0.2, because i wanted to check that out for fun anyway, lol. the only thing is i'm having a problem with my touchscreen now.... the physical buttons work, but the touchscreen mostly doesn't work... just sometimes. touchscreen sometimes does work after a reboot, then goes out, etc/
[Epic 4G Android Development] tanimn:
Sounds like it's still settling, TBH. Could you pastebin a logcat?
[Epic 4G Android Development] yogi2010:
sorry, not sure what you mean by pastebin a logcat... i closed all the screens of the program by now.

btw, touchscreen working fine now :).
[Epic 4G Android Development] fastmikey1969:
Just installed on Nebula v1.0.6 with EXT4. Seems to be running normally, I'll play with it some more.
[Epic 4G Android Development] lloydcabraham:
No worries, I'll just check periodically for any updates. Thanks for you help.
[Epic 4G Android Development] mouseglider:
Did you mean "not allow" or "to allow"? Sorry I am new and still learning.

Thanks
[Epic 4G Android Development] BeerChameleon:
Take your time tanim cant wait for this to work on bonsai 3.0.1!!!
[Epic 4G Android Development] jasonsf:
That should probably have read "have to hit allow"
[Epic 4G Android Development] mouseglider:
Thank You!
[Epic 4G Android Development] sinman02:
Any update pending on this bad boy for eb13?
[Epic 4G Android Development] vampyrex13:
I ran some (painful) tests and discovered that with both EB13 and EC05 (for Bonsai at least), Odexing works great if you don't have the Reboot mod installed. Everytime I added the reboot mod and tried to odex my phone, it would hang at boot.
[Epic 4G Android Development] tanimn:
Thanks for that little tidbit, vampyrex13. That's actually extremely helpful in regards to tracking down some issues that have been plaguing the next version.
[Epic 4G Android Development] vampyrex13:
No problem. Another problem I discovered is that if I run a backup in CWM and then do an immediate restore (I wanted to re-enable EXT4 journaling in Bonsai), the restore would finish but the ROM would not boot.
[Epic 4G Android Development] vampyrex13:
Just succesfully odexed my Bonsai 4.0.1. Here's a huge tip on how to do this to minimize any problems.

Enable airplane mode.

Open Task Manager (hold down home) and kill everything.

In Task Manager go to RAM Manager and do a Level 2 wipe.

Stay in Task Manager (will prevent your Home Launcher from starting) and connect your phone to your PC.

Run the Deodexer script. I recommend using the 1.2 beta 3 script from the link in an earlier post on this thread.
[Epic 4G Android Development] vampyrex13:
Although doing a CWM backup then restore doesn't go as smooth for some reason.
[Epic 4G Android Development] vampyrex13:
*bump* is anymore work being done on this?
[Epic 4G Android Development] k0nane:
tanimn is a very busy man, but rest assured, this has not been forgotten!
[Epic 4G Android Development] twolostminds:
Just ran 1.2.b3 and it worked flawlessly on clean install of

[ROM][ODIN][RFS/EXT4][NOCIQ] EC05 Stock Plus Updated 5/5/2011

. Awesome work!!
[Epic 4G Android Development] vampyrex13:
Just remember to wipe your caches before doing a restore, otherwise you may get FC's.
[Epic 4G Android Development] eigerzoom:
bump for some potential ee03 swizzlestick testing
[Epic 4G Android Development] MДЯCЦSДИT:
Bump for update (IDK why I don't just ask on gtalk...) But tanimn seems really busy, buuuuut this is likely the last update the epic will ever get, so might as well support it...
[Epic 4G Android Development] zanderman112:
Would be cool.

Sent from my Samsung Legendary 4G, a Universe UTES phone, running "two.three.five"
[Epic 4G Android Development] vampyrex13:
Bump.

Sent from my Samsung Epic 4G
[Epic 4G Android Development] musclehead84:
so i ran this script and it gave me alot more space. my question is if i want to change my theme i just run it again? do i have to run it again if i change roms or update my rom?
[Epic 4G Android Development] tanimn:
You should only attempt to modify your system from a deodexed state, so yes, run it before making any of those changes.

You can skip running the script in the case of a fresh rom install by simply removing the odex folder from your sd card. If you run the script with this folder in place, it will restore the system it backed up when the script was first run.
[Epic 4G Android Development] musclehead84:
i just tried to run the script again and my phone rebooted but my modem was gone. when i went to baseband version it said unknown and i was getting some force closes. i had no problems odexing it but i had thistrouble trying to revert back.
[Epic 4G Android Development] gzub:
I did this on Bonsai 2.0, the only issue I ran into was that there is one odex file in their distribution, so the script stopped. I tried to find it and delete it, however I guess when the script stopped it had removed the file.

When I ran it a second time (I did not reboot) it ran fine and worked. I have experienced no issues.

Question, is there any reason why we should not modify this script to odex other jars, rather than just the normal odexed ones?

Geoff
[Epic 4G Android Development] sniperkill:
So should this script be ran before, or after any mods are made to the device?
[Epic 4G Android Development] MysteryEmotionz:
After

Haterz gonna hate. Just keep hatin. I brush them haterz off. It ain't my fault my epic's e-penis is bigger then the evo's e-penis.
[Epic 4G Android Development] sniperkill:
LMfAO!!	Thanks bro. Oh since I got you, 1 more question plez. If I'm tryen to run th8s script within my phone, the README text says I gotta put the contents of the ODEX file in my data/local/tmp, is this correct? Then I run the odex.sh comands from within terminal elumator?
[Epic 4G Android Development] musclehead84:
I love this tool and it worked perfectly to odex my rom but when I tried to restore I lost my baseband version (said unknown) and I got like 10 force closes. Anyone know how to fix this. I just dud a nand restore but I would love to do this again.

Sent from my Evo Killer!!!
[Epic 4G Android Development] sinman02:
when I ran this, it ran smoothly until about two thirds in...I started getting a bunch of force close messages for things like, handscent, phone, android processes...then I started seeing my boot animation like it was doing a hot reboot. Meanwhile the script kept running and was saying that things were getting process successfully... Then the script said it was done and the phone did an actually reboot. After about a minute to settle in...it seems fine...other than missing a few shortcuts. Is this normal? I noticed I gained about 38MB in internal memory and saw that there was about a 98MB odex folder added on my sd card. I think next time I try this, I'll turn on airplane mode first...
[Epic 4G Android Development] musclehead84:
Yeah that is exactly how mine went. That folder has to be.there to.restore. my problem was restoring. It did everything fine but I lost my modem. Had to do a nand restore.

Sent from my Evo Killer!!!
[Epic 4G Android Development] BeerChameleon:
So now that we have this, we can now have a deodexed rom theme it then goto odex and still have the theme and mods (ie: power mods)? Also does mobile ap work after it goes to odex?
[Epic 4G Android Development] BeerChameleon:
Did u try reflashing the modem? Just a thought??
[Epic 4G Android Development] yogi2010:
sorry if this is a basic question, but once you have the odex folder on your sd card, and you reflash a deodexed ROM, will it be odexed once you boot up? the reason i ask is i reflashed Syndicate ROM, then went to run this one-click, and the script said my system was odexed.
[Epic 4G Android Development] sinman02:
I didn't lose my modem when I restored...everything deodexed fine,...furthermore, the odex folder was still there, only empty...

Just for kicks, I tried the "manual method":

"Manual Usage:

This package includes a script called odex.sh to perform the functions with direct user control. To use that script instead

of the one click method do the following:

push the contents of the odex folder to /data/local/tmp on your handset via adb

login to your handset via adb or local terminal

su to root (if required)

chmod 755 /data/local/tmp/odex.sh

execute /data/local/tmp/odex.sh

select your desired action from the menu"

I didn't understand the instruction "push the contents of the odex folder to /data/local/tmp on your handset via adb" so I copied the "odex" folder using root explorer to the /data/local/tmp/ directory and entered

chmod 755 /data/local/tmp/odex.sh

execute /data/local/tmp/odex.sh

using android terminal emulator... I get the message: "Execute: not found".

What am I missing? Is there an "adb" app that I should be using?
[Epic 4G Android Development] sniperkill:
If I'm not misaken, it said to copy/push the "contents" of the odex folder to data/local/tmp. Not the actual odex file...
[Epic 4G Android Development] sinman02:
That's exactly what I did...ie. copy the contents, not the folder...didn't work..., I don't know what "push" using adb means... I thought the whole point was to be able to do this from the handset without a computer. The only adb app I found is adb wireless... Is this what it's referring to?
[Epic 4G Android Development] readermo:
i believe to "push" something just means to copy it from your computer to your root folder. don't quote me on this, but i THINK this can be done by copying it to your sd card, then using Root Explorer (from the market) to copy and paste it to the root folder.

smart people: please correct me if i'm wrong.
[Epic 4G Android Development] tanimn:
This script odexes all the jars, that's an all or nothing proposition. The apk's in /system/framework are selectively odexed. Original versions of the script completely odexed that folder, but the excessive amount of 3rd party apps in there,coupled with their incessant update requirements caused me to scale back it scope.

With that being said, you are welcome to modify the script to cover as many apks as you can process, but be aware that you may have applications affected in system when you effect updates.
[Epic 4G Android Development] sinman02:
Exactly what I did,...didn't work... :o(
[Epic 4G Android Development] BeerChameleon:
BUMP.. @tanimn
[Epic 4G Android Development] tanimn:
Yes. ;-)

Mods REQUIRE a deodexed system to start from. When this completes the first time, it leaves your system incompatible with applying mods until it is run again to undo it's changes.
[Epic 4G Android Development] sniperkill:
To "push" means to open adb from a pc and type "adb push (place app name here) system/app so you can install to ur phone using adb...
[Epic 4G Android Development] BeerChameleon:
While im waiting for deodexed rom to download.. anyone try mobile ap after using this as well do the power options stay after odexing from the deodexed rom?
[Epic 4G Android Development] tanimn:
Yes, the purpose of this script is to odex customizations. I'm running emotionless beast with a few bells and whistles odexed right now.

I don't know about mobileAP, but wireless tether works just fine.
[Epic 4G Android Development] BeerChameleon:
Nice so it has the power mods on odexed? Im anxious to try mobile ap, damn download at work is slow still have like 15 min, damn slow work internet. lol
[Epic 4G Android Development] BeerChameleon:
Another Question,

If i do this if i want to a flash another rom do i have to undo it or will the rom flash change it back to how that certain rom is?
[Epic 4G Android Development] yogi2010:


that's sort of what I was wondering, because I flashed a deodexed rom, then ran the script, and right away it said my system was odexed. I didn't want to stop it suddenly, so I let it restore everything.
[Epic 4G Android Development] tanimn:
The script bases it's decision on the existence and contents of the /sdcard/odex folder. Future versions will have better state and version tracking but as of now the safest method for this script to "restore" is to just put all the files that it modified back into their original places and conditions. By doing it with this method, even cross rom flashes SHOULD still be bootable if you accidentally restore the wrong deodexed files.

Clearing the /sdcard/odex folder is required if you are flashing roms over systems odexed with this script with the intent to odex the new framework.
[Epic 4G Android Development] tanimn:
execute is not actually a command, it's an instruction...

As in execute "/data/local/tmp/odex.sh<ENTER>"

you can "cd /data/local/tmp && ./odex.sh"

or "sh /data/local/tmp/odex.sh"

or "cd /data/local/tmp && sh ./odex.sh"

...
[Epic 4G Android Development] BeerChameleon:
Cool, so im still kinda a little confused sorry, but what your saying is if i want to flash a new rom i should restore it back to deodexed? What if im going from a deodexed rom that was odexed from this and i flashed the stock d118 update zip which is also odexed?

Thanks for the quick responses and all your hard work on this, im going to test mobile ap with emotionless beast theme when i get home, im hoping it will work perfectly with all power mods in tact and mobile ap should work considering this is turning all the files odex. :)
[Epic 4G Android Development] SINNN:
Which one makes the epic go 15% faster? Deodex or odexer?
[Epic 4G Android Development] BeerChameleon:
Odexer.. :D
[Epic 4G Android Development] tanimn:
If the script detects a deodexed backup in /sdcard/odex when it is run, it WILL restore that backup with no consideration for any changes made since it's last run. At this time, this is the best method to return you to a working system (it was working when the script ran the first time...)

Future releases will have better version control and detection, but we are modifying part of the underlying system which needs to be approached very delicately.
[Epic 4G Android Development] thomasskull666:
Very true, I was wanting to try this and not by my computer, so I edited the OneClickOdex.sh to replace adb push commands with cp commands and whatnot. Well needless to say the system does not like being odexed while running lol. Massive list of endless FCs from all of the system apps, but thankfully the script was still running in the background (Gscript for anyone who cares) and completed then reboot.

All was fine, I noticed a pretty significant speed increase as well as more internal storage space which is a plus. For anyone looking to do this for the performance benefits, I would recommend it highly. Odexed is always better than deodexed, but being a themer I can't really do a whole lot with an odexed framework-res so I never messed with it.

But now that this converts even modified frameworks, I don't see why we shouldn't have all ROMs odexed after they are finished. It would be possible to bundle the one click odexer files with the ROM .zip and then have CWM initiate the OneClickOdex.sh that gets transferred as well during the flashing of the zip. But then flashing themes would kind of be out of the question lol

Just a thought. You are a genius tanimn, figure it out ;-)

Sent from Carl Sagan through the Cosmos
[Epic 4G Android Development] sinman02:
Sweet! I just de-odexed then re-odexed my phone, just using terminal emulator...no adb required! Awesome mod! I agree, this should be tacked on to all custom roms going forward!!! It's like giving your rom a lyposuction!!!

One oddity: before I de-odexed, I had 132MB free, after I de-odexed I had 92MB free,...when I de-odexed again (all non-adb method), I only had 105MB free... It seems I lost free space... Maybe the odex process didn't complete using this method???
[Epic 4G Android Development] tanimn:
On what partition(s)?

/system should grow and /data should shrink when you odex, and vice versa when you restore. the size of /system should directly correlate to the state that your handset is in, but /data grows and shrinks constantly.

Also: this script doesn't deodex, it odexes and restores. If baksmali can be shown to run safely, consistently, and quickly on the handset, then device side deodexing might be an option in future releases. But as of right now, there are too many "what-ifs" with baksmali to use safely in this fashion.
[Epic 4G Android Development] sniperkill:
So can you, or you cannot run this script within terminal emulator from the phone? Cuz I read in the op that it was designed to be ran from within the phone, we'll, that and from a pc, but now I'm reading from Thomasscull666's post, he had to edit the odex.sh file??? So can this be ran thru terminal emulator without changing any files??

Sorry for my confusion..
[Epic 4G Android Development] sinman02:
I meant restore...thanks for clarifying... Regarding the size of available memory, shouldn't it stay relatively the same if running this script consecutively? I started with 98, odexed using the script and went to 132, restored using script came to 92, odexed again to 105. That's a pretty big swing from 132 to 92... I'm on the ext4/no journal partition, using midnight 3.0, based on Bonsai 2.0.
[Epic 4G Android Development] Zeinzu:
What numerical values and/or tests resulted in ur 15% speed increase claim?

Sent from my Epic 4g
[Epic 4G Android Development] BeerChameleon:
Well I'm on a custom rom with theme and reboot option now just waiting to odex so I can have mobile AP back and make my phone better. My needs to get off the computer and goto class!!! Grr

Sent from my awesome epic 4g
[Epic 4G Android Development] MysteryEmotionz:
I know nooble said awhile back that a odexed system is 10-15% faster. Honestly I don't think there is a way to test the actual didference in numbers. what I do know is my phone boots 12% faster then de odexed(boot times is the only way I can see getting a number). The phone feels faster and smoother. I don't think having the system idexed would effect any of the benchmark apps. You have to go off of real work feel .

Tanim feel free to chime in

Haterz gonna hate. Just keep hatin. I brush them haterz off. It ain't my fault my epic's e-penis is bigger then the evo's e-penis.
[Epic 4G Android Development] Gersonian:
Needs a sticky!

Was frightening when I hit the SAMSUNG boot loop, but ran the nand backup and when it came back was odexed. Highly recommend for folks looking for performance and memory enhancements. I also think this needs a sticky!
[Epic 4G Android Development] BeerChameleon:
Worked Great and perfect for me, i got noobnls deodexed rom now odex, reboot option thanks to mysterys download for tw lockscreen with reboot. and mobile AP on a custom rom and theme so awesome!!!!

Hey mysteryz could u make a lockscreen download with power options? that would be sweet.
[Epic 4G Android Development] MysteryEmotionz:
I do on 2.1. Its in my thread. Its to much work to do on a froyo leak.

Haterz gonna hate. Just keep hatin. I brush them haterz off. It ain't my fault my epic's e-penis is bigger then the evo's e-penis.
[Epic 4G Android Development] readermo:
i'm running bonsai 2. the script completes and the phone reboots. gets stuck on the samsung screen. then goes through that same cycle infinitely. same problem described in earlier posts. has anybody figured out how to fix this?

thanks!
[Epic 4G Android Development] MysteryEmotionz:
I'm running bonsia 2 and haven't had any problems

Haterz gonna hate. Just keep hatin. I brush them haterz off. It ain't my fault my epic's e-penis is bigger then the evo's e-penis.
[Epic 4G Android Development] BeerChameleon:
Reboot only lock screens downloads are there unless I missed some with all power option.

Sent from my awesome epic 4g