assert(getprop("ro.product.device") == "m7" || getprop("ro.build.product") == "m7" || getprop("ro.product.device") == "m7att" || getprop("ro.build.product") == "m7att" || getprop("ro.product.device") == "m7tmo" || getprop("ro.build.product") == "m7tmo" || getprop("ro.product.device") == "m7ul" || getprop("ro.build.product") == "m7ul" || abort("This package is for device: m7,m7att,m7tmo,m7ul; this device is " + getprop("ro.product.device") + "."););
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
run_program("/sbin/busybox", "mount", "/system");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
run_program("/sbin/busybox", "mount", "/data");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
ui_print("                             ");
ui_print("*****************************");
ui_print("  ______   _______  _______  ");
ui_print(" (_____ \ (_______)(_______) ");
ui_print("  _____) ) _______  _        ");
ui_print(" |  ____/ |  ___  || |       ");
ui_print(" | |      | |   | || |_____  ");
ui_print(" |_|      |_|   |_| \______) ");
ui_print("                             ");
ui_print("  ______   _______  _______  ");
ui_print(" (_____ \ (_______)(_______) ");
ui_print("  _____) ) _     _  _  _  _  ");
ui_print(" |  __  / | |   | || ||_|| | ");
ui_print(" | |  \ \ | |___| || |   | | ");
ui_print(" |_|   |_| \_____/ |_|   |_| ");
ui_print("                             ");
ui_print("       www.pac-rom.com       ");
ui_print("                             ");
ui_print("*****************************");
ui_print("                             ");
show_progress(0.750000, 0);
ui_print("Updating system partition");
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
show_progress(0.020000, 10);
run_program("/sbin/busybox", "mount", "/system");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
ui_print("Updating boot image");
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.200000, 10);
ui_print("Thanks for choosing PAC-ROM!");
