ui_print(" ");
ui_print("****************************************************");
ui_print("*                                                  *");
ui_print("*             Flashable zip for LG-G6              *");
ui_print("*        LG-US997 20A Stock BOOTLOADER ONLY        *");
ui_print("*                                                  *");
ui_print("****************************************************");
sleep(3);
ui_print(" ");
set_progress(0.100000);
package_extract_dir("bootloader", "/tmp");
    set_perm_recursive(0, 0, 0777, 0777, "/tmp");
ui_print("            Checking SHA1 checksum");
set_progress(0.200000);
ui_print(" ");
apply_patch_check("/tmp/aboot.img", "11243fa4f4843e9036ac1f52909a20f954c8d1cd") || abort("\"/tmp/aboot.img\" has failed verification.");
apply_patch_check("/tmp/apdp.img", "f87a8ffb55882b92e5f0651dc031969dcefefe39") || abort("\"/tmp/apdp.img\" has failed verification.");
apply_patch_check("/tmp/cmnlib.img", "b7e0591d7bd9d5efba07d49b6cc88320b0f8b477") || abort("\"/tmp/cmnlib.img\" has failed verification.");
apply_patch_check("/tmp/cmnlib64.img", "a6f5cad1578939c1ca5a4a2ae8d3f6ebe242b01f") || abort("\"/tmp/cmnlib64.img\" has failed verification.");
apply_patch_check("/tmp/devcfg.img", "b3d40b0934f9475f44c50b7ec2651839a53b5226") || abort("\"/tmp/devcfg.img\" has failed verification.");
apply_patch_check("/tmp/factory.img", "35c1527bc82edda85a45e55adfe77d049b6115ba") || abort("\"/tmp/factory.img\" has failed verification.");
apply_patch_check("/tmp/hyp.img", "2f05f10b88c263b91fd9000e01edca29018721d1") || abort("\"/tmp/hyp.img\" has failed verification.");
apply_patch_check("/tmp/keymaster.img", "9702f6e64e1dd5954cbd33ff9819b5ccb04c651e") || abort("\"/tmp/keymaster.img\" has failed verification.");
apply_patch_check("/tmp/laf.img", "79d0218a41911b8c759ce0cbda702e8bcc550cc6") || abort("\"/tmp/laf.img\" has failed verification.");
apply_patch_check("/tmp/msadp.img", "139e0abb85cb95adf3793d857637815e169c7a41") || abort("\"/tmp/msadp.img\" has failed verification.");
apply_patch_check("/tmp/pmic.img", "7962cc8860ba02118d2ea368fc8d873aacb078bf") || abort("\"/tmp/pmic.img\" has failed verification.");
apply_patch_check("/tmp/raw_resources.img", "16b9720adc7d65796aab4f7d08d3d6c144b9a913") || abort("\"/tmp/raw_resources.img\" has failed verification.");
apply_patch_check("/tmp/rpm.img", "d326869c6b03dff59557077d2ea4b3bd1adc89b7") || abort("\"/tmp/rpm.img\" has failed verification.");
apply_patch_check("/tmp/sec.img", "dd263a90d8ef2b73fe5b9e1c3fba1ff9c0a38b5a") || abort("\"/tmp/sec.img\" has failed verification.");
apply_patch_check("/tmp/tz.img", "7031667f428f4a68a1f545278946e42aa052a8d9") || abort("\"/tmp/tz.img\" has failed verification.");
apply_patch_check("/tmp/xbl.img", "93a505ced8b763ccc35a8735a64efdac07507a18") || abort("\"/tmp/xbl.img\" has failed verification.");
apply_patch_check("/tmp/xbl2.img", "93a505ced8b763ccc35a8735a64efdac07507a18") || abort("\"/tmp/xbl.img\" has failed verification.");
ui_print(" ");
set_progress(0.400000);
ui_print("Now it´s time to flash. ;)");
ui_print(" ");
set_progress(0.500000);
package_extract_file("bootloader/aboot.img", "/dev/block/bootdevice/by-name/aboot");
package_extract_file("bootloader/aboot.img", "/dev/block/bootdevice/by-name/abootbak");
package_extract_file("bootloader/apdp.img", "/dev/block/bootdevice/by-name/apdp");
package_extract_file("bootloader/cmnlib.img", "/dev/block/bootdevice/by-name/cmnlib");
package_extract_file("bootloader/cmnlib.img", "/dev/block/bootdevice/by-name/cmnlibbak");
package_extract_file("bootloader/cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64");
package_extract_file("bootloader/cmnlib64.img", "/dev/block/bootdevice/by-name/cmnlib64bak");
package_extract_file("bootloader/devcfg.img", "/dev/block/bootdevice/by-name/devcfg");
package_extract_file("bootloader/devcfg.img", "/dev/block/bootdevice/by-name/devcfgbak");
package_extract_file("bootloader/factory.img", "/dev/block/bootdevice/by-name/factory");
package_extract_file("bootloader/hyp.img", "/dev/block/bootdevice/by-name/hyp");
package_extract_file("bootloader/hyp.img", "/dev/block/bootdevice/by-name/hypbak");
package_extract_file("bootloader/keymaster.img", "/dev/block/bootdevice/by-name/keymaster");
package_extract_file("bootloader/keymaster.img", "/dev/block/bootdevice/by-name/keymasterbak");
package_extract_file("bootloader/laf.img", "/dev/block/bootdevice/by-name/laf");
package_extract_file("bootloader/msadp.img", "/dev/block/bootdevice/by-name/msadp");
package_extract_file("bootloader/pmic.img", "/dev/block/bootdevice/by-name/pmic");
package_extract_file("bootloader/pmic.img", "/dev/block/bootdevice/by-name/pmicbak");
package_extract_file("bootloader/raw_resources.img", "/dev/block/bootdevice/by-name/raw_resources");
package_extract_file("bootloader/raw_resources.img", "/dev/block/bootdevice/by-name/raw_resourcesbak");
package_extract_file("bootloader/rpm.img", "/dev/block/bootdevice/by-name/rpm");
package_extract_file("bootloader/rpm.img", "/dev/block/bootdevice/by-name/rpmbak");
package_extract_file("bootloader/sec.img", "/dev/block/bootdevice/by-name/sec");
package_extract_file("bootloader/tz.img", "/dev/block/bootdevice/by-name/tz");
package_extract_file("bootloader/tz.img", "/dev/block/bootdevice/by-name/tzbak");
package_extract_file("bootloader/xbl.img", "/dev/block/bootdevice/by-name/xbl");
package_extract_file("bootloader/xbl.img", "/dev/block/bootdevice/by-name/xblbak");
package_extract_file("bootloader/xbl2.img", "/dev/block/bootdevice/by-name/xbl2");
package_extract_file("bootloader/xbl2.img", "/dev/block/bootdevice/by-name/xbl2bak");
package_extract_file("modem.img", "/dev/block/bootdevice/by-name/modem");
package_extract_file("persist.img", "/dev/block/bootdevice/by-name/persist");
package_extract_file("rct.img", "/dev/block/bootdevice/by-name/rct");
set_progress(0.700000);
ui_print(" ");
set_progress(0.900000);
ui_print("Zip successfully installed have fun");
ui_print(" ");
ui_print("++++++++++++++++++++++++++++++++++++++++++");
ui_print("+ Original zip script by XDA Westwood24  +");
ui_print("+ Updated to v20a with sysdumps by zefie +");
ui_print("++++++++++++++++++++++++++++++++++++++++++");
set_progress(1.000000);

