[HTC Pico (Explorer)] Red Devil:
#include<greetings.h>

Hey everyone..

#include<introduction.h>

#include<disclaimer.h>

That done and jokes apart. I will start with my guide.

Q.1 What is edify script ? What is its purpose ?​

Edify is a scripting language that is used in order to convey messages from the user to a recovery and instruct the recovery to perform certain predefined operations such as installing ( flashing ) data such as firmware ( ROMs , Kernels etc. ) or software such as apps or framework etc to one of the partitions on the nand memory of a phone. It can also be used to copy , replace or add files and even add certain specific lines , run programs and various other functions. So it basically tells what a recovery it has to do with a zip that has been given to it for being " flashed ".Edify scripting is a replacement for Amend scripting which was earlier used in older phones and android versions like froyo. It was upgraded by Google themselves.

Q.2 So where basically do you find this updater script that you are talking about ?​

It is found in the META-INF folder in any ROM zip. The simplest way to check if a zip is flash-able is to check if it contains the META-INF folder. But it does not guarantee that the ROM is flash-able. The updater script is what actually tells you whether the script is flash-able or not.

Directory of updater script : ..../META-INF/com/google/android/

This directory contains a update-binary file and updater-script file.

Q. 3 I opened the updater-script now. What do these things mean?​

Basic syntax of an View attachment 1802171( Let's say a ROM like Cyanogenmod 10 ) will look somewhat like this :

Assert(condition);
package-extraction-of(backuptool);
setting-permissions-of(backuptool);
execution-of(backuptool);
mounting-of(system-partition); */may include other partitions /*
extraction-of(system-partition);
symlinks-of(various-files); */ files such as busybox files and fonts /*
re-verification-of(various-files); */ files include files such as libararies, binaries , etc etc; /*
setting-permissions-of(various-files); */ miscellaneous files ( many important files too which may affect the ROM during its run-time )/*
extraction-flashing-of(boot.img) */ if your ROM contains kernel /*
un-mounting-of(system-partition); */may include other partitions/*

Q.4 What is x-y-z ? What does that do ?​

There are various functions that can be executed by the recovery during its reading of an updater script.

They are :

1: Assert

Syntax : assert(condition)

Eg :

assert(getprop("ro.product.device") == "pico" || getprop("ro.build.product") == "pico");

This condition does as its name goes; it asserts whether the given condition that has been named is satisfied or not. If not, boom . There itself the execution of the edify script ends.

2: Print

Syntax : ui_print(" message ");

Eg :

ui_print("Installing boot image...");

This is like the printf function in C. It simply prints out what is in quotes. It can be a message or benchmark that can be used to mark the progress of the installation let's say. Or even way for the ROM dev to show off.

3: Mount

Syntax : mount(fs_type, partition-type, location, mount-point)

Eg :

mount("yaffs2", "MTD", "system", "/system");

It mounts the various partitions that are required to be mounted.

4: Unmount

Syntax : unmount("/partition");

Eg :

unmount("/system");

5: Format

Syntax : format(fs_type, partition_type, location)

Eg :

format("yaffs2", "MTD", "system");

It formats the required partitions

6: Delete-recursive

Syntax : delete_recursive(directory-to-file)

Eg :

delete_recursive("/sdcard/.android_secure");

Deletes the file/s at the specified directory.

7: Show-progress

Syntax : show_progress( % of progress, time in seconds);

Eg :

show_progress(0.200000, 10);

Shows the progress in the recovery during the execution of the script.

8: Package-extract

Syntax : package_extract_dir(package path, destination path);

Eg :

package_extract_dir("system", "/system");

Extracts the package from the zip ( package path ) to the part of whichever partition to which the file needs to be written to ( destination path ).

9: Symbolic Link

Syntax : symlink(target-file/string, symlink to be created to that file/string)

Eg :

symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");

Creates symbolic links to the packages/files/strings after breaking any existing ones.

10: Permission

Syntax : set_perm(userid, groupid, type of permission , file-name)

Eg :

set_perm(0, 0, 06755, "/system/xbin/su");

Does what it says.. Sets a permission to at least 1 file.

12: Recursive permission

Syntax : set_perm_recursive(userid, groupid, directory permission , file permission , directory of file)

Eg :

set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");

Sets a permission to directory of the file then to the files within them.

13: Run a program

Syntax : run_program(program name to be executed, arguements);

Eg :

run_program("/tmp/dalvik.sh");

Runs a program that is intended to run. ( file type that can be run is .sh ).

14 : Get a property

Syntax : getprop(property)

Eg :

getprop("ro.build.product") == "pico"

Gets a particular property from the build prop of your device .

15 : File get a property

Syntax : file_getprop(filename, property)

Gets a particular value/string/code from a file in the desired directory.

There are many other various functions that can be executed but these are the basic functions that are usually used by normal ---> semi advanced users.

If you like what you see and if you think you gained some more knowledge by reading this acknowledge this fact by hitting thanks.