• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Dalvik-Cache Cleaner Script

savoxis

Android Expert
So. I decided to get off my high horse and do some thinking.

It is POSSIBLE that when you delete applications thru the Application Manager the dalvik-cache (dex file) could be left behind.

Just because I personally have not experienced this does not mean it is not possibly a bug. So I made an init script, this script will go thru your dalvik-cache comparing the dex files within with your installed applications. When it finds a dex file that does not have an application associated with it it will remove the dalvik-cache entry.


This package is a recovery flashable zip, it will work on any rom that supports init.d scripts and even on roms that do not, if you run the cleaner manually.

After you flash this it will automatically run during init.

You can manually run thru a rooted terminal by typing dalvik-cleaner

like I said, I havent had any problems with this, but I keep my app turnaround low and my mtds clean. I could see this helping a few of you where your old dalvik cache entries are somehow not getting erased, or if you manually delete apks,
 
If you have Titanium you can also clean up you Dalvik Cache. I used the Dalvik Cache cleaner in Titanium and got back about 15mb.
 
If you have Titanium you can also clean up you Dalvik Cache. I used the Dalvik Cache cleaner in Titanium and got back about 15mb.


Wait how do you do that because titanium only backups and restores
 
Wait how do you do that because titanium only backups and restores


The pro version had an option to clean up dalvik cache and market dr, fixes broken market links dont know if it requires pro or not. It can also sync all backups to dropbox in pro version.
 
LOL! titanium does much more than backup & restore open it up, press the phones menu key and choose "more"


Wow never saw that before. I fell like an idiot. But doesnt clean that cache
 
So. I decided to get off my high horse and do some thinking.

It is POSSIBLE that when you delete applications thru the Application Manager the dalvik-cache (dex file) could be left behind.

Just because I personally have not experienced this does not mean it is not possibly a bug. So I made an init script, this script will go thru your dalvik-cache comparing the dex files within with your installed applications. When it finds a dex file that does not have an application associated with it it will remove the dalvik-cache entry.


This package is a recovery flashable zip, it will work on any rom that supports init.d scripts and even on roms that do not, if you run the cleaner manually.

After you flash this it will automatically run during init.

You can manually run thru a rooted terminal by typing dalvik-cleaner

like I said, I havent had any problems with this, but I keep my app turnaround low and my mtds clean. I could see this helping a few of you where your old dalvik cache entries are somehow not getting erased, or if you manually delete apks,

Thanx for going out of your way to make something like this! I have what is probably a stupid question, but is this just a one time cleaning, or does this zip clean as needed automatically? If that makes sense..lol
 
Thanx for going out of your way to make something like this! I have what is probably a stupid question, but is this just a one time cleaning, or does this zip clean as needed automatically? If that makes sense..lol

I am sorta wondering this myself...
 
I don't know if I did this right please tell me if I am wrong:
Steps
1) Put file on sd card
2) Went into recovery and made a backup
3) Installed it from my sd card
4) Rebooted
5) Went into terminal emulator and type in dalvik-cleaner
6) Rebooted my phone

Is that right?
 
I don't know if I did this right please tell me if I am wrong:
Steps
1) Put file on sd card
2) Went into recovery and made a backup
3) Installed it from my sd card
4) Rebooted
5) Went into terminal emulator and type in dalvik-cleaner
6) Rebooted my phone

Is that right?


It appears you missed giving "su" permissions in step five.
 
Back
Top Bottom