(!less_than_int(1466415445, getprop("ro.build.date.utc"))) || abort("Can't install this package (Mon Jun 20 17:37:25 SGT 2016) over newer build (" + getprop("ro.build.date") + ").");
getprop("ro.product.device") == "CHDROID" || abort("This package is for \"CHDROID\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Target: CHD/CHDROID/CHDROID:6.0.1/1.0.0-ga-rc6/20160331:user/release-keys");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/mmcblk1p5", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/mmcblk1p5", "18,0,32767,32768,32770,32801,32803,33203,65535,65536,65538,65938,82787,98304,98306,98337,98339,98739,102399") == "d3949d8166a44f798ac95bac175e73260734b677" then
if range_sha1("/dev/block/mmcblk1p5", "20,32767,32768,32770,32801,32803,33203,65535,65536,65538,65938,82787,83299,97792,98304,98306,98337,98339,98739,102399,102400") == "dec5cd08703ef7be3b949b4b02b0238d236a3da3" then
ui_print("Verified the updated system image.");
else
  abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
  abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/mmcblk1p1");
show_progress(0.200000, 10);
