Okay a flashable .zip consists of several prequisites. It contains an Updater-Script housed in /META-INF/com/google/android/. This updater-script tells the phone (the recovery) how to install whatever it is you're trying to install. We use this to make flashable roms and other updates you apply.
To create a flashable.zip that installs a bootanimation, or a set of fonts, or something similar the only thing you'll need to know how to do is to make the flashable.zip delete what was previously there (what you're replacing) and push the new one on. Keep in mind that these are very basic examples.
Code:
ui_print("Applying New Bootanimation");
run_program("/sbin/busybox", "mount", "/system");
delete("/system/customize/resource/boost_bootanimation.zip");
package_extract_dir("system", "/system/customize/resource/");
run_program("/sbin/busybox", "umount", "/system");
ui_print("New Bootanimation Installed");
Now I'm going to break this script down for you and explain how it works.
The first line "ui_print" simply prints a message on the screen. It is not needed but I do it to let you know what's going on in the script.
The second line "run_program" is running busybox and mounting /system as writable. This is a must in an updater-script if you're going to be deleting anything or adding anything. The syntax will always be the command, in this case run_program followed by the directory of the program, what you want it to run, and in this case what you want to be mounted. So here we're running busybox from sbin and we're mounting /system as writable.
The next step is to delete what we're going to replace. So we're running delete("/system/customize/resource/boost_bootanimation.zip"); cause we're deleting the old boost_bootanimation.zip.
Now in this basic concept of an update.zip the META-INF folder and a folder called "system" should be created. I use /system because thats the name of the home folder where the boost_bootanimation is housed.
Now I'll explain the next line: package_extract_dir("system", "/system/customize/resource");.
This line is telling the phone to find the folder you created in your flashable .zip. In this case it's a folder called "system". The next part of the line is telling the phone where to extract the contents of that directory. In this case its extracting it to /system/customize/resource (because that's where the bootanimation is housed on this particular phone). *
Your phone and rom may vary*.
The next line is telling the phone to Unmount /system. You must do this! The syntax for busybox to unmount is "umount". So in this case we use run_program busybox from sbin, we're telling it to unmount (umount) /system.
And of course the next line is printing a message letting the user know what the status is.
Some things to keep in mind. While you can open an updater-script with other text editors, the reason we use Notepad++ if using Windows is because it keeps the UNIX formatting of the script. If a script loses that Linux/UNIX formatting it will not work. Opening it with Notepad or WordPad will kill this encoding and the script will no longer work. If you use Notepad++ you can edit Unix based scripts quite easily just remember to save them by hitting CTRL+S or going to File->Save (
NOT SAVE AS). You don't want to save it as a .txt file you want to keep this original formatting. If you get status 7 or status 0 errors when flashing an update you probably lost this very important encoding.
And that's it that's how you make an updater-script.
Note: "How you set up the folders inside of your update.zip to include your files, apps, etc, is based on the user. Can be done in many ways. The only thing required from that is insuring the updater-script places them in their proper locations when applying them to your actual phone. in addition, depending upon where they go, I.e. system or data, you must insure you mount the proper partition(s) before the tasks take place, and then unmounting those partitions before the script completes itself.