M9 OTA 正確方式
節錄一部分 OTA 更新腳本
# Htc Script Version: L51QCT.01.103.029
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "htc/himauhl_htc_asia_tw/htc_himauhl:5.1/LMY47O/576582.6:user/release-keys" ||
getprop("ro.build.fingerprint") == "htc/himauhl_htc_asia_tw/htc_himauhl:5.1/LMY47O/576582.180:user/release-keys" ||
abort("Package expects build fingerprint of htc/himauhl_htc_asia_tw/htc_himauhl:5.1/LMY47O/576582.6:user/release-keys or htc/himauhl_htc_asia_tw/htc_himauhl:5.1/LMY47O/576582.180:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
(range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1") == "bc92459f1799a76019f15b2cc6150f0e32369abf") || (range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1") == "fcdb1b6cb9be274514a57476fb89aaf5b44f4c59") || update_has_interrupt("") == "t" || abort("/dev/block/bootdevice/by-name/system has been remounted R/W; reflash device to reenable OTA updates");
if (range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1146880") == "393cc5514f9dd7c59c73007191b294e87c70598c" || update_has_interrupt("") == "t") then
ui_print("Verified system image...");
else
(range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1146880") == "725b58ba128f643fe0cfc8e3906b3ed406984170") ||
abort("system partition has unexpected contents");
endif;
由此可知,OTA更新會驗證 recovery 版本與 system 分區之 sha-1 校驗碼
假設從 2.10.709.1 更新至 2.10.709.6
必須先刷回 2.10.709.1 版本之 system 與 recovery image
還原步驟
- TWRP 中勾選 mount system read-only (系統分區唯讀)
- 抹除 Cache、Dalvik Cache、System 這三個分區
- 還原 boot、system_image
- 重新開機至 download 模式刷入原廠 recovery
完成以上步驟後即可無痛進行 OTA 更新
|