#getprop("ro.product.device") == "Hi3798MV310" || abort("This package is for \"Hi3798MV310\" devices; this is a \"" + getprop("ro.product.device") + "\".");
show_progress(0.800000, 80);
format("ext4", "EMMC", "/dev/block/platform/soc/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/soc/by-name/system", "/system");
package_extract_dir("system", "/system");
symlink("/system/lib/libwebviewchromium.so", "/system/app/webview/lib/arm/libwebviewchromium.so");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
        "/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
        "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
        "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
        "/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
        "/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
        "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
        "/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
        "/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
        "/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
        "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
        "/system/bin/mkdir", "/system/bin/mkswap", "/system/bin/mount",
        "/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
        "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
        "/system/bin/ps", "/system/bin/r", "/system/bin/readlink",
        "/system/bin/renice", "/system/bin/restorecon", "/system/bin/rm",
        "/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
        "/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
        "/system/bin/setconsole", "/system/bin/setenforce",
        "/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
        "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
        "/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
        "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
        "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
        "/system/bin/wipe");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 2000, 0755, "/system/bin/app_process");
set_perm(0, 0, 0755, "/system/bin/basicService");
set_perm(0, 2000, 0755, "/system/bin/clatd");
set_perm(0, 0, 0755, "/system/bin/codecc");
set_perm(0, 2000, 0755, "/system/bin/debuggerd");
set_perm(0, 2000, 0755, "/system/bin/dhcpcd");
set_perm(0, 2000, 0550, "/system/bin/dhcpcd_am.sh");
set_perm(0, 2000, 0755, "/system/bin/dnsmasq");
set_perm(0, 2000, 0755, "/system/bin/drmserver");
set_perm(0, 2000, 0755, "/system/bin/hostapd");
set_perm(0, 2000, 0755, "/system/bin/installd");
set_perm(0, 2000, 0755, "/system/bin/keystore");
set_perm(1000, 1000, 0500, "/system/bin/kvm");
set_perm(0, 2000, 0755, "/system/bin/mediaserver");
set_perm(0, 2000, 0755, "/system/bin/mksh");
set_perm(0, 2000, 0550, "/system/bin/mmc_lifetime");
set_perm(0, 2000, 0755, "/system/bin/mtpd");
set_perm(0, 3003, 0750, "/system/bin/netcfg");
set_perm(0, 2000, 0755, "/system/bin/netd");
set_perm(0, 2000, 0550, "/system/bin/pcbbomattr");
set_perm(0, 0, 0755, "/system/bin/ping");
set_perm(0, 2000, 0755, "/system/bin/pppd");
set_perm(0, 2000, 0755, "/system/bin/racoon");
set_perm(0, 2000, 0550, "/system/bin/rootsrv");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(0, 2000, 0755, "/system/bin/sdcard");
set_perm(0, 2000, 0755, "/system/bin/servicemanager");
set_perm(0, 2000, 0550, "/system/bin/srv2");
set_perm(0, 2000, 0755, "/system/bin/surfaceflinger");
set_perm(0, 2000, 0777, "/system/bin/xiriservice_kx");
set_perm(0, 2000, 0755, "/system/bin/vold");
set_perm(0, 0, 0755, "/system/bin/vr_bee1_hidraw_daemon");
set_perm(0, 2000, 0755, "/system/bin/wpa_supplicant");
set_perm(1000, 1000, 0500, "/system/etc/HmtEquipTest.ini");
set_perm(0, 1000, 0640, "/system/etc/build_hw.prop");
set_perm(1014, 2000, 0550, "/system/etc/dhclient-script");
set_perm_recursive(0, 0, 0755, 0644, "/system/etc/dhcpcd");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(1000, 1000, 0400, "/system/etc/functionkey.xml");
set_perm(0, 2000, 0777, "/system/etc/init.bigfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 0, 0555, "/system/etc/restore");
set_perm(1000, 1000, 0400, "/system/etc/security/cacerts/ca.pem");
set_perm_recursive(1000, 1000, 0755, 0400, "/system/etc/security/i");
set_perm(0, 0, 0755, "/system/etc/security/i");
set_perm(0, 0, 0755, "/system/etc/security/i/c");
set_perm(0, 0, 0555, "/system/etc/security_l2_num");
set_perm(0, 1000, 0640, "/system/etc/user_start.xml");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/vlan");
set_perm_recursive(1000, 1000, 0755, 0400, "/system/iptv/HWB");
set_perm(0, 0, 0755, "/system/iptv/HWB");
set_perm(0, 0, 0755, "/system/iptv/HWB/fonts");
set_perm(0, 0, 0755, "/system/iptv/HWB/page");
set_perm(0, 0, 0755, "/system/iptv/HWB/page/errorpage");
set_perm(0, 0, 0755, "/system/iptv/HWB/page/errorpage/image");
set_perm(0, 0, 0755, "/system/iptv/HWB/plugins");
set_perm(0, 0, 0755, "/system/iptv/HWB/resources");
set_perm(0, 0, 0755, "/system/iptv/HWB/resources/Alert");
set_perm(0, 0, 0755, "/system/iptv/HWB/resources/Load");
set_perm(0, 0, 0755, "/system/iptv/HWB/resources/ScrollbarTheme");
set_perm(0, 0, 0755, "/system/iptv/HWB/resources/Thumbnail");
set_perm(1000, 1000, 0640, "/system/iptv/HWB/resources/deleteButton.png");
set_perm(1000, 1000, 0640, "/system/iptv/HWB/resources/deleteButtonPressed.png");
set_perm(1000, 1000, 0400, "/system/iptv/setting/default.dat");
set_perm(1000, 1000, 0400, "/system/iptv/setting/office.xml");
set_perm(1000, 1000, 0400, "/system/iptv/setting/qoe_config.cfg");
set_perm(1000, 1000, 0400, "/system/iptv/setting/settingdef.dat");
set_perm(1000, 1000, 0700, "/system/iptv/setting/setup.png");
set_perm_recursive(0, 2000, 0755, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/jar");
set_perm(0, 0, 0644, "/system/vendor/jar/hmtos.jar");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib");
set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor_uart.so");
set_perm(0, 0, 0400, "/system/version.xml");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 1000, 0700, "/system/xbin/sqmloader");
set_perm(1000, 1000, 0700, "/system/xbin/sqmpro");
set_perm(1000, 1000, 0400, "/system/xbin/sqmpro.md5");
set_perm(0, 0, 0550, "/system/xbin/tcpdump");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/soc/by-name/kernel");
show_progress(0.050000, 1);
package_extract_file("recovery.img", "/dev/block/platform/soc/by-name/recovery");
package_extract_file("logo.img", "/dev/block/platform/soc/by-name/logo");
package_extract_file("fastboot.img", "/dev/block/platform/soc/by-name/fastboot");
run_program("/system/bin/sh", "/system/etc/post_recovery_ops.sh");
show_progress(0.100000, 0);
unmount("/system");
