[Moto G General] skyguy126:
Script now works on stock :D

New Thread: http://xdaforums.com/moto-g/general/mod-storage-reloacting-dalvik-cache-t2953616

Old:

DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED. YOU MAY NOT REHOST OR MAKE A ONE CLICK ETC. WITH THE FILE WITHOUT MY EXPLICIT CONSENT.

Please, please make a nandroid backup before you continue!!!!

This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. :D

Prerequisites:

1. You must have "adb root" functioning. If you don't head to this thread: http://xdaforums.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 custom 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)

Stock ROM procedure:

Read the directions very carefully and then read them again, before continuing.

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_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)

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 /CACHE AND /DATA 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:

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! :D

I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:

Huge thanks to [MENTION=4758250]Bert98[/MENTION] and [MENTION=6131759]dd043[/MENTION]

Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed STOCK about 50 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh: