Titokhan

Block based OTA

Sep 4th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. assert(getprop("ro.product.device") == "YUREKA" || getprop("ro.build.product") == "YUREKA" || abort("This package is for device: YUREKA; this device is " + getprop("ro.product.device") + "."););
  2. ui_print("Verifying current system...");
  3. getprop("ro.build.fingerprint") == "YU/YUREKA/YUREKA:5.0.2/LRX22G/YNG1TAS1K0:user/release-keys" ||
  4. getprop("ro.build.fingerprint") == "YU/YUREKA/YUREKA:5.0.2/LRX22G/YNG1TAS34J:user/release-keys" ||
  5. abort("Package expects build fingerprint of YU/YUREKA/YUREKA:5.0.2/LRX22G/YNG1TAS1K0:user/release-keys or YU/YUREKA/YUREKA:5.0.2/LRX22G/YNG1TAS34J:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
  6. apply_patch_check("EMMC:/dev/block/bootdevice/by-name/boot:16930816:e28dfc6e0fb57fc2a4d670ae97b1b93f439d9db5:16949248:175e731e42a687813b135083f3f3b8e1da3463a3") || abort("\"EMMC:/dev/block/bootdevice/by-name/boot:16930816:e28dfc6e0fb57fc2a4d670ae97b1b93f439d9db5:16949248:175e731e42a687813b135083f3f3b8e1da3463a3\" has unexpected contents.");
  7.  
  8. # ---- start making changes here ----
  9.  
  10. (range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1") == "f1a4eb3c662886cde4675d2968cd48c5ecdfdffa") || abort("/dev/block/bootdevice/by-name/system has been remounted R/W; reflash device to reenable OTA updates");
  11. if range_sha1("/dev/block/bootdevice/by-name/system", "46,0,32770,32849,32851,33331,65535,65536,65538,66018,98303,98304,98306,98385,98387,98867,131071,131072,131074,131554,163839,163840,163842,163921,163923,164403,196607,196608,196610,197090,229374,229376,229378,229457,229459,229939,262143,262144,262146,262626,272218,294912,294914,294993,294995,295475,307199") == "41c9e82da94760bc9876941e1f5e89f66d6e449b" then
  12. ui_print("Patching system image...");
  13. show_progress(0.900000, 0);
  14. block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
  15. else
  16. (range_sha1("/dev/block/bootdevice/by-name/system", "46,0,32770,32849,32851,33331,65535,65536,65538,66018,98303,98304,98306,98385,98387,98867,131071,131072,131074,131554,163839,163840,163842,163921,163923,164403,196607,196608,196610,197090,229375,229376,229378,229457,229459,229939,262143,262144,262146,262626,271938,294912,294914,294993,294995,295475,307199") == "517d5322358e97bf93d02d4043776100e2d513c8") ||
  17. abort("system partition has unexpected contents");
  18. endif;
  19. ui_print("Patching boot image...");
  20. show_progress(0.100000, 10);
  21. apply_patch("EMMC:/dev/block/bootdevice/by-name/boot:16930816:e28dfc6e0fb57fc2a4d670ae97b1b93f439d9db5:16949248:175e731e42a687813b135083f3f3b8e1da3463a3",
  22. "-", 175e731e42a687813b135083f3f3b8e1da3463a3, 16949248,
  23. e28dfc6e0fb57fc2a4d670ae97b1b93f439d9db5, package_extract_file("patch/boot.img.p"));
  24. ui_print("Writing radio image...");
  25. ifelse((sha1_check(read_file("EMMC:/dev/block/platform/7824900.sdhci/by-name/aboot:3964464:84add82197c126957557e47616ed81b57625f57d")) != ""),(ui_print("/dev/block/platform/7824900.sdhci/by-name/aboot already up to date")),(package_extract_file("emmc_appsboot.mbn", "/dev/block/platform/7824900.sdhci/by-name/aboot")));
  26. set_progress(1.000000);
Advertisement
Add Comment
Please, Sign In to add comment