Dalvik cache cleaner is a shell script which clears the Dalvik cache that can be used with Android Terminal Emulator.
Root and busybox is required, if you don't know what root and/or busybox is then do NOT bother using the script.
Place the shell script in the main directory.
With Android Terminal Emulator type:
su
sh /sdcard/Dalvik_cache_cleaner.sh
The process should be close to instant depending on how much files you have in the directory.
Download: http://caftp.3owl.com/Shell_Scripts/Dalvik_cache_cleaner/Dalvik_cache_cleaner.sh
It worked
~~~~~~~~~~~~~~~~~~~~~
Samsung galaxy s2
Rom: Jedi knight 6
kernel: Jedi kernel 2
~~~~~~~~~~~~~~~~~~~~~
And you thought celebrities weren't smart! =P
Is this also intended to run on every boot, ie via init.d
thebrainkafka said:
Is this also intended to run on every boot, ie via init.d
Click to expand...
Click to collapse
No, that would also waste too much time on boot then on a normal boot due to rebuilding the cache everytime.
When you uninstall an application, usually a dalvik cache file is left over wasting space.
But if you want you can use ROM Toolbox from JRUMMY APPS INC. in the Play Store.
There is a Scripter in that application that you can use for such thing but the problem is that when I tryed using the su binary in the shell script, there is an issue where the su binary in the shell script will just cut off the other parts of the script and only the su binary so your answer would be fat chance unfortunately. :/
Sent from my Sony Tablet S using xda premium
Issue fixed.
Is this the same as wiping dv cache through recovery. Also what will be the script for wiping cache? Will it be rm /cache?
Thanx!
The-Droidster said:
Is this the same as wiping dv cache through recovery. Also what will be the script for wiping cache? Will it be rm /cache?
Thanx!
Click to expand...
Click to collapse
Yes and the code is:
#!/system/bin/sh
rm /data/dalvik-cache/*
reboot
Click to expand...
Click to collapse
I'm not sure if /cache/ is really dalvik cache, on devices with OTA update support the OTA zip's will be stored their with other stuff but if you want I can give you the code for that.
On linux (That also means android) use 'chmod 755' for the permissions for the shell script.
I have tried adding 'su' but that fails has the terminal only executes the su binary so the rest of the script does not get executed.
Using the 'echo' binary to say out what it is doing is a fail has the terminal does not go anywhere due to the echo binary getting executed but it will not display output in the terminal anyway making the script not being executable.
Sent from my Sony Tablet S using xda premium
Man I am full with ideas.
I can create a shell script to do:
[OTA]
Remove OTA Update zip in cache
Copy OTA Update zip from cache to SDCard
[Files and Folders]
Remove LOST.DIR (That is just a useless folder )
Wipe SD Card
Wipe Zip files (useful for custom roms on your SD which you don't want anymore)
Well soon I should get more ideas so the OTA shell scripts will not be possible unless I get a rootable device with OTA functionallity (I do have a Sony Tablet S but I forgot to root it but I went and installed the firmware update without noticing) so it would be the Nexus 4 I would test it on in March.
The thing is that more shell scripts I create more pages I have to add to my website to give information about it, how to use it and the download link which can take around 10 Minutes just by editing the code, make backup and then upload via FTP.
Sent from my Sony Tablet S using xda premium
New shell scripts available which should be available tomorrow and if not a few days.
They are:
Aptoide Cleaner - I found out that the xml files are adding numbers to their file extensions so I built a script which can remove that problem real fast.
Take Out Bin - Removes all or at least most useless directories like LOST.DIR and LazyList, they are just a few.
ExtSD and USB Cleaner - Same has 'Take Out Bin' but it does it on the external SD Card while on USB, LOST.DIR will be erased has that should not be there.
-OLDER PROJECTS-
Dalvik Cache Cleaner - Read the first post.
Andro.Shell.Crash - This is good for developers has this does crash/lag/freeze the OS which can help a root exploit get in, of course there is different effects depending on the hardware and software, if the device is fast and has good hardware then it is possible that it may just lag and/or freeze but for older devices with older hardware can just crash.
NOTICE: The older projects are already out and available to download on my website.
I will be creating a forum about these shell scripts but I am not sure about the Aptoide one for many reasons.
I know that I am not suppose to be talking about this on a thread which has a different purpose but yeah, just an update.
EDIT: I uploaded and programmed the webpages from my tablet using WM FTP Client and DroidEdit Pro so that was a bit too early but all well, new thread(s) should come in tomorrow depending what will happen tomorrow (It is 03:30AM so it would count has today anyway).
Anyone can please guide me how to remove this script???
Thank you in advance
romelcool said:
Anyone can please guide me how to remove this script???
Thank you in advance
Click to expand...
Click to collapse
You just delete the shell script, you only use it in the Terminal Emulator so once you run it, it will wipe the dalvik cache so it will not do such thing in every boot.
Sent from my Nexus 4
Man I think you should create a script which are:
Auto clean of cache || Optimize App || Kill Media Process
If it's possible to you to create script with the list below that will be awesome ! ..
what is the code for auto cleaning cache every 30 minutes ? ..
and also auto optimize application every 24 hours ? ..
kill media process ?
I hope you could help me with this .. Thanks !
CoolApps said:
Download: http://caftp.3owl.com/Shell_Scripts/Dalvik_cache_cleaner/Dalvik_cache_cleaner.sh
Click to expand...
Click to collapse
Gone!
jidanni said:
Gone!
Click to expand...
Click to collapse
That's because I switched sites between 2012 - 2015. This thread was very inactive so I missed it out and didn't update the link with the new one.
The current server I use for it has some files that I'm aware of that are more often downloaded by users which means I ended up removing the shell scripts along with others that don't need to be there. I made a backup of everything before, by the way.
I don't feel that there's a need restore the file and plus, this thread's old.
Because of the sudden bumps of a thread that currently serves no purpose, something should be done about it to avoid further confusions.
Sent from my Nexus 4 using Tapatalk
Can you please tell me what your script did.
I made my own script that does
su -c 'find /data/data/*/cache/* -delete'
This one line saved me from installing multi-megabyte apps that do the same thing.
Is there anything more I should add to my script?
Now I can finally have enough room so Google Play can update apps again!
Thread closed at OP's request.
Related
Hey Guys whenever i download any apps from market i get the error Install Unsuccessful .... Insufficient storage ...
What to do :-/
Rom Hell Fire v7.2
UOT Kitchen Flashed 1
Overclocked 729 Mhz
Wildfire
delete apps or move some to SD card? If your memory is full it's logical you can't add apps
Sounds to me that a2sd is not properly set up.
I been having some issues running out of storage internaly. and after some fiddeling around with a2sd it was ok. And how to do it is posted in this rom's explanation on how to install it.
ruymanca said:
The ROM takes about 10 minutes to start for the first time since the beginning makes for a facility, I recommend formatting the memory trageta do a clean install or possibly delete the folders: ANDROID, LOST DIR ANDROID as these folders SECURE conflicts created by data from the old roms
I recommend making partitions ie swap64mb ext512 and the rest as fat32 mind too expensive or necessarily recommend formatting the card will memory or possibly delete the folders in the same android, haer all the wipes, the Rom takes a few minutes to make first start since being installed all the extras on the first boot takes 3 to 5 minutes, once this echo this start and made previous settings obligation is to do a reboot for full functionality telefeno
Installation of the rom:
1. reboot in recovery mode
2. we wipes all
3. selected to install update sip
4. restart the tlf
5. enter the terminal console and register the following:
his press enter
# a2sd cachesd or enter
the phone will reboot and have about 150 megs of free internal memory
Click to expand...
Click to collapse
nope dint workk :-/
Type "su" first (Without Quotes), then try the a2sd command.
Can u mention it Step by Step?
Hi all, i have same issue.
Yesterday i finally rootat my Wildfire and put Cyanogenmod 7.0.3.stable on it.
Its very nice!
BUT cant allways install apps from market. I have 87mb free on inside memory and 1,7gb in sdcard... So what is problem?
What i need to do? I can full wipe all my data from telefone if somone tell me how i can do this..
Can somone help?
Use dalvik wipe from xrecovery to clean ur phone data..
Sent from my U20i using XDA Premium App
try istalling darktremor a2sd script (need to be istalled from recovery if not already integrated into your rom) and download a2sdgui from market, it's a gui for the script mentioned earlier. into recovery you have to partition your sd card too (advanced) 1024mb ext and i suggest 64mb swap, then open the app I told you (a2sdgui) and move everything to ext, dalvik cache too.
I agree with the poster above.
if you have issues with a2sd, I recommend installing A2SDGUI from market. (I assume you already have darktremors a2sd script installed). I had darktremors script working fine, but after flashing a zip file, it was not working. So I installed the A2SDGUI from darktremor and fixed the script. Now it is working. Just search the market and install it. It is great. Now I have around 168 MB free after all the installed apps.
Hope this helps,
SOLUTION TO INSUFFICIENT STORAGE:
1. Use FROYO+ default apps2sd. It gives the option to force moving of 95% of the apps to sdcard. Even root is not necessary. You can move 95% of apps only after using the adb command "adb shell pm setInstallLocation 2". This command is not even needed in cm7. And this method uses the fat/fat32 partition of sdcard not the ext partition. Specifically apps will be installed to .android_secure folder in the root of sdcard.
2. This method includes creating ext partition on sdcard and using an app called "link2sd". This is a root only app. No scripts are needed. That app has option to even link individual apps to ext partition. Also links dalvik cache.
3. Creating ext + swap partition and using dtapps2sd script. Root is required. Also custom recovery is required for flashing the script. This might be the toughest one but it is pretty awesome. Moves apps , data, dalvik cache to ext partition. Everything can be done with commands from the terminal emulator. Or you can use the "a2sdgui" app for graphical user interface.
Sent from my HTC Wildfire using XDA App
The GUI for the script is much more user-friendly than emulator terminal. And you can undo everything you did if it's not as you tought faster than from terminal.
I am not aware of how Hell Fire works. But yes for Cyanogenmod 7 I know there is a issue downloading a large application from the market. It won't download. Problem is the space.
Fix for this is few steps:
1. In Terminal type the following commands.
2. su
3. mkdir /sdcard/download-cache
4. cd /cache
5. mv download download.bak
6. ln -s /sdcard/download-cache download
Done... Now Go to market and download anything you won't get such errors..
If It Helps Don't forget Press Thank Button.
Thanks a lot!
I just get my new sd-card( 16 Gb) and install darktremor a2sd script + a2sdgui.
Works just like it says!
No more thinking what program van install and what not....
Well I just installed the MOdd Again ... and I was done
Though i bought Samsung Galaxy ace as its my second time the Touch Panel doesn't work ... first in Tattoo and den in Wildfire
So ... Thanx a lot guys for Helping
DestinyAwaits said:
I am not aware of how Hell Fire works. But yes for Cyanogenmod 7 I know there is a issue downloading a large application from the market. It won't download. Problem is the space.
Fix for this is few steps:
1. In Terminal type the following commands.
2. su
3. mkdir /sdcard/download-cache
4. cd /cache
5. mv download download.bak
6. ln -s /sdcard/download-cache download
Done... Now Go to market and download anything you won't get such errors..
If It Helps Don't forget Press Thank Button.
Click to expand...
Click to collapse
Working perfectly fine for me Thanks!
Hi,
I'm new to the business and I spent some time to learn the environment trying different applications and different approaches for almos every action I took. Today, I have not much bigger knowledge, but I finally decided to take few things in my own hands because existing software is not fulfilling my wishes.
I started with this simple script which eases the pain of reinstalling all applications after ROM upgrade. There are few such tools already, but I found those quite bloated with unnecessary thing for my own approach.
With this script I assume:
1. There is/was SSHDroid installed (or any tool with busybox and you can access shell command line) both in old and new ROMs and your ROM have bash installed in /system/bin/.
2. Backup/restore operation includes only INTERNALLY installed applications, it completely ignores SYSTEM and SDCARD installed ones.
3. This is TEMPORARY backup so it should be as fast as possible not caring about occupied space (!). Althought I added -zip parameter to enable compression if you are running out of space on your sd.
4. Installed ROM is clean with no additional apps installed (excluding those needed by the script)
5. You have basic knowledge about bash scripting, because I take NO RESPONSIBILITY of the script behavior or data loss it can do.
So, basically it is simple. It runs like this:
1. On old ROM type: sbackup -backup
2. Flash your ROM
3. On new rom type: sbackup -restore
Just like that. The applications data is tar'ed in one file per application so if you want to get rid of any, just delete it from backup directory. The directory name is same as script name on sdcard but you can change it adding a parameter without a '-' sign at runtime (first non-option parameter is treated as backup directory path). The file is zipped because this forum disallows files without an extension so... it is zipped ;D
It was tested on my fresh LeeDroid 3.3.3 GB AFTER i installed some apps. I backed them up and then restored. All seems to be perfect right now, but I will test it more thoroghly very soon because I'm planninig to have CM7 based ROM too just to choose that I need Sense or not (two nandroids for fast switch weekly ;P).
With this script and MyBackup functionality of backing up contacts, sms, history and similar it should be quite complete approach to restore all the data needed on the fresh ROM. In the future maybe I will look at the MyBackup part too. Maybe.
Feel free to comment, use, suggest or anything you like, and have fun ;P.
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
jgrimberg1979 said:
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
Click to expand...
Click to collapse
And thats why I mentioned in topic about not being a newbie (and I meant not forum newbie but more a linux newbie). The thing is, it's a simple script - without any user-proof capabilities, comments inside or something BUT...
But ok, I will try to help you run it. First of all, you have to set permissions to the script. It has to have executable permission to be run by the system (and I mean filesystem permission). This can be done by chmod instruction of busybox. Most of the times it's done like this:
chmod 755 filename
This is a reason of not running form sdcard if your sdcard is NOT ext filesystem (it is usually windows fat filesystem not to generate problems with reading it under windows).
Second thing to run is to have /system/bin/bash because first line of the script (a comment like this: #!/system/bin/bash) instructs busybox to execute script using bash. This can be simply changed by modifying this line, but you have to remember that changing the shell executing script have consequences. Differens shells have sometimes different syntax, althoght i wrote this script simply so it should run on most of them, especially sh.
Third thing is to have write permissions to the directory in which the backup will be created. In original version of the script it is /sdcard, because backup is made in /sdcard/sbackup. So, you have to check it (second error - problems with creating directory).
And a last tip - it can be run from ANYWHERE. Even if your partition does not alolow executing, you can do it like this:
bash-3.2# /sdcard/test
bash: /sdcard/test: /system/bin/bash: bad interpreter: Permission denied
bash-3.2# . /sdcard/test
OK
bash-3.2#
First try does not succeded, but second did. The trick is a dot which means to execute file with a shell not caring about why or permissions.
And thats most simple introduction I could write. It applies to ANY script you want to run.
Please anyone - if you want me to help, paste your results here because without a precise error message it can be very hard to deduce what caused for example permission denial or anything usual.
For now, I won't add any more error handling, but if there will be more users caring about, I will add it.
Why this tutorial?
I made this tutorial for the galaxy 3, but then some user reported me that it worked on another phone, so I post this thread here again.
I wanted a good odexed rom, but there isn't any here. So I tried to make my own odexed rom, but it wasn't so good. So I read something about re-odexing and tried it out. I modified it a little bit and I don't know all about re-odexing, so if someone know something better, pls post it here in the thread for everyone. English is also not my mother language, but I hope you'll understand me
What is a odexed and a deodexed rom?
When you look at a stock rom in the folder /system/app, you will see files with the ending .odex and the apks doesn't contains classes.dex files. When you look at a deodexed rom, you'll see that there are no .odex files and the apks contains classes.dex files. Basically every apk contains a classes.dex files. Then the dalvik virtual machine generates a dalvik cache based of the classes.dex file. When you load a app, it will be loaded from the the dalvik cache, not from the apk. Samsung built the odexed rom using a tool called dexopt-wrapper. This tool generates .odex files based from the classes.dex, that means it does the same job like the dalvik vm. The .odex files were pushed in the /system. The files are the replacement for the dalvik cache. Like I wrote above, apps are loading from the dalvik cache, not from apk or classes.dex file, so classes.dex are not needed anymore, so they are deleted in odexed roms. Deodexing using xUltimate means regenerating a classes.dex based from the .odex file, merging it into the apk and deleting .odex.
What are the advantages and disadvantages from a deodexed rom?
Advantages:
-All needed things are in one apk, so modding/theming is (better) possible
-Needs less space on /system
Disavantages:
-Needs more space on /data
-Is not so stable than a odexed rom
-Slower on first boot(because a odexed rom has already execute ready .odex files, a deodexed rom needs to generate dalvik cache)
What do I need to re-odex?
-A rooted phone
-A full NANDroid Backup
-More than 30 mb free space on /system
-ADB drivers for Option 1
-Titanium Backup Pro for Option 2
How can I re-odex a Rom?
There are 2 Options to do it, but only the first does a full re-odex.
Before doing anything make sure that you have a full NANDroid Backup because you'll propably get into a bootloop and I cant guarantee that it works on your device/rom.
Option 1 using dexopt-wrapper:
I used first the script from puppet13th, but I got into a bootloop. So Ive done some changes and tried it until it worked
Some users told me that you can re-odex the rom without being in CWM, so you can may skip Step 2, but you could get into a bootloop without Step 2, but you can try it out, there is no risk with a NANDroid backup
Step 1: Configure the script for your device:
The attached script is made for the galaxy 3, so you have to configure the script for your device. If you done it, pls upload it and post it here for other users.
Download the zip(link below) for your system and unzip it. Then go to the folder "odex" and then open there the file/script "odex" with your favourite text editor(I suggest Notepad++).
You only have to replace the $BOOTCLASSPATH. You can find the valid $BOOTCLASSPATH in /init.rc. Enter your $BOOTCLASSPATH after "BOOTCLASSPATH=" for example so(beginning from Line 8):
Code:
BOOTCLASSPATH=replace_this_with_your_bootclasspath
cd /system/framework
for filename replace_this_with_your_bootclasspath
In the line
Code:
for filename replace_this_with_your_bootclasspath
you must replace the ":" character between framework files with a space.
Step 2(optional): Reboot your phone into cwm recovery and get adb access there
For best results you should re-odex in the recovery menu. Some users told me that it also works in a running system, so you can also try it in a running system, but you must mount /system rw before.
So if you want to re-odex in the recovery menu, reboot into recovery and make sure you have adb access.
Step 3: Ensure /system & /data is mounted, Connect your phone and run reodex script
Make sure that /system and /data is mounted in rw mode(in recovery: go to mount & storages, in a running system:use root explorer) and connect your phone with your computer.
You already downloaded the re-odex script in step 1. Your computer will push it over adb with the needed binaries to your phone. The script will create odex files, will delete classe.dex from the apk/jar, will rezipalign your apks and will delete the dalvik cache.
For windows users: double click on odex.cmd
For linux users: open a terminal and navigate to the folder which contains the unzipped attachment and run
Code:
chmod +x reodex.sh
./reodex.sh
After its finished, simply reboot and enjoy your fully re-odexed rom.
Step 4 (optional) convert /data:
I dont know if there is a better option, but after a re-odex with Option 1, my phone didnt showed the right free space on /data. So I converted /data to a other filesystem and back and then it showed the right free space.
So check your free space and if its wrong, convert your filesystem if you kernel support that.
Option 2 using Titanium Backup Pro:
You need to have Titanium Backup pro for re-odexing.
Step 1:
Select Menu -> More -> integrate sys dalvik into rom and wait until its finished. Then you should have more space on /data. I had when I tried it before 105 and after 135 mb free space on /data and 0kb free space after it on /system, so its not all.
You can also undo it. Its good when you want to try out a new theme, so you can undo and redo it using TB Pro.
Simply select Menu -> More -> Undo sys dalvik integration
and you're done.
Option 1 vs. Option 2
-Option 1 does a full re-odex, you have full free space on /data(Option 2 does only re-odex the apps in /system/app, not the framework(/system/framework)
-Option 1 deletes classes.dex from apks and jars(against Option 2), so you have more space free on /system
-You can undo Option 2 fast, so theming/modding is also possible by undo, theme and redo it, you can also undo Option 1, its called deodexing, but its not so fast
Download Links
XDA gaves me only 500 Errors when uploading was done, so I uploaded it to min.us
Re-Odex Script for Windows
Re-Odex Script for Linux(probably doesnt work, I cant reupload because I dont have the file anymore)
Working on...
There are only phones in the list, which were reported as working by users. It can aso work on a phone which isnt in the list.
Samsung Galaxy 3(working with default script)
HTC Amaze 4G(no script attached)
HTC Evo 4G(script here)
Samsung Galaxy S2(script here)
Motorola Atrix(script here)
Nexus S (4G)(script here)
XPeria Ray(script here)
SGS 1 maybe(working script for ICS aokp here and a working script for 2.3.6 (XWJW5) here)
Wildfire S(script here)
Nexus 7(script here)
TF700T & TF300T(script here)
Xperia Ray GB REPACK4PDA_V7(script here)
Acer A510 and Asus Transformer Prime TF201(script here)
Credits
puppet13th for making orginal script
If I helped you, you can press the thanks button under the post.
Thanks very much! I can confirm this works on the HTC EVO 4G. I have attached my odex file. I had to upload it as a ".txt" file, be sure to remove the ".txt" from the "odex.txt" before using
Thanks, I will have a look and try this on my xperia play
Sent from my R800i using xda premium
Thanks a lot. This works on the Atrix.
Odex file attached.
working on Galaxy S II
edited odex file in attachments
Yup mines work on the evo 4G too thanks. Now I have a odex rom. would post the file but swagstr beat me to it. same path as mine.
Nice to see that it's worked without problems on all devices, which tried by users. If I forgot to mention: a g3 rom developer asked me, if he is allowed to publish a rom which was reodexed with my script.
And yes all secs are allowed to publish rom's which are reodexed with my script. You must not add me to the credits, but it would be great if you do it.
Anyway to individually re-odex .apks with this mod?
swagstr said:
Anyway to individually re-odex .apks with this mod?
Click to expand...
Click to collapse
Yes, in my reodex package is a folder odex, theres a binary "dexopt-wrapper": copy this to your phone and give it executeable rights and then run over adb or term-emulator:
Code:
dexopt-wrapper <input.apk> <output.odex> <$BOOTCLASSPATH>
Working on Sony neo v so should work on Xperia 2011 range
Reserved
Sent from my SGH-T989 using xda premium
Works great!
I'll upload my odex file for the Nexus S 4G
Edit: Here's my odex file for the Nexus S 4G (probably the same for Nexus S)
jr_718 said:
Reserved
Sent from my SGH-T989 using xda premium
Click to expand...
Click to collapse
For what reserved?
Hey, is there any way to do this on a PC? Like, place /system/app and /system/framework/ in specified folders then run the odex script and it can odex the apk's and jar's on the desktop?
fergie716 said:
Hey, is there any way to do this on a PC? Like, place /system/app and /system/framework/ in specified folders then run the odex script and it can odex the apk's and jar's on the desktop?
Click to expand...
Click to collapse
You need the android phone to execute dexopt-wrapper binary. But you can do that over adb. You can reodex all over adb and then pull the reodexed files, but you can also do a nandroid backup, reodex your rom and make then
Adb pull /system/app/
Adb pull /system/framework/
After that you have the files on the pc and you can restore your nandroid backup.
TearsDontFalls said:
You need the android phone to execute dexopt-wrapper binary. But you can do that over adb. You can reodex all over adb and then pull the reodexed files, but you can also do a nandroid backup, reodex your rom and make then
Adb pull /system/app/
Adb pull /system/framework/
After that you have the files on the pc and you can restore your nandroid backup.
Click to expand...
Click to collapse
I see.. Yea that makes sense.
Thank you!
Hmm....but its not a good to go option for ROM developers with no device.
Can anyone make bat script to do this without andro phone?(I m not good windows dev )
I mean the same way dsixdas kitchen de-odexes
Sent from my Micromax_A70 using Tapatalk 2 Beta-4
varun.chitre15 said:
Hmm....but its not a good to go option for ROM developers with no device.
Can anyone make bat script to do this without andro phone?(I m not good windows dev )
I mean the same way dsixdas kitchen de-odexes
Sent from my Micromax_A70 using Tapatalk 2 Beta-4
Click to expand...
Click to collapse
Rom developers without device? Okay, it might be possible to do that under linux and im pretty sure that the binarys should work under linux, but windows isnt possible.
TearsDontFalls said:
Rom developers without device? Okay, it might be possible to do that under linux and im pretty sure that the binarys should work under linux, but windows isnt possible.
Click to expand...
Click to collapse
TommyTomatoes had something going on maybe you could borrow his script and improve on it or work together.
Sent from my powered Shooter E3D with Infection of AnthraX Jamz by wolf.
.Elite_The_King. said:
TommyTomatoes had something going on maybe you could borrow his script and improve on it or work together.
Sent from my powered Shooter E3D with Infection of AnthraX Jamz by wolf.
Click to expand...
Click to collapse
Sorry, i dont understood anything. Whats tommytomatoes script about?
LINK TO THE THREAD WITH THE AUTOMATED SCRIPT (thanks to @skyguy126): http://forum.xda-developers.com/moto-g/general/mod-storage-reloacting-dalvik-cache-t2953616
Hello everybody
as you may know, our Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Well, thanks to @skyguy126, who linked me to this guide, I managed to link the dalvik cache files to the /cache partition
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't :laugh:
b) you're running ART
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Other than that, all you need is a rooted phone, the Terminal Emulator app installed (HERE), a root file manager, at least one hand and a working brain
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE THAT HAPPENS TO YOUR PHONE, CONTINUE AT YOUR OWN RISK.
Steps:
1) Open any text editor, messaging app, notes app or anything that allows a text input. write the following line, select it and copy it to your clipboard (you'll need it later).
Code:
ln -s /cache/dalvik-cache /data/dalvik-cache
Also, make sure you open the Terminal Emulator app and type in "su" (without quotes), then grant it superuser access. You'll need to switch to it quickly.
2) Open your root file manager, while making sure you still see the terminal emulator's notification (I used Root Explorer but any other app should work just fine), go to /data, select the /dalvik-cache folder (just to be sure, hit "properties" to check its size. If it's less than 600Mb you're good to go. If it's not, this won't work, sorry) and move (NOT copy, MOVE) it to /cache. If it asks you to merge two folders, do it.
NOTE: now some apps may start force closing, it's normal, keep going
3) Switch to the Terminal Emulator app (via the recents screen or by tapping its notification" and paste the text you copied at the beginning by long-pressing the black screen and hitting "Paste" (DUH?!?), hit enter, make sure no error messages come up, then reboot.
TA-DAAAA!
Your dalvik cache is now linked to the /cache partition, enjoy that half a gigabyte
If you need any help, feel free to PM me
"But Bert, what if it doesn't work and my phone explodes?"
Well, if it blows up there's nothing much I can do, but if it's just stuck at bootanimation/bootlogo/somewhere where you can't use it, simply head to the recovery and wipe dalvik-cache. This will revert the process and delete the link, putting the phone as it was before
Batch File to Automate the Process!!!
Look at reply #58 for latest information
Old:
Batch file complete, credit goes to @Bert98 for devising a method.
USE THIS COMPLETELY AT YOUR OWN RISK! You may NOT rehost, take credit, or make a paid download without the permission of @skyguy126 or @Bert98
This will only work on windows based computers!
I tested this on my moto g xt1032 16GB running CM11 Nightly and it worked fine.
Click that thanks button if it helped!
How to use:
Step 1: Download the attached file and extract.
Step 2: Double click the cachemove.rbat file and follow the onscreen instructions.
EDIT: THIS IS NOT WORKING ON MOTO G STOCK 4.4.4!!!
I am working on this issue but any help is greatly appreciated!
Common errors:
"adbd root cannot run as root in production builds"
Solution: http://forum.xda-developers.com/showthread.php?t=1687590
Install the app and run it. Enable insecure binary.
Changelog:
v1.1 - Fixed some minor bugs in script.
v1.2 - Added a restore script.
Keep in mind that the /cache partition will be slower as it's a ext4 partition as opposed to f2fs
DustArma said:
Keep in mind that the /cache partition will be slower as it's a ext4 partition as opposed to f2fs
Click to expand...
Click to collapse
/data is a F2FS only on stock ROM, on GPE and other ROMs it's ext4 as well
Inviato dal mio Moto G utilizzando Tapatalk
Bert98 said:
Hello everybody
as you may know, our Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Well, thanks to @skyguy126, who linked me to this guide, I managed to link the dalvik cache files to the /cache partition
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't :laugh:
b) you're running ART
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Other than that, all you need is a rooted phone, the Terminal Emulator app installed (HERE), a root file manager, at least one hand and a working brain
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE THAT HAPPENS TO YOUR PHONE, CONTINUE AT YOUR OWN RISK.
Steps:
1) Open any text editor, messaging app, notes app or anything that allows a text input. write the following line, select it and copy it to your clipboard (you'll need it later).
Code:
ln -s /cache/dalvik-cache /data/dalvik-cache
Also, make sure you open the Terminal Emulator app and type in "su" (without quotes), then grant it superuser access. You'll need to switch to it quickly.
2) Open your root file manager, while making sure you still see the terminal emulator's notification (I used Root Explorer but any other app should work just fine), go to /data, select the /dalvik-cache folder (just to be sure, hit "properties" to check its size. If it's less than 600Mb you're good to go. If it's not, this won't work, sorry) and move (NOT copy, MOVE) it to /cache. If it asks you to merge two folders, do it.
NOTE: now some apps may start force closing, it's normal, keep going
3) Switch to the Terminal Emulator app (via the recents screen or by tapping its notification" and paste the text you copied at the beginning by long-pressing the black screen and hitting "Paste" (DUH?!?), hit enter, make sure no error messages come up, then reboot.
TA-DAAAA!
Your dalvik cache is now linked to the /cache partition, enjoy that half a gigabyte
If you need any help, feel free to PM me
Click to expand...
Click to collapse
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
KahosTch said:
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
Click to expand...
Click to collapse
Do you have TWRP on your device?
Inviato dal mio Moto G utilizzando Tapatalk
i have CWM, philz touch.
(any idea why didnt work? :c )
KahosTch said:
Hello! Thnk you for the tip, but, with me, i think, didnt work.
Im stuck in the boot, can you helpme to restore the directories? BTW, i have folloed all the steps like you say, i dont know why not work, im using CRom
Greetings!
Click to expand...
Click to collapse
To get it working just wipe dalvik cache in cwm, it will re-create directory in /data.
I had the same issue..
I will try to investigate what went wrong with this....
fabus said:
To get it working just wipe dalvik cache in cwm, it will re-create directory in /data.
I had the same issue..
I will try to investigate what went wrong with this....
Click to expand...
Click to collapse
jaja Thakyou, that work.:fingers-crossed:
I have found an issue. When you are copying /data/dalvik-cache to /cache/dalvik cache permissions can be mismatched (different partition type).
To fix it just:
- Go to CWM
- Connect phone to PC (should be recongnized as ADB device, if not check in Hardware Manager how it was recongizes)
- issue "ADB shell" command
- in Android shell: chmod 644 /cache/dalvik-cache/*
- reboot and you are done
I have made up an easier way to achive dalvik-cache on /cache partition:
On running android:
- make sure /cache/dalvik-cache folder is empty!!
- Rename /data/dalvik-cache to /data/dalvik-cache2
- ln -s /cache/dalvik-cache /data/dalvik-cache
- reboot and done
Android will recreate dalvik cache in /cache/dalvik-cache dir, it will take about 10 minutes, so be patient
if something goes wrong, just rename /data/dalvik-cache2 by ADB (e.g. in CWM)
I hope if was helpfull.
Cheers,
good work
Thank you for this. I will definitely be doing this.
You should make a batch file that does this whole process automatically. I would be happy to assist!
Guys could some experts code a batch file for this?
I appreciate the guide but terminal codes etc are beyond me.....
600mb is quite a lot of space to gain for an 8gig moto g
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Guys could some experts code a batch file for this?
I appreciate the guide but terminal codes etc are beyond me.....
600mb is quite a lot of space to gain for an 8gig moto g
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
It's up to 600mb. It's what ever size your dalvik cache is. I don't think this will work on android 5.0 since the change to art.
Yep I'll work on it... Hopefully it'll work, no promises...
skyguy126 said:
Yep I'll work on it... Hopefully it'll work, no promises...
Click to expand...
Click to collapse
That'd be great, since I know nearly nothing about batch files if you succeed, I'll put it in the OP
Inviato dal mio Moto G utilizzando Tapatalk
Skyguy
I have around 125apps and 500mb free, would installing the batch screw my phone up?
Thanks for helping
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Skyguy
I have around 125apps and 500mb free, would installing the batch screw my phone up?
Thanks for helping
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
It depends on your /data/dalvik-cache folder's size, you can check with root explorer
Inviato dal mio Moto G utilizzando Tapatalk
Hi Bert
It's 466.92mb
If I could get 500mb of more free space I would have a gig free which would really help my 8gb moto g
Sent from my XT1032 using XDA Free mobile app
AndroidHtc101 said:
Hi Bert
It's 466.92mb
If I could get 500mb of more free space I would have a gig free which would really help my 8gb moto g
Sent from my XT1032 using XDA Free mobile app
Click to expand...
Click to collapse
Follow the instructions in the OP then, you're good to go
Inviato dal mio Moto G utilizzando Tapatalk
DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.