[TASKER/CWM]Full NAND while you sleep! - Galaxy S III Themes and Apps

DISCLAIMER: <insert generic XDA disclaimer here>
Hey guys, first things first. I'm not a programmer/dev or even clever so bear this in mind when trying this.
I wanna share a Tasker with you all that when used in conjunction with PhilZ Touch 4.88.5 Touch Enhanced CWM 6.0.2.9 Recovery and anopen recovery script can allow your phone to perform a NAND backup while you sleep or whenever you want.
Philz has managed to get ors working in his recovery which means that the recovery with be able to perform custom backup jobs once you select them in recovery and run them. Now, READ this aboutopen recovery script to find out about ors because I'm not one for giving fish to men, rather teach them to fish! Read it? Good... moving on...
The ors support is great but having to select them and run them is not so great for me and that is where this trick comes in handy.
What this task does...
It copies an already created (user created) ors script to /cache/recovery, deletes the previously backed up backup folder (if any), reboots into recovery (provided you have 50% battery). Recovery then runs the script, backs up and reboots into the ROM. If at boot, the backup was made, a notification comes up telling you this and the time it was done at and also writes this to a log file in /mnt/sdcard0/clockworkmod.
I'll leave it up to you to figure the tasks out and how they work if you want a better understanding.
Quick tip:
The backup folder is set to clockworkmod>backup BUT the sdcard to which the backup is made is selectable in recovery under: Backup and restore>Misc Nandroid Settings>ORS Backup Target. So in other words you can't define /mnt/sdcard0/SILLY/NOOB as the backup folder, it can only be either /mnt/sdcard0/clockworkmod/backup/*my folder* or /mnt/extsdcard/clockworkmod/backup/*my folder*. This being said, all you need to do is define the *my folder* name under /mnt/*/clockworkmod/backup/*my folder* in the script which could just be /Tasker_Backup Capeesh?
Another thing that I must mention is my reason for creating a openrecoveryscript file and copying it to /cache/recovery rather than just writing a file directly into /cache/recovery is that it seems like either Tasker or Android doesn't like creating a file directly in /cache/recovery but doesn't seem to mind copying a file to the location.
Instructions:
1.You need to create a file on your sdcard called openrecoveryscript.txt in a place you will remember (I put mine in the mnt/sdcard0/clockworkmod)
2.Once you created the file, open it and enter your backup job, the order in which you enter your commands aren't important, any permutation will do (BDASC or ASDBC).
3.When you're done, save the file and REMOVE the ".txt" extension.
4.Import my Tasker profiles (NAND backup and NAND notify) into Tasker and open the task "NAND backup" and edit the path in the 9th and 11th action to the clockworkmod folder on either the local or external sdcard. (depending on the selection that you made under: Backup and restore>Misc Nandroid Settings>ORS Backup Target)
5.Set the time and date that you want the backup happen on.
6.Thats it!
Suggestions:
I would advise against setting the internal sdcard as the backup location because replacing an external sd is far easier than replacing an internal one when it burns out from large amounts of writes in addition to this, I would recommend backing up about once per week (depending on your addiction to flash) to reduce the strain on the sdcard. But this is only my suggestion.
Attached is a zip of the profiles and the ors that I use, just remember to remove the ".txt" from the "openrecoveryscrip.txt" before using it.
DON'T FLASH IT, IT IS NOT A CWM ZIP!!
This is by no means perfect but rather to provide a point of departure in helping others create similar tasks to automate their backups to their preference so please rename, delete and add as much as you like. Maybe post your findings too!
Remember, if you don't understand do the following (in order): search, read, think, SEARCH, READ, THINK, SEARCH!, READ!, THINK! ask.
Good luck
I would like to give credit to
Phil3759 for developing a great recovery that makes the whole party possible.
rootSU for his post which is far more thought out than mine but none the less got me'a thinkin.

Thank you for the guide (my 8 :good: are done today...)
I just add this so people do not browse much:
The file /cache/recovery/openrecoveryscript
Code:
backup SDCR123BAEOM foldername_not_full_path
S System partition
D Data partition
C Cache partition
R Recovery partition
1 Special partition 1
2 Special partition 2
3 Special partition 3
B Boot (kernel) partition
A .android_secure
E sd-ext partition
O Enable backup compression
M Do not create MD5sums
foldername Optional (if not specified, a folder with timestamp is created, so you do not have to delete previous folder)
Currently, 1, 2 and 3 are not supported. I could assign modem and efs to them later, but I do not think it is really useful

Related

TaBackup & EasyKernel Backup and Restore

Since we have a lot of users here with no real means of doing automated proper backups of their tabs outside of ClockworkMod, or manual backups using RotoBackup, I've decided to release my implementation of a backup routine to XDA.
It's based upon RotoBackup and thus requires full SU access on your Tab.
It also requires Heimdall and ADB to be working if you wish to restore a backup fully.
The routine currently only supports RFS filesystems, EXT4 support may be added later!
I have tested this as much as I can, and I do hope that it works for everyone who tries it.
It is windows only, however if someone wishes to redo the script as a shell script feel free!
--
Down to the attachments.
TaBackup.zip
- TaBackup.cmd : Full tab backup and restore script
- KernelBackup.cmd : Kernel backup and restore script
GTab-Heimdall_1.1.1.7z
- WORKING Heimdall 1.1.1 which is required if you wish to RESTORE
- WORKING USB drivers for DOWNLOAD MODE, required for Heimdall
Both freely available from https://github.com/Benjamin-Dobell/Heimdall
Extract the zip to a directory, preferred directories are;
C:\GalaxyTab\Backups for TaBackup.cmd
C:\GalaxyTab\KernelBackup for KernelBackup.cmd
You _can_ change these defaults by editing the script and changing line 8
You need ADB WORKING, either from the same directory as TaBackup, or from your system PATH
Due to the hasty modification of TaBackup last night to create KernelBackup, there is legacy code floating around which requires heimdall.exe to be present in the same directory as the backups... I may change this at a later date.
It IS possible to have both backup locations the same, e.g. C:\TaBackup
with both scripts in that directory, with Heimdall. You just have to remember which backup directory is just a kernel backup only.
--
Good luck, and happy hunting!
--
Changelogs:
TaBackup 0.5
First public release
Various logic fixes
Idiotic spelling mistake which prevented a restore!
KernelBackup 0.1
First public release
Reserved for Future Use
Perfect - will try!
Sent from my GT-P1000 using Tapatalk
Thanks! This saved me from creating a script myself. I am anal about backups so this is perfect. So far I have only tested the standard backup (it's running as I type this and then will test the Kernel as well. One thing to note, the script requires that you adb installed / path defined in your system variables. Originally it would not work for me as I continued to get unknown command. I have successfully used adb commands to execute the backup before, but only executed it straight from the directory where I had adb installed. Once I added the path to adb in my system variables then it worked great.
Ah yes, ADB pathing :|
I may try and do some rudimentary checks in the scripts for ADB
You said ext4 not supported, does this mean that if right now I back up while using rfs and I convert to ext4 I will not be able to restore my backup that was made on rfs? Or only that it won't backup and restore ext4
Sent from my SPH-P100 using XDA App

[Q] What are you using to backup your roms?

My HD2 can use clockworkmod from the bootloader to create a backup of sys & boot. Even windows had sprite backup to make a image of the rom.....so what do tilt users have to backup their rom so they can get back to a good copy of it or try a new rom without losing everything?
famewolf said:
My HD2 can use clockworkmod from the bootloader to create a backup of sys & boot. Even windows had sprite backup to make a image of the rom.....so what do tilt users have to backup their rom so they can get back to a good copy of it or try a new rom without losing everything?
Click to expand...
Click to collapse
You can backup data from within install menu(dont remember how its properly called)
And system well if you have a flashed image on sd card than there is no point to back it up.
-Arturo- said:
You can backup data from within install menu(dont remember how its properly called)
And system well if you have a flashed image on sd card than there is no point to back it up.
Click to expand...
Click to collapse
Some of us change our system as well such as custom kernels, customized framework's and additional tweaks to files such as the build.conf etc we'd rather not have to keep doing over.
famewolf said:
Some of us change our system as well such as custom kernels, customized framework's and additional tweaks to files such as the build.conf etc we'd rather not have to keep doing over.
Click to expand...
Click to collapse
Well the thing with system is that after you flash it ..it stays in the memory card then you can move it(back it up) to your computer and change it accordingly. So for example you have changed the framework in the system on your phone.... you can do the same with the backed up system on computer and it will take you not more then 15 seconds. You just open it with 7zip and the world is yours you can pretty much do whatever you want with it remove/add files replace them and so on....and that is all the files and folders in the system image. If you have ever removed/replaced/added files to a simple rar archive then you pretty much know how easy it is to edit a rom on your computer.
backing up your kaiser
Android is just Linux so you can do almost anything you can do in Linux if you can get to the shell. I use a program called Terminal Emulator from a guy called jackpal that I got from the Market. It will give you a command prompt so you can perform any Linux commands you like and if you type su it will act as super user and give you a # prompt.
I also went as far as writing my own userinit.sh that runs each time I boot and copies files from my data partition on NAND to the SD card. I just copy the /data/data, /data/app, /data/local, and /data/system folders to a folder named backup on the root of the SD card. The script also moves the previous backup to a folder called backup.old and if backup.old already exists it deletes it first.
This way if my phone reboots and data is corrupt I can use Root Explorer to copy the files in either backup or backup.old on my SD card back to NAND and my phone is restored.
You can also us the backup routines that are in the menu that comes up when you press the DPAD during the boot process but that backs up the entire data partition to the tune of 256MB and if there is corruption it really doesn't do much good.
As a side note you can mount the file created by the backup on any linux box using the mount command and a loop device. Once mounted you can just copy files that you need out and transfer them back to your phone using the SD card.

[CWM Scripts] Relatively painless backup/mod/restore scripts

Ok, these are specifically for MIUI, but they can easily be adapted to any other rom by editing the shell scripts. I'll explain how they work and it should be fairly apparent how one would need to modify for their particular rom/needs. Don't know if anyone will actually use these, but I thought I'd share. I also think it's a really good example of how CWM can be used for more than just flashing stuff.
So I've been running MIUI for a while now and I'm really happy. One little issue that popped up was every Friday when the rom was updated, the OTA update app icon gained a little "1" badge, indicating an update was available. While it's nice to be notified of the update, I occasionally didn't have the time or interest in updating so the little badge remained. I put that app in a folder, but then the folder had the little 1 badge. After a while, I started deleting the update app after install since I could always download and install updates through ROM Manager just as easily. Then I started deleting the update app from the downloaded ROM zip, along with several other apps I didn't want (Facebook, Twitter, the MIUI FileExplorer, etc) before flashing it. But this entailed downloading the Friday update on my phone, transferring it to my desktop, opening the zip in 7 Zip, deleting the unwanted files, uploading it back to my phone and then flashing. Quite a PITA.
Another issue I ran into was that the built-in MIUI backup app failed to backup my SMS/MMS messages. Actually, I don't know if it was failing to back them up, or failing to properly restore them, but at the end of the day, it wouldn't keep my text messages. I know I could avoid this by just installing each update over the current ROM, but I've always believed cleanly installing an OS helps avoid issues. I prefer to wipe everything, install clean and then restore my data.
So, the solution(s) I came up with was to mod the downloaded ROM zip file right on the phone, and manually backup and restore my data. While it took a little while to get set up, I find it actually works considerably faster and smoother than using MIUI's backup/restore app. I now have 3 simple shell scripts that are run through Clockwork Recovery just like installing any zip - one to mod the ROM after downloading, and two to backup and restore my data. Here they are:
MIUI-Mod.zip
This contains a shell script and a zip binary to handle the adding and deleting of files to/from the downloaded rom zip. When run through CWM, it copies zip and the script to /tmp and runs the script. Because the ROM zip is named differently every Friday, I figured the easiest solution was just to rename it manually. So, this script assumes the ROM zip is named "miui.zip" and is located in the root of the SD card. It's a simply matter to download the ROM on Friday, move it to /sdcard and rename it miui.zip. Here's what the script does in 2 commands:
/tmp/zip -d /sdcard/miui.zip /data/app/Twitter.apk /data/app/Facebook.apk /system/app/Email.apk /system/app/FileExplorer.apk /system/app/Gmail.apk /system/app/MIUI.us_Forums_1.1.2_AdSupported.apk /system/app/Superuser.apk /system/app/Updater.apk /system/app/MIUIStats.apk /system/media/lockscreen/* /system/media/wallpaper/*
/tmp/zip /sdcard/miui.zip /system/app/Gmail.apk
Click to expand...
Click to collapse
The first line simply opens the zip and deletes the listed files: Twitter, Facebook, Email, etc. It also removes all the wallpapers for the lock and main screens (I don't use them, so I didn't want them, but it's a good example of the use of wildcards like *).
The second line adds in the Gmail.apk from my current ROM. The latest versions of the Gmail app included in MIUI lock the mail database, which conflicts with a widget I use, so I just replace it with an older version. Every time I run the script, it removes the included Gmail app and adds in my current one. If you didn't want to add anything to the ROM, you could just delete this line entirely.
Data-Backup.zip
This just runs a shell script that creates a tar file in the root of your sdcard containing the listed files and directories. Tar files retain file permissions and owner information, so everything can be restored seamlessly. Here's how it works, it's pretty simple:
tar -c -f sdcard/backup.tar data/app/com.adobe.flashplayer-1.apk data/data/com.adobe.flashplayer data/app/com.speedsoftware.rootexplorer-1.apk data/data/com.speedsoftware.rootexplorer data/app/com.touchtype.swiftkey-1.apk data/data/com.touchtype.swiftkey data/data/com.android.browser data/data/com.android.deskclock data/data/com.android.launcher data/data/com.android.mms data/data/com.android.phone data/data/com.android.providers.contacts data/data/com.android.providers.settings data/data/com.android.providers.telephony data/data/com.android.providers.userdictionary data/data/com.android.thememanager data/data/com.android.vending data/data/com.google.android.gsf data/data/com.miui.camera data/data/com.miui.notes data/data/com.noshufou.android.su data/system data/misc/wifi
Click to expand...
Click to collapse
This creates the tar file and includes Adobe's Flash player and it's data, Root Explorer and it's data, and SwiftKey and it's data (I paired it down to just these three for this example). After that, it backs up a bunch of other data directories which include the current Browser settings, alarms, launcher settings and home screen layouts including widgets, phone logs, the current theme settings, any MIUI notes, current Wifi connections and, yes, SMS and MMS messages.
Obviously, you'd want to add in your specific apps and data directories. Sure, it takes a little work to set this up, but as I said, backing up is very quick and easy afterwards.
Data-Restore.zip
This just runs a shell script that restores all the files from the backup.tar on your SD card:
tar -xf /sdcard/backup.tar
Click to expand...
Click to collapse
Doesn't need much explanation.
So, the process is:
1-Download the Friday update through ROM Manager, move it to the root of my SD card and rename it to miui.zip
2-Reboot into CWM and run Backup-Data.zip to back up my apps and data
3-Run MIUI-Mod.zip to modify the downloaded MIUI rom
4-Wipe everything (cache/data/system)
5-Install the modded MIUI rom
6-Run Data-Restore to restore apps/data
7-Reboot
It's literally about 5 minutes after downloading the ROM and I'm updated and rebooted with a CLEAN os install and all my apps, data and settings intact, my home screen layouts, keyboard, wallpapers, wifi settings and everything retained.
Some notes:
1-Before running these in CWM, you have to make sure you have system, data and sdcard mounted since the scripts will be reading and/or writing to all of these. When you first reboot to CWM, just go to mounts and manually mount each one. The scripts could certainly be set up to mount them automatically, but mount points vary from phone to phone, and it's not difficult to mount through CWM. Also, after flashing a ROM, the ROM install script may unmount some of these, so before you restore your data, you might have to manually remount.
2-If you're adding anything from your current ROM to the zip (like how I add in my current Gmail.apk), make sure you wipe everything *after* running the mod script, otherwise you're deleting everything and then trying to copy file(s) that were just deleted.
3-I would highly recommend using Notepad++ to edit scripts, since it properly saves Unix line breaks.
4-as always, use at your own risk and a full CWM backup is highly recommended before messing with these.
That's pretty much it. Again, it does take a little while to get set up, but once it is, it's really simple. If you install a new app between updates, you just have to edit the backup script, or you can just keep the scripts maintaining a base setup and reinstall various apps through the market each time. This specific process is probably most useful for ROMs that are updated regularly - nightly or weekly, although I'm sure people can find other uses for running scripts through CWM.
Hope someone might find these useful.
This is really cool. I run Miui and would really like to be able to do a fresh install each week, but hate the hassle of resetting up my phone, even using Titanium backup, it's still a time consuming process. So needless to say, I flash the new rom over top of the old version without wiping just to save time.
So, basically I can open up the data restore zip in 7 zip, add in a few of my apps/data such as Tasker and so forth, close it and flash? If so, that will be great.
Thanks for sharing this!!!
You don't need to touch the Data-Restore.zip, all that does is extract the backup.tar file created with the backup script. What you'd do is open the Data-Backup.zip and edit the backup file (it's just a text file). Add in any of your apps and their corresponding data directories and when you flash the Data-Backup.zip in CWM, it'll back up those files/folders.
To find the files you want to backup, use something like Root Explorer and look in /data/app. There you'll find all the 3rd party apps you've installed. Add each one to the tar command in the backup file just like the ones I included. Then go into /data/data and find each app you want to back up's corresponding data folder. Add them to the tar command too.
Save the file, re-zip it and when you flash it through CWM, it'll back up the new files.
Just what i wanted
I also always install everything from clean system so setting up everything is a pain.
Would this work for Internal storage? I have a Motorola RAZR XT910 and running JBX roms.
Google does install all the apps when i sign in into the new rom but then i always had to move each folder to the correct destination manually using some file explorer. was thinking of making something like this but didnt know how to start. Thanks, I will now try and mod these to suit my phone :good:

Restore TWRP .ext4.win to Windows or Linux?

I have a backup made with TWRP 2.6.0.0 of boot/data/system that were saved as .ext4.win files by booting into TWRP and doing a backup.
However, when I tried to browse the file using Nandroid Manager 1.4.1, most (but not all) of the app directories in /data/data/{packagename} are missing their actual data. They have a lib dir that's a <link>, but nothing else. However, some apps DO appear to have their normal and expected data. I could understand if NONE of them did... but I'm mystified as to how SOME could have data, but others that I know for a fact store data in /data/data/{packagename} are coming up empty.
I can think of a few possibilities:
* For some bizarre reason, TWRP didn't back up the files for certain apps. Unlikely, unless Illusion 4.2.2 (based on SlimRom/AOSP 4.2) was doing something weird with symlinks that confused it.
* Nandroid Manager 1.4.1 mangled the backup files while uncompressing them. Oh ${deity}, I hope this isn't the case. It never even occurred to me that it might try to uncompress the originals "in-place" and delete the original copy when I ran it and gave it the OK to uncompress them first.
* Nandroid Manager 1.4.1 uncompressed them fine, but for whatever reason can't explore the uncompressed backup properly.
I copied the .ext4.win files to Windows and tried finding something that can explore them, but I'm coming up blank. I tried ext2explore from Sourceforge, but it silently ignores me when I try to browse to the .ext.win file as a filesystem to mount.
Any ideas what to try next, either Android-side (Nandroid Manager 1.4.1 itself is the problem, and hopefully didn't mangle the backups themselves by attempting to uncompress them) or Windows-side?
Update: I have another theory. At the time I did the backup, my phone was bootlooping (it made it up to the converging-diverging RGB spotlight animation, then stayed there forever). To reboot, I had to 3-finger it (power+home+down or up, don't remember which one I used at the time).
I'm wondering whether it might be a case of TWRP backing up the raw image of a dirty ext4 partition that had uncommitted data in the journal, and the recovery tools that I'm using to explore it for individual files are blindly mounting it like an ext2 volume & causing any file written by an actively-running application to show up as "gone" instead of showing the old version.
If that's the case, would treating the .ext4.win file like the output of 'dd', then running an ext4 repair tool on it, be likely to fix it? I'm somewhat familiar with issues like this, but I've never actually had to deal with one head-on, so I'm a total n00b when it comes to the details of mounting a Linux filesystem from a dump file and allowing Linux to fix it as if it were rebooted into a dirty filesystem.

[CWM/TWRP UTIL] ROMBlitz Script (GS4 and GS2)

ROMBlitz is a passive, yet extreme deep-cleaner, returning your ROM back to its initial-boot state.
ROMBlitz is about as close as you can get to a Factory Reset without having to set everything back up again!!!
Current Version: 1.05 (11/07/2016)
For a full changelog, see Post #3 below.
The script has been specifically developed and tested on my GT-I9505. It will also run on the following list of devices, but is of course untested by myself.
Supported Devices
GT-I9505*
SGH-M919
SGH-I337
jflte
jfltexx
GT-I9100*
I9100*
Installation Instructions
1. Download ROMBlitz.zip from the link below, and copy onto your device
2. To be extra safe, ensure the zip file's md5 checksum is correct
3. Reboot into Recovery
4. Install zip from SD card/External SD Card>Run ROMBlitz.zip
5. Reboot (and be patient!!!)
Downoad Here
Download Here
I have made every effort to test my script as thoroughly as I possibly can, but like anything else you flash onto your device, you do so at your own risk. I cannot be held responsible for any files/information lost from using this script that you did not foresee. Remember this will wipe your Internal SD card, so if you have any important files/photos contained within it, then perform adequate backups beforehand.
NOTE
I have seen a post on another forum regarding someone who downloaded another one of my scripts (Hawkernelwipe.zip), and the file that was received was Hawkernelwipe.zip.exe. I will only ever post up these scripts as recovery-flashable .ZIP files hosted on Dev-Host. If your download is anything other than this, then your PC is probably infected, and running such a file will probably infect your PC even further. Do not download from anywhere other than Dev-Host.
If you are ever unsure, check the md5 checksum before doing anything. This is one of the reasons for having md5 checksums in the first place.
All the Boring In-Depth Details
ROMBlitz clears any unnecessary files it encounters on your device, wiping the internal SD card, keeping any files/folders that you have defined in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt
Known temporary files are removed, along with ALL cache areas (which unlike a generic cache wipe, includes ALL individual application cache.), media thumbnails+database areas.
ROMBlitz will do all the work necessary for you to get your ROM as clean and clutter-free as possible!
ROMBlitz can be used to attempt to fix any minor problems your current ROM may have and possibly speed things up a little due to the space it frees up. Its worth giving this a try first before biting the bullet and performing a Factory Reset. You've got nothing to lose. However, ROMBlitz is not a cure for all evils, so don't expect miracles. Just remember its primary function, first and foremost, is to free up space on your device by removing unnecessary files and removing cache so that it gets regenerated.
Background Information - Remember Your First Boot?
When you booted your ROM up for the very first time, you would have noticed that it spent a very long time on the boot animation screen. During this time, your new ROM was generating individual application cache, and building all the necessary Android folders on Internal+External SD Cards for the applications in the new ROM to use.
After the initial boot animation screen completed, you would have seen the Android is upgrading, Optimising app xxx of xxx message. This is where Android builds up its all its Dalvik-cache area for the apps.
Once the ROM had settled down after this first boot (after the initial media scanner operations completed) you probably would have noticed that your new ROM was lovely and crisp and snappy.
ROMBlitz wipes all these areas, giving your ROM this fresh start again
The next power-up of your device after running ROMBlitz you will notice your device will take a long time to boot, as it has to perform all of the things that it did on your very first boot again. The boot animation screen will be running for quite some time, followed by the Android is upgrading, Optimising app xxx of xxx message.
Don't forget that known media areas will have also been wiped, so the Media Scanner will need to do far more work than usual on the next boot after a ROMBlitz, so expect the device to be quite laggy for a period of time afterwards.
You may also notice many applications are slower opening the first time you use them after a ROMBlitz. This is just the application re-initializing the any areas that may have been wiped.
When Should I Flash ROMBlitz?
If you frequently jump from ROM to ROM using Nandroid backup/restores, or are constantly flashing different ROMs, then you can very quickly gather tons of clutter on both your Internal and external SD cards. Every ROM you use creates its own folders on both SD Cards (TW ROMS especially!) thereby leaving large amounts of unnecessary files/folders on the cards between ROM-jumps. (unless of course you format the Internal SD Card, and remove /Android folder from the External SD manually each time before changing your ROM)
ROMBlitz will remove all this accumulated clutter on your Internal+External SD cards for you and deep-clean all the built up cache areas, giving your current/restored/new ROM the cleanest base possible to work from.
1. ROMBlitz before by a Nandroid Restore
Your SD Cards will be cleaned up, so expect a longer wait on the subsequent boot animation screen. All cache/media areas will be as of the time of the Nandroid backup, so you shouldn't expect to see the Android is upgrading, Optimising app xxx of xxx message.
2. ROMBlitz after a Nandroid Restore
All the cache and media areas previously mentioned will be cleared on your just-restored ROM, along with the areas described on both SD Cards. On the next boot you will see boot animation screen for a long time whilst the SD Card and application cache areas get rebuilt, followed by the Android is upgrading, Optimising app xxx of xxx message, as the Dalvik areas get regenerated.
3. ROMBlitz before you flash a new ROM
Regardless of if you are flashing a custom ROM through CWM or stock firmware with Odin, it's always a good idea to do a ROMBlitz beforehand. Doing so will clear the SD Card areas for you giving your new ROM the freshest, cleanest possible start.
4. ROMBlitz at any time on your current ROM
Flash ROMBlitz at any time if you just want to free up space and deep-clean your cache. Just expect a long boot next time.
5. ROMBlitz when you are experiencing problems
If you are experiencing problems with some applications behaving erratically or FC'ing, or perhaps you have a bootloop and you are contemplating a Factory Reset, then consider flashing ROMBlitz first. It may help you out, you never know. It's well worth a try before going the whole-hog, and jumping into a Factory Reset. You won't have anything to lose!
ROMBlitz Steps
Removes [int-sd]/Android and [ext-sd]/Android folders
Remove ALL files+folders from Internal SD card, except for any defined in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt
Delete ALL known temporary files found on the entire device
Remove ALL known media cache, databases, thumbnails etc. found on the entire device, and create .nomedia file in known areas that do not require media files, in order to speed up the Media Scanner process
Wipe dalvik cache from /data and /cache areas
Wipe all known cache areas from /cache, /data/system/cache and all individual application cache
Defining What You Want To Keep On Internal-SD
On the very first run of ROMBlitz, /sdcard/tmp/Hawker/ROMBlitz_Keep.txt will get automatically generated and the script then exits immediately, allowing you to reboot and edit this file to you own requirements.
This file's initial contents of areas to keep are:
snap_settings.bin
clockworkmod
data
DCIM
GravityBox
HawkerCore
IMEIBackup
Llama
LightManager
TitaniumBackup
TWRP
TopNTP
ViPER4Android
You MUST manually edit this file so that the files YOU want to keep on your Internal SD Card do not get wiped!
If you want to, you can manually create this file before the first run of ROMBlitz. Doing so would allow the script to run as normal on its very first run without the need to exit to edit. If you want to do this, then use a text editor on your device, or if done on your PC, use Notepad++ and ensure EOL is set to UNIX (LF). Create a folder called /sdcard/tmp/Hawker and copy this file into there.
Notes
If you always want ROMBlitz to wipe the ENTIRE Internal SD, you can do so by manually creating /sdcard/tmp/Hawker/ROMBlitz_KeepNone
[int-sd]/0 and [int-sd]/tmp folders will never be deleted by the script, even if the above file has been created
[int-sd]/Android and [ext-sd]/Android will always be deleted, even if included in the list of files to keep
Test Mode
You can call ROMBlitz.sh (which is in the tmp folder of the zip file) in Test Mode. This goes through all the motions as per a standard Recovery run, but it does not remove any files/folders in any way, and merely shows the commands that would have been executed. If you want to do this, then simply extract ROMBlitz.sh from the zip onto your device, and run it from there through a script manager type of application, through a terminal emulator, or adb shell.
Log File
A lot goes on during a ROMBlitz run, so everything that happens gets logged in /sdcard/tmp/Hawker/ROMBlitz.log for you subsequently examine if you need to.
Work In Progress
V1.05
1. Delete more temporary areas from /data partition
Identify more areas for wiping
Changelog
V1.04 (22/11/2015)
1. Better handling of file names containing spaces, including keep files
2. Hidden (.*) files are now also removed from Internal SD
3. Improved device detection
V1.03 (16/06/2015)
1. Report any files/folders in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt that do not exist on the Int. SD Card.
2. Script will now attempt to execute even if no build.prop file present (eg. after a /system wipe)
3. Fixed deletion of file names containing any space characters.
4. Display tweaks
V1.02 (14/05/2015)
1. Convert Kb deletion reporting to Mb/Gb if required.
2. Only show files that will be kept on Int. SD defined in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt that actually exist on the Int. SD Card.
3. /sdcard/tmp/Hawker/ROMBlitz_KeepNone now implemented.
V1.01 (14/05/2015)
1. Improvements to the way /sdcard/tmp/Hawker/ROMBlitz_Keep.txt is handled. Can also put a "#" at the start of the line to ignore the entry.
2. Display tweaks
V1.00 (13/05/2015)
1. Initial release
V1.01 (14/05/2015)
1. Improvements to the way /sdcard/tmp/Hawker/ROMBlitz_Keep.txt is handled. Can now also put a "#" at the start of any line to ignore the entry.
2. Display tweaks
Good Work Sir
Sweet as always. I have been using your GS2 & GS4 RomNuke since a while back. Good job as always. Thank you Sir.
I confirm this works like a charm on my sgh-m919!
This is a piece of work that deserves much appreciation. My T-mobile s4 becomes way faster after flashing this! Thanks !
V1.02
1. Convert Kb deletion reporting to Mb/Gb if required.
2. Only show files that will be kept on Int. SD defined in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt that actually exist on the Int. SD Card.
3. /sdcard/tmp/Hawker/ROMBlitz_KeepNone now implemented.
This seems a good cleaner... but im a bit curious...
It will clean my external SD Card or the internal?
I have movies in my SD card.. i want to keep them..
When will i flash this?
Is it before flashing a new ROM?
Thanks...
radz.min said:
This seems a good cleaner... but im a bit curious...
It will clean my external SD Card or the internal?
I have movies in my SD card.. i want to keep them..
When will i flash this?
Is it before flashing a new ROM?
Thanks...
Click to expand...
Click to collapse
It cleans both, but it only wipes INTERNAL on-mass as stated in OP.
The only things that will be removed from external is the /Android folder and any known temporary/cache-type files.
When to flash is up to you. Its all in the OP mate.
Will this work on AOSP?
I want to know if this works on AOSP roms as well.
Yousvel said:
I want to know if this works on AOSP roms as well.
Click to expand...
Click to collapse
I've not tried it personally, but there's no reason at all why it shouldn't
disconnect MTP in TWRP or it will not work
great work, regards
V1.03
1. Report any files/folders in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt that do not exist on the Int. SD Card.
2. Script will now attempt to execute even if no build.prop file present (eg. after a /system wipe)
3. Fixed deletion of file names containing any space characters.
4. Display tweaks
Hi, after read and read and read, I have a doubt yet... Thus script wipe only internal SD and delete only /Android folder in external SD? Or there is a risk to loose all my data in external SD? Thanks
biazoto said:
Hi, after read and read and read, I have a doubt yet... Thus script wipe only internal SD and delete only /Android folder in external SD? Or there is a risk to loose all my data in external SD? Thanks
Click to expand...
Click to collapse
I'll quote OP for you
ROMBlitz Steps
Removes [int-sd]/Android and [ext-sd]/Android folders
Remove ALL files+folders from Internal SD card, except for any defined in /sdcard/tmp/Hawker/ROMBlitz_Keep.txt
Delete ALL known temporary files found on the entire device
Remove ALL known media cache, databases, thumbnails etc. found on the entire device, and create .nomedia file in known areas that do not require media files, in order to speed up the Media Scanner process
Wipe dalvik cache from /data and /cache areas
Wipe all known cache areas from /cache, /data/system/cache and all individual application cache
V1.04 (21/11/2015)
1. Better handling of file names containing spaces, including keep files
2. Hidden (.*) files are now also removed from Internal SD
3. Improved device detection
Updated non-working download links (I think it may have been because I am no longer an XDA Recognized Contributor)
Also, updated to 1.05

Categories

Resources