ui_print("****************************");
ui_print("* *");
ui_print("* REDMI Unique *");
ui_print("* by REDMI Team *");
ui_print("* www.miui.cz *");
ui_print("****************************");
show_progress(0.500000, 0);
ui_print("Installing update files...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
delete_recursive("/system/etc/init.d/");
package_extract_dir("system", "/system");
ui_print("Set permission...");
set_perm_recursive(0, 0, 0755, 0644, "/system/ota.prop");
set_perm_recursive(0, 0, 0755, 0644, "/system/rom.ota.prop");
set_perm(0, 0, 0755, "/system/etc/init.d/01MTKTweakCPU");
set_perm(0, 0, 0777, "/system/etc/init.d/02MTKTweakRam");
set_perm(0, 0, 0777, "/system/etc/init.d/03MTKTweakElse");
set_perm(0, 0, 0777, "/system/etc/init.d/04SDspeedfix");
set_perm(0, 0, 0777, "/system/etc/init.d/05Tweaks");
set_perm(0, 0, 0777, "/system/etc/init.d/06memery");
ui_print("Update Boot image...");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
package_extract_file("boot.img", "/dev/bootimg");
unmount("/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/data");
package_extract_dir("data", "/data");
set_perm(0, 0, 0644, "/data/miui/gallery/city.db");
show_progress(0.100000, 0);
ui_print("****************************");
ui_print("* *");
ui_print("* Install complete *");
ui_print("* Enjoy new ROM *");
ui_print("* *");
ui_print("****************************");
unmount("/data");