[Samsung Galaxy SL i9003] falex007:
For developers

I wanted to make FAQ how to make themes: SCIENTYREAL was the first. OK here his post

HOW-TO Create update.zip

Remember:

1. All update.zip files should have special structure of directories inside the ZIP archive:

META-INF — directory contains signature of your package and updater-script that executes when you apply this archive from the recovery console

script should be placed in the path update.zip/META-INF/com/google/android/updater-script

The sript needs binary file from its work. The binary is placed in the path update.zip/META-INF/com/google/android/update-binary

I attached it to this post

all other directories contain content should be applied.

If you will create package for CWM you don't need to sign your update.zip. You can read this topic how to sign your update.zip by test signature. And this post with detailed instruction how to create update.zip for custom recovery

2. About syntax of updater-script you can read here, here and here

Here is description of commands (thanks to sk0t from 4pda.ru)

package_extract_dir

Syntax: package_extract_dir("<src-dir>", "<dst-dir>");

Extracts files from <src-dir> into <dst-dir>. All files from <dst-dir> that exist into <src-dir> will be rewritten

Example: package_extract_dir("system", "/system"); Copy files from update.zip/system into /system

package_extract_file

Syntax: package_extract_file("<src-file>", "<dst-file>");

Copies file <src-file> to <dst-file>. If file <dst-file> exists it will be rewritten.

Example: package_extract_file("test.sh", "/tmp/test.sh"); Copies test.sh from update.zip into /tmp/test.sh

format

Syntax: format("MTD", "<root>");

Formats partition <root>.

Example: format("MTD", "system"); Formats /system . NOTE: it will remove everything from partition /system!

delete

Syntax: delete("<file1>"[, "file2", ..."fileN"]);

Rempves file(s)

Example: delete("/system/app/Calculator.apk"); Removes Calculator.apk from /system/app.

delete_recursive

Syntax: delete_recursive("<dir1>"[, "dir2", ..."dirN"]);

Removes directory(-ies) recursivelly

Example: delete_recursive("/data/dalvik-cache"); Removes directory /data/dalvik-cache with everything inside.

run_program

Syntax: run_program("<filetorun>"[, "<opt1>", "<opt2>", "<opt3>"]);

Starts program (script) <filetorun> [with parameters].

Example: run_program("/tmp/install_busybox.sh"); Starts script /tmp/install_busybox.sh.

set_perm

Syntax: set_perm(<uid>, <gid>, <mode>, "<pathtofile>"[, ... "pathtofileN"]);

Sets owner, group and permissions for file or directory (like chmod, chown and chgrp in unix)

Example: set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh"); Sets owner, group and permissions for file /system/etc/init.goldfish.sh

set_perm_recursive

Syntax: set_perm_recursive(<uid>, <gid>, <dir-mode>, <file-mode>, "<path>"[, ... "<pathN>"]);

The same as set_perm, but works recursively. <dir-mode> - permissions for directories, <file-mode> - permissions for files.

Example: set_perm_recursive(0, 0, 0755, 0644, "/system/app"); Sets permissions for content of /system/app, for directories - 0755, for files - 0644.

show_progress

Syntax: show_progress(<fraction>, <duration>);

Moves progressbar to <fraction> parts each <duration> seconds. <duration> can be 0 for moving progressbar by command set_progress, but not by time.

Example: show_progress(0.100000, 1); Increses progress on 0.1 part every 1 second

set_progress

Syntax: set_progress(<fraction>);

Sets position of progress bar to <fraction>.

Example: set_progress(0.500000);

symlink

Syntax: symlink("<link-target>", "<link-path1"[, "<link-path2>", "<link-path3>"]);

Creates symlink (like ‘ln -s’).

Example: symlink("/data/app_s", "/system/app"); Creates symlink /data/app_s for directory /system/app

mount

Syntax: mount("<kind>", "<what>", "<path>");

Mounts <what> in the path <path>. <what> should be name of partition if <kind> is "MTD", or block device if <kind> is "vfat"

Example: mount("MTD", "userdata", "/data");

unmount

Syntax: unmount("<path>");

Unmount <path>.

Example: unmount("/data");

ui_print

Syntax: ui_print("<message>");

Prints on screen message <message>

Example: ui_print("Formatting SYSTEM...");

Example of the script file

show_progress(0.100000, 0);
ui_print("Mounting SYSTEM...");
mount("MTD", "system", "/system");
show_progress(0.100000, 0);
ui_print("Extracting files...");
package_extract_dir("system", "/system");
show_progress(0.400000, 0);
ui_print("Setting permissions...");
set_perm(0, 0, 0644, "/system/framework/framework-res.apk");
show_progress(0.200000, 0);
ui_print("Unmounting SYSTEM...");
unmount("/system");
show_progress(0.100000, 0);

Remember to mount system partition when you are changing something there. Because CWM doesn't mount it

3. OK. Now we are ready to create our own update.zip script:

For example you created modification of theme. The modification contains: /system/framework/framework-res.apk, /system/framework/framework.jar, /system/framework/twframework-res.apk and /system/app/Phone.apk

3.1. create the directory where you will reproduce the structure of update.zip. For example c:\update Create the following directories inside that directory:

View attachment 665333

3.2. Update script content is described below as example

3.3. Archive the content of that directory as ZIP archive (inside archive shouldn't be update directory!)

That's all! Unsigned update.zip is created