[G2 Android Development] aromano91:
ok...for example these one take a look...

assert(getprop("ro.product.device") == "d802" || getprop("ro.build.product") == "d802" || getprop("ro.product.device") == "g2" || getprop("ro.build.product") == "g2" || getprop("ro.product.device") == "galbi" || getprop("ro.build.product") == "galbi" || getprop("ro.product.device") == "d800" || getprop("ro.build.product") == "d800" || abort("This package is for device: d802,g2,galbi,d800; this device is " + getprop("ro.product.device") + "."););

if ! is_mounted("/system") then

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

endif;

package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");

package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");

set_metadata("/tmp/backuptool.sh", "uid", 0, "gid", 0, "mode", 0755);

set_metadata("/tmp/backuptool.functions", "uid", 0, "gid", 0, "mode", 0644);

run_program("/tmp/backuptool.sh", "backup");

unmount("/system");

if is_mounted("/data") then

package_extract_file("system/bin/otasigcheck.sh", "/tmp/otasigcheck.sh");

package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");

set_metadata("/tmp/otasigcheck.sh", "uid", 0, "gid", 0, "mode", 0755);

run_program("/tmp/otasigcheck.sh") == "0" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");

else

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data", "");

package_extract_file("system/bin/otasigcheck.sh", "/tmp/otasigcheck.sh");

package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");

set_metadata("/tmp/otasigcheck.sh", "uid", 0, "gid", 0, "mode", 0755);

run_program("/tmp/otasigcheck.sh") == "0" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");

unmount("/data");

endif;

show_progress(0.750000, 0);

block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

delete("/system/bin/otasigcheck.sh");

unmount("/system");

show_progress(0.020000, 10);

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");

package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");

set_metadata("/tmp/backuptool.sh", "uid", 0, "gid", 0, "mode", 0755);

set_metadata("/tmp/backuptool.functions", "uid", 0, "gid", 0, "mode", 0644);

run_program("/tmp/backuptool.sh", "restore");

delete("/system/bin/backuptool.sh");

delete("/system/bin/backuptool.functions");

unmount("/system");

show_progress(0.050000, 5);

show_progress(0.200000, 10);

package_extract_file("boot.img", "/tmp/boot.img");

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

assert(run_program("/system/bin/loki.sh") == 0);

delete("/system/bin/loki.sh");

unmount("/system");

ui_print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");

ui_print(" \ ) ( )\ ) )\ ) ");

ui_print(" (()/ ( ( )\ ( (()/((()/( ");

ui_print(" (_)) ((_) (_)_) /((_)(_)) (_)) ");

ui_print(" | | (_) / _ \ (_))( |_ _| | \ ");

ui_print(" | |__ | || (_) || || | | | | |) | ");

ui_print(" |____||_| \__\_\ \_,_||___| |___/ ");

ui_print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");

ui_print(" <%%% Liquid-lollipop %%%> ");

ui_print(" <%%% By LiquidSmooth %%%> ");

ui_print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");