[Xperia Z1 Compact Android Development] zxz0O0:
And update-script of flashable zip

show_progress(0.000000, 0);

ui_print("");ui_print("");ui_print("");
ui_print("===============================================");
ui_print("| |");
ui_print("| From [NUT] to the XDA Xperia Community: |");
ui_print("| |");
ui_print("| The personalized update flasher! |");
ui_print("| |");
ui_print("| ** Including ROOT and XZDualRecovery ** |");
ui_print("| |");
ui_print("===============================================");
ui_print("");

set_progress(0.000000);

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

ui_print("");
ui_print(" Extracting firmware update image file...");
ui_print("");
ui_print(" NOTE: This may take a while!");
ui_print("");
package_extract_file("system.tgz", "/data/media/system.tgz");
set_progress(0.400000);

ui_print(" Formatting SYSTEM...");
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
ui_print("");
set_progress(0.500000);

ui_print(" Extracting firmware update to SYSTEM...");
ui_print("");
ui_print(" NOTE: This may take a while!");
ui_print("");
package_extract_file("system/xbin/busybox", "/sbin/busybox");
set_perm(0, 2000, 0755, "/sbin/busybox");
run_program("/sbin/busybox", "tar", "-zxf", "/data/media/system.tgz", "-C", "/system");

package_extract_file("backupstockbinaries.sh", "/sbin/backupstockbinaries.sh");
set_perm(0, 0, 0755, "/sbin/backupstockbinaries.sh");
run_program("/sbin/backupstockbinaries.sh");

run_program("/sbin/busybox", "rm", "-f", "/data/media/system.tgz");
package_extract_dir("system", "/system");
set_progress(0.750000);

package_extract_dir("tmp", "/tmp");
set_perm(0, 0, 0755, "/tmp/installstock.sh");
run_program("/tmp/installstock.sh");
set_perm(0, 0, 0755, "/tmp/installdisableric.sh");
run_program("/tmp/installdisableric.sh");

ui_print(" Saving version...");
set_perm(0, 0, 0755, "/tmp/setversion.sh");
run_program("/tmp/setversion.sh");

ui_print(" Performing finalizing tasks...");
run_program("/sbin/busybox", "cp", "/system/xbin/busybox", "/system/.XZDualRecovery/busybox");
run_program("/sbin/busybox", "ln", "-sf", "/system/xbin/su", "/system/bin/su");
run_program("/sbin/busybox", "cp", "/system/xbin/su", "/system/xbin/daemonsu");
run_program("/sbin/busybox", "mkdir", "/system/bin/.ext");
run_program("/sbin/busybox", "cp", "/system/xbin/su", "/system/bin/.ext/.su");

set_perm(0, 2000, 0644, "/system/bin/recovery.cwm.cpio.lzma");
set_perm(0, 2000, 0644, "/system/bin/recovery.philz.cpio.lzma");
set_perm(0, 2000, 0644, "/system/bin/recovery.twrp.cpio.lzma");
set_perm(0, 2000, 0755, "/system/bin/mr");
set_perm(0, 2000, 0755, "/system/bin/chargemon");
set_perm(0, 2000, 0755, "/system/bin/dualrecovery.sh");
set_perm(0, 2000, 0755, "/system/bin/rickiller.sh");
set_perm(0, 2000, 0755, "/system/xbin/busybox");

set_perm(0, 0, 0777, "/system/bin/.ext");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/daemonsu");
set_perm(0, 0, 0644, "/system/etc/.installed_su_daemon");
set_perm(0, 0, 0755, "/system/etc/install-recovery.sh");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d/99SuperSUDaemon");

package_extract_file("supersu.sh", "/sbin/supersu.sh");
set_perm(0, 2000, 0755, "/sbin/supersu.sh");
run_program("/sbin/supersu.sh");
set_progress(0.950000);

ui_print(" Unmounting partitions...");
unmount("/system");
unmount("/data");
set_progress(1.000000);

ui_print("");
ui_print("===============================================");
ui_print("| |");
ui_print("|	>> Have fun and enjoy! << |");
ui_print("| |");
ui_print("| Hit >> thanks << if you like it! |");
ui_print("| |");
ui_print("===============================================");