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

Root [Help] Make a flashable zip to wipe data, cache and dalvik?

MacFett

Android Expert
How would I go about to make a flashable zip for CWM to wipe my data, cache and dalvik-cache?

I am using Apps2zip to make a flashable app package for when I flash a ROM, but I'd love to be able to flash wipe all needed partitions.
 
How would I go about to make a flashable zip for CWM to wipe my data, cache and dalvik-cache?

I am using Apps2zip to make a flashable app package for when I flash a ROM, but I'd love to be able to flash wipe all needed partitions.

You could try this:

# Wipe data and dalvik

ui_print(" Clearing data and dalvik");
mount("ext4", "EMMC", "/dev/block/mmcblk0p13", "/data");
delete_recursive("/data");

# Wipe cache

ui_print(" Clearing cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p6", "/cache");
delete_recursive("/cache");
 
I found another flashable wipe zip to take a look and see what was happening. with it.

It has two files within the zip.
/META-INF/com/google/android/updater-script
/META-INF/com/google/android/updater-binary

The contents of the script are:
Code:
ui_print("Performing Wipe...");
ui_print("Mounting mount points...");
run_program("/sbin/mount", "/dev/block/platform/s3c-sdhci.0/by-name/system", "/system");
run_program("/sbin/mount", "/dev/block/platform/s3c-sdhci.0/by-name/userdata", "/data");
run_program("/sbin/mount", "/dev/block/mtdblock4", "/cache");
run_program("/sbin/mount", "/dev/block/mtdblock2", "/boot"); 
show_progress(0.1, 0);
ui_print("Wiping BOOT, CACHE, DATA, SYSTEM");
delete_recursive("/boot");
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
show_progress(0.1, 10);
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/data");
run_program("/sbin/umount", "/cache");
ui_print("Wipe Complete.");

The binary is just gobbledy gook.

Thinking about it, I should make one that does system too for doing a nandroid restore and not all ROM will wipe the system partition like Leslie Ann's does.
 
Thanks, I'll try this next time I flash.

If you don't mind telling me what you did? I appreciate that you did it, but I'm trying to learn more to help the community.

What is the update-binary file? Where did you get it?

After making the zip does it need to be signed? You make a zip with no compression correct?

(Normally I try and learn from stuff others ask and post and I find around the net, but this is something I've been unable to find any info.)
 
Thanks, I'll try this next time I flash.

If you don't mind telling me what you did? I appreciate that you did it, but I'm trying to learn more to help the community.

What is the update-binary file? Where did you get it?

After making the zip does it need to be signed? You make a zip with no compression correct?

(Normally I try and learn from stuff others ask and post and I find around the net, but this is something I've been unable to find any info.)

Just read the updater-script in the ZIP I posted.

The update-binary is a compiled file and just about every flashable ZIP contains one version or another. You don't make changes to it yourself. The one I've been using lately is from an update.zip which Titanium Backup creates.

It does not need to be signed, that's what makes CWM so useful.

No compression is prob a good idea, but I'm not sure whether it matters or not.

More info: Free Your Android - An introduction to the Edify (Updater-Script) language
 
I've got two of them. One for installing a new rom and one for updating a rom that LeslieAnn made when I had my OV.
Will post when I get home in a bit.
 
They won't work for elite. The ov was yaffs file system and elite is ext4.

Even if they were the same file system the partitions more than likely wouldn't be the same.
 
They won't work for elite. The ov was yaffs file system and elite is ext4.

Even if they were the same file system the partitions more than likely wouldn't be the same.

I tested the Prep for a new rom and it seemed to work fine, but I didn't test the update for a new rom.
Oh, well. Ok then.
 
Maybe I'm wrong then.. I thought the difference in file system and partitions would prevent it from working . They made be made in a way that might work. I'll have to look at them
 
Maybe I'm wrong then.. I thought the difference in file system and partitions would prevent it from working . They made be made in a way that might work. I'll have to look at them

I wouldn't think it would work either, but I could be wrong.
 
The thing that's going to matter is whether its written in edify or amend scripting, and which one your recovery uses
 
The thing that's going to matter is whether its written in edify or amend scripting, and which one your recovery uses

I was thinking it wouldn't work because the other phone probably uses mtd and so the script might just simply mount /data and /cache as opposed to specifying the partitions by mmcblk0p*. But yeah, if that is the case, it should be easy to update the script.

Isn't amend for CWM versions prior to v3?
 
I was thinking it wouldn't work because the other phone probably uses mtd and so the script might just simply mount /data and /cache as opposed to specifying the partitions by mmcblk0p*. But yeah, if that is the case, it should be easy to update the script.

Isn't amend for CWM versions prior to v3?

I personally won't use Cwm, so I don't know at what point it switched. :confused:

The recovery should handle the partitions and mounts. I would think the script should be easy enough to write
 
The thing that's going to matter is whether its written in edify or amend scripting, and which one your recovery uses
Amend hasn't been used in a year, Edify has been standard since GB took over.

What it depends on is what the recovery supports (Amend or Edify), and what the install Binary is using, such as yaffs.

Another consideration is if the recovery know what partition is where. In our case the recovery doesn't understand that /system is located at block 12 so the installer has to account for that by telling it.



The link I posted has the flashable zips done for the Elite. They should work fine as they are based on the code used for formatting the roms.
 
Amend hasn't been used in a year, Edify has been standard since GB took over.

What it depends on is what the recovery supports (Amend or Edify), and what the install Binary is using, such as yaffs.

Another consideration is if the recovery know what partition is where. In our case the recovery doesn't understand that /system is located at block 12 so the installer has to account for that by telling it.



The link I posted has the flashable zips done. They should work fine as they are based on the code used for formatting the roms.

Ah, your phone complicates things then. Thanks for clearing that up.


There are still plenty of alternative recoveries out there that support both scripts
 
Thanks, I'll try this next time I flash.

If you don't mind telling me what you did? I appreciate that you did it, but I'm trying to learn more to help the community.

What is the update-binary file? Where did you get it?

After making the zip does it need to be signed? You make a zip with no compression correct?

(Normally I try and learn from stuff others ask and post and I find around the net, but this is something I've been unable to find any info.)

It seems like you use CWM, but the TWRP website has a binary to use that seems to work on all.
 
Back
Top Bottom