yashsingh1/xdaforums huggingface dataset:
[GT540 Optimus Android Development] nibras_reeza:
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.
[GT540 Optimus Android Development] lukemovement1:
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.
[GT540 Optimus Android Development] Danzano:
I'm on m6 and want to odex including framework how do I do this?
[GT540 Optimus Android Development] nibras_reeza:
Read start post. :)

And, to odex framework, you need to modify the line which says cd /system/app to cd /system/framework in odex.sh and go through same procedure.

I odexed framework but it made my ROM very unstable. :(
[GT540 Optimus Android Development] Danzano:
Hmmm maybe not such a good idea then
[GT540 Optimus Android Development] Danzano:
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?
[GT540 Optimus Android Development] eoghan2t7:
what way did you try and odex the rom?
[GT540 Optimus Android Development] Danzano:
the quick windows way
[GT540 Optimus Android Development] eoghan2t7:
have you want to the system/app folder to see if any odex files there?
[GT540 Optimus Android Development] Danzano:
system/apps all apks no odex
[GT540 Optimus Android Development] eoghan2t7:
try using script manager and set the script to run on boot to see if it work that way.
[GT540 Optimus Android Development] Danzano:
For the advanced method what's the exact commands etc
[GT540 Optimus Android Development] eoghan2t7:
what advanced method?
[GT540 Optimus Android Development] Danzano:
The instructions for advanced users arnt that clear
[GT540 Optimus Android Development] nibras_reeza:
This means the script is unable to access log.txt. This happens if there was a unsuccessful idex attempt. This is a Windows issue. Just make a copy of the whole folder and run again or try clearing the log.txt.
[GT540 Optimus Android Development] nibras_reeza:
On linux or Windows?

you have to use adb push odex folder with odex.sh to /data/odex/ and then type adb shell chmod 4755 /data/odex/odex.sh

Then, adb remount system

Then type adb shell sh odex.sh

That's all for odexing.

Then, clear dalvik cache and reboot. Do a factory reset if possible(not important but its a good idea).

The reason Ive omitted exact procedure is because different people have different prederences.

.
[GT540 Optimus Android Development] Danzano:
Thanks for you're help :)
[GT540 Optimus Android Development] nibras_reeza:
Welcome.
[GT540 Optimus Android Development] Danzano:
If odexing a de odexed rom much easier and bat file works on partially odexed rom bat doesn't work why is this?
[GT540 Optimus Android Development] Danzano:
just odexed m6 tends to glitch at times screen goes black then reappears also root explorer seems to work then doesnt im thinking might have to re install but system does seem faster im also going to change default low mem settings see if it helps
[GT540 Optimus Android Development] Danzano:
how do i uninstall then re install root explorer etc
[GT540 Optimus Android Development] nibras_reeza:
Use full stops and periods. lol I had a hard time grabbing what you said.

Hmm, the bat would still work in partially odexed ROM. The bat merely saves you a few commands for remount, reboot, copying scripts etc. If you run it on a partially odexed ROM, it would throw in a few errors but nothing will break.
[GT540 Optimus Android Development] nibras_reeza:
I had problems with Root Explorer. I do not know why. Just remove it using Root Uninstaller.

You can reinstall Root Explorer from Market but if you want to reinstall, remember to clear data of Root Explorer before you uninstall.

And, I'd recommend using File Expert which happens to be my personal favorite. It replaces Astro, Root Explorer and Notepad. It especially helps me with its easy to launch FTP/HTTP sharing of SD.
[GT540 Optimus Android Development] Danzano:
File expert rocks thanks heaps!!
[GT540 Optimus Android Development] Danzano:
If you download a new app or two can u odex again?

What I mean is will it odex the new apks and skip what's already been odexed?
[GT540 Optimus Android Development] nibras_reeza:
System apps are rarely updated. Might I remind that this odexed only apks in system/app and not data/app?

Usually, updating will break the app. So, after every update, you need to delete the odex file and odex the ROM again. This script will throw in an error if the apk is already odexed but it won't break anything. This script is suitable for both unodexed and partially odexed ROMs.

I'm looking into odexing user apps. I odexed mine but the problem is automatically running the script after the app is updated.
[GT540 Optimus Android Development] desmail:
I tried the ODEX greendroid v.2 Rom, with the script for windows, ok!

go with rootexplorer system/data and do not see any files .ODEX. where I went wrong?

you can do with rom eclair?
[GT540 Optimus Android Development] nibras_reeza:
Stock ROMs are odexed.

What output did you get when you ran the script?
[GT540 Optimus Android Development] desmail:
Welcome to Nibras's auto odexer for Windows.

============================================

"Make sure you have made a NAND backup before proceeding."

This script will *attempt* to odex all apks found at /system/app.

Therefore, it must be noted that theming would be impossible once

the ROM is odexed. However, 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.

***************************************************************

===============================================================

[ ]

[ 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 CONSQUENCES ]

[ OF RUNNING THIS SCRIPT. ]

[ ]

===============================================================

***************************************************************

"DO NOT RUN THIS ON AN ALREADY ODEXED ROM."

"Make sure you have made a NAND backup before proceeding."

"Press CTRL + C to exit... "

Premere un tasto per continuare . . .

It's recommended that you switch on airplane mode on your phone

to avoid any interruptions. Please connect it via USB and make

sure USB debugging is enabled.

"Make sure you have made a NAND backup before proceeding."

Premere un tasto per continuare . . .

push: odex/zipalign -> /data/odex/zipalign

failed to copy 'odex/zipalign' to '/data/odex/zipalign': Is a directory

Staring odexing... It might take a few minutes to finish...

Your device is now odexed.

Premere un tasto per continuare . . .

this is my output-script.
[GT540 Optimus Android Development] chaudha4@hotmail.com:
Can I use this on Data2System ROM

I have M6 d2s running. Can I use this batch file on that. Probably not. What changes are required to run this batch file on d2s roms ?
[GT540 Optimus Android Development] Danzano:
Bat file zipaligns aswell?

And what needs changing to do user apps?

I wanna be able to odex everything but the framework.

Get it right now so its easier in m7 up ;)
[GT540 Optimus Android Development] nibras_reeza:
Hmm. Weird output? Why is it saying zipalign is a directory? :/
[GT540 Optimus Android Development] nibras_reeza:
Provided you have enough space in system partition, this would work. I'm not familiar with d2s but as far as I know, d2s basically uses part of system partition for data. It doesn't modify apks. As long as you have 15% free space in system partition,this would work.

I'm using mur4ik's modified kdz.
[GT540 Optimus Android Development] nibras_reeza:
The bat only automates odexing. Zipalign is done by odex.sh which does all the hard work.

Hmm for user apps, just change cd system/app to cd data/app in odex.sh found in odex folder. I tried odexing user Apps. It works well but as things are now, whenever an app is Updated, you need to delete its odex file and odex new apk again. This is lot of work. Am looking into automating this. This would need an app. I'm talking with Root Toolbox author about this. I'm waiting for his reply.
[GT540 Optimus Android Development] Danzano:
So if you built as an app you could automate odex for both system and user and automate zipalign?

If you added v6 supercharger script and added options on boot on demand etc would be the best app!!!!
[GT540 Optimus Android Development] nibras_reeza:
Yes but unfortunately, I'm busy theseadays and so can't work on an app. That's why I asked Root Toolbox author to do it.

This script will do zipalign as well. Nothing to change. I meant in the sense, odex.bat copies odex.sh and runs odex.sh in adb shell. odex.sh odexes and zipaligns.
[GT540 Optimus Android Development] bataya:
Hi, i have problem odexing green droid 2.0. When use odex.bat i get error foult <no status>, and then phone reboot. Any idea?
[GT540 Optimus Android Development] nibras_reeza:
The adb is at fault.

Try transferring a file of around 50MB from PC to SD using the USB and see if it's stable.
[GT540 Optimus Android Development] nibras_reeza:
Please try running an integrity check on the phone's NAND using JDisk Benchmark and run an integrity check on your PC hard disk. It appears that for some reason, your copy of files are corrupt.
[GT540 Optimus Android Development] desmail:
I just flashed mur4ick v.2 RC0 and I tried the script for ODEX. everything works without errors. perhaps problems with the 2.1
[GT540 Optimus Android Development] nibras_reeza:
It should work on 2.1 as well. However stock 2.1 is already odexed. So, no point in running it on stock 2.1.

The user who had problems on greendroid reported no status error which is the error given by ADB when the connection is terminated suddenly or when the phone's adb is malfunctioning.
[GT540 Optimus Android Development] bataya:
I try to transfer ~100MB, all go ok.

:confused:
[GT540 Optimus Android Development] bataya:
I try to boot in recovery, mount system and data (adb remount dont work for me :( ), then run

adb shell mkdir /data/odex

adb push odex /data/odex

adb shell chmod 4755 /data/odex/odex.sh

start /wait adb shell sh /data/odex/odex.sh

wipe dalvik cach, and reboot, but after that i get stack in boot loop.
[GT540 Optimus Android Development] nibras_reeza:
That's odd.

First make a complete NAND backup and a complete backup with MyBackup Root or Titanium Backup.

Reboot into recovery or fastboot.

Wipe user data/do factory reset.(Wipe cache and data.)

Wipe system and boot.

Flash a fresh copy of boot.img and system.img.

Boot into the fresh system with no user data and do the odexing. Reboot.

If you get stuck in boot loop after this, it's something to do with your ROM.

If everything works fine, do an Advanced Restore for data, sd-ext and .android_secure if applicable. Do not restore cache. Then, within recovery, go to Advanced and wipe dalvik cache.

Now, reboot and you should have everything working fine. If you get stuck when you restore data, do a factory reset and try restoring from MyBackup/Titanium.
[GT540 Optimus Android Development] bataya:
thx work now.
[GT540 Optimus Android Development] chaudha4@hotmail.com:
If I odex and then take a backup and then do a restore, do I have to redo the odex again ?
[GT540 Optimus Android Development] bataya:
lol, what do you think?
[GT540 Optimus Android Development] chaudha4@hotmail.com:
I think I don't have to odex it again. I also think that the battery should last 1 month. But it doesn't matter what I think. My question was not what I think :D
[GT540 Optimus Android Development] nibras_reeza:
It depends on what kind of back up you mean.

NAND backup means that the odexed version will be backed up since the whole image is backed up.

If you are talking about MyBackup Root or Titanium Backup, they will backup/restore only data for system apps. You'll have to odex again.
[GT540 Optimus Android Development] Danzano:
Has the root toolbox dev got back to you?

sent from my gt540 running mur4ik RC-X 825mhz q-score 1140
[GT540 Optimus Android Development] nibras_reeza:
He replied but he didn't update me on progress. I'll be able to make a script or app by myself when I get the time. It might take around another 2 months. I have exams in August.
[GT540 Optimus Android Development] Danzano:
Algud :) also in the app installing apps to system would be cool :)

sent from my gt540 running mur4ik RC-X 825mhz q-score 1140
[GT540 Optimus Android Development] nibras_reeza:
Installing app to system is simple as copying the apk and changing the permissions though.
[GT540 Optimus Android Development] Danzano:
Yeah but it would be a time saver lol I just hate going in and out of five different folders copy paste copy paste :(
[GT540 Optimus Android Development] eoghan2t7:
why dont you just muilti select the apps you wish to copy then paste them all at once lol
[GT540 Optimus Android Development] Danzano:
True I just thought would be cool to have all in one toolbox so to speak
[GT540 Optimus Android Development] nibras_reeza:
There's file manager which can open two folders at once. Dual File Manager I guess. Can't remember the name properly. And, did you notice the 2 months timeline I mentioned? lol
[GT540 Optimus Android Development] Danzano:
Yeah I did lol best of luck with the exams to :)
[GT540 Optimus Android Development] nibras_reeza:
Yea lol. Need God's help badly.
[GT540 Optimus Android Development] effortless.:
Using Root Toolbox, or odexing your phone won't BRICK IT. Please understand that a bricked device is one that is unrecoverable, to the point it will no longer function AT ALL. In the event that odexing fails, all you need to do is reflash the ROM or use recovery to restore a backup.
[GT540 Optimus Android Development] nibras_reeza:
Well, I know that but bricking is used more loosely nowadays. =P It just means, things might go awfully wrong.
[GT540 Optimus Android Development] Danzano:
could odexing break custom swap?

or should i re run everything first and check because swap was fine before odex broke after twice so far ill run again and check but just seemed wierd because odex shouldnt go anywhere near init.d probably my fault somewhere in the build but if it happens again ill let you know
[GT540 Optimus Android Development] nibras_reeza:
Odexing will not do anything to swap unless you used swapper 2. I haven't tried odexing swapper 2 and so it might break.

If you are using swapon with init.d, nothing should go wrong. Swapon is a busybox applet found in system/bin or system/xbin. Odex only modifies apks.

And, what did you mean by swap broke? What happened? It's possible that swap usage might be reduce if you odex since odex uses lesser memory. And, since odex are optimized to use less memory and be faster, you might see a performance hit(or rather, you will not notice the performance gain due to odex) if your swap is on a slow SD like class 4. Alternatively, you will see a good performance boost if your SD is fast.
[GT540 Optimus Android Development] Danzano:
Fixed it now after re doing the softmod God knows what I did
[GT540 Optimus Android Development] nibras_reeza:
I had similar problem and I realized that the problem was editing the swapon script.

Most apps can't directly edit text files in system partition. So, you copy them to SD, then edit it and you move back. The problem comes if you copy to a FAT32 partition for editing! FAT32 doesn't support linux permissions and so when you copy, executable permissions are lost. So, when you copy back, you have chmod again.
[GT540 Optimus Android Development] androidboss7:
Sorry for the noob question but what is odexing????

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] nibras_reeza:
Sighs. Google it. It's a long explanation and has been talked about in many places.
[GT540 Optimus Android Development] androidboss7:
Ok!!

But what is it overall??

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] Danzano:
It is the process of extracting part of the app and storing it outside of the app optimizing it for vm that would be the ruff short answer

But seriously go to mygt540.com and look at the article what is odexed and deodexed it explains all in great detail but also in a understandable way if you're new

Hope you find what your looking for :)
[GT540 Optimus Android Development] nibras_reeza:
Convert regular dex files to optimized dex files which are more memory efficient.
[GT540 Optimus Android Development] effortless.:
It actually, it doesn't optimise RAM, it just makes your first boot faster because it doesn't have to pre-extract the .dex etc.
[GT540 Optimus Android Development] nibras_reeza:
It optimizes RAM usage. There is more to it than just the speed of first boot. It also reduces memory usage due better memory allocation.

Odexing doesn't provide a benchmark performance boost but it does give a visible performance boost. You can read about it all over internet. This has been discussed and explained in OP as well.
[GT540 Optimus Android Development] effortless.:
It has nothing to do with RAM optimisation, it makes your first boot faster as the Dalvik VM doesn't have to compile the odex file again. There are no long-term benefits from odexing. Dalvik doesn't control the memory, thus odexing doesn't optimise memory.
[GT540 Optimus Android Development] nibras_reeza:
Dalvik does use RAM. Dex and Odex are application code compiled from app source.

An odex file is simply more efficient in memory usage.

You can have a look at http://www.netmite.com/android/mydroid/dalvik/docs/dexopt.html
[GT540 Optimus Android Development] airbus360:
Before I odexed AOSP 2.3.5 it was giving 45-50mb of free memory; After it can have up to 90-95mb free memory. @nibras you are corrected :P
[GT540 Optimus Android Development] effortless.:
I'm just sayin' in theory it shouldn't give you more RAM, also I didn't say that Dalvik doesn't use RAM, I said it doesn't handle RAM, the built in 'memory killer' does that.
[GT540 Optimus Android Development] nibras_reeza:
Thanks.

Have a look at the link I gave. Dexopt creates some platform specific unsafe but faster code than compared to DalvikVM's. This is why you have to odex after you change ROMs(or the ROMs should be odexed beforehand in an identical device.).

And, dalvikvm does handle RAM, it's called garbage collector. Also, dalvik maintains VM heap size which also affects RAM usage. Of course, dalvik doesn't handle RAM at a low level. The Linux kernel does that. Memory killer? You mean task killer? The OOM groupings and stuff? This is the process that ensures enough memory is there to open new apps. It just keeps a certain amount of memory free. It doesn't handle memory.
[GT540 Optimus Android Development] Danzano:
Nibras +1

Effortless sorry bro 0
[GT540 Optimus Android Development] androidboss7:
Thanks!!

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] nibras_reeza:
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.
[GT540 Optimus Android Development] androidboss7:
Gonna try it!!!

But can that method brick the phone??

And also what is deodexing??

And would it work on LG gt540??

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] Danzano:
No it will not brick your device however it may break apps so back them up

If any break reinstall after as this its a one off process

Yes it works on gt540

And if you're using swift Droid your already on a deodexed ROM

If not look up how to check how to do etc google is all mighty

Hope that helps ;)
[GT540 Optimus Android Development] androidboss7:
Thank you!!

and yes i am using swiftdroid thanks to mur4ik!!

Going to try it NOW!!

Edit : is su terminal Eliminator???

Also do I use enter to separate each command??

And lastly how much ram does it free up???

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] androidboss7:
This is what happened!!

anyone help??

I run 2.3.5 cyan.

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] effortless.:
Its not dalvik-cached, its dalvik-cache.
[GT540 Optimus Android Development] androidboss7:
Oh!!

Thank u!!

Trying again!!

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] androidboss7:
This is what happened!!

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] Danzano:
Super user and separate commands when you re boot re boot again wipe dalvik cache etc so 2 re boots

If you get 50mb now you might see 62mb its different on device and setup
[GT540 Optimus Android Development] nibras_reeza:
Are you a troll?
[GT540 Optimus Android Development] androidboss7:
Maybe??

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] androidboss7:
Yeah thank you everyone!!

I did it!!!

I don't really see much of a

difference but still it

feels a bit faster!!

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] Danzano:
You should see around 5mb more ram and snappier feeling device
[GT540 Optimus Android Development] androidboss7:
Yeah it's about that much!!

anyways Thank you!!

Goππa ®o©k & ®o//
[GT540 Optimus Android Development] Danzano:
All good bro hope your enjoying your gt540 as much as the rest of us :)
[GT540 Optimus Android Development] nibras_reeza:
5MB? Or 50MB? I'm able to reach up to 90MB free compared to the previous 60MB. But, fortunately or unfortunately, my device stacks up more apps into the memory and manages to fill it somehow.
[GT540 Optimus Android Development] Danzano:
5mb however that's with my custom maybe with stock you would see a more substantial increase due to less tweaks etc
[GT540 Optimus Android Development] nibras_reeza:
Did you run a task killer or are you reporting values without a task killer? I usually use this method to check free memory.

First, I boot in before tweak. Let the phone run for a while. Switch to airplane mode and kill all apps. (60MB)

Then, apply tweak. Reboot. Let phone run. Switch to airplane mode and kill all apps. (80-90MB)