getprop("ro.product.device") == "m7332" || abort("E3004: This package is for \"mediatek\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("start update..");
show_progress(0.100000, 0);
show_progress(0.200000, 1);
show_progress(0.200000, 1);
show_progress(0.200000, 1);

ui_print("update vendor......");
run_program("/system/bin/mount","-o","rw",map_partition("vendor"),"/vendor");
package_extract_file("keylayout/Vendor_3697_Product_0002.kl", "/vendor/usr/keylayout/Vendor_3697_Product_0002.kl");
package_extract_file("CusUpdateRecorder.ini", "/vendor/etc/CusUpdateRecorder.ini");
run_program("/system/bin/busybox","chmod","777","/vendor/etc/CusUpdateRecorder.ini");
run_program("/system/bin/busybox","sed","-i","s/ro.product.manufacturer=.*/ro.product.manufacturer=OTA_PACK_YM-2022978/","/vendor/ctvbuild.prop");
unmount("/vendor");
show_progress(0.200000, 1);
show_progress(0.100000, 1);

MbootSetenv("db_table", "0");
MbootSetenv("mboot_default_env", "0");
MbootSetenv("sync_mmap", "1");
ui_print("end update..");
set_progress(1.000000);
