(!less_than_int(1686911259, getprop("ro.build.date.utc"))) || abort("Can't install this package (Fri Jun 16 18:27:39 CST 2023) over newer build (" + getprop("ro.build.date") + ").");
getprop("ro.product.device") == "CX6700" || abort("This package is for \"CX6700\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Target: Leadcore/full_CX6700/CX6700:6.0.1/MRA58K/13:userdebug/test-keys");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/comip-mmc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/platform/comip-mmc.1/by-name/system", "20,0,7359,32768,32770,32817,32819,65536,65538,98304,98306,98353,98355,131072,131074,163840,163842,163889,163891,164361,180223") == "946e75e2027cf4bfdfa8e97a73663b366d3eff7e" then
if range_sha1("/dev/block/platform/comip-mmc.1/by-name/system", "30,7359,7871,32256,32768,32770,32817,32819,33331,65024,65536,65538,66050,97792,98304,98306,98353,98355,98867,130560,131072,131074,131586,163328,163840,163842,163889,163891,164361,180223,180224") == "531b89df3259c25194f22d1b714ea74cb063eb9e" 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/platform/comip-mmc.1/by-name/ramdisk");
show_progress(0.200000, 10);
ui_print("Writing kernel ...");
package_extract_file("kernel", "/dev/block/platform/comip-mmc.1/by-name/kernel");
ui_print("Writing lc6600_project.dtb ...");
package_extract_file("lc6600_project.dtb", "/dev/block/platform/comip-mmc.1/by-name/lcboot");
ui_print("Writing u-boot.bin ...");
package_extract_file("u-boot.bin", "/dev/block/mmcblk0boot0");
ui_print("Writing modemdsp0.bin ...");
package_extract_file("modemdsp0.bin", "/dev/block/platform/comip-mmc.1/by-name/modemdsp");
ui_print("Writing modemarm.bin ...");
package_extract_file("modemarm.bin", "/dev/block/platform/comip-mmc.1/by-name/modemarm");
