HTC verify system 的改變
由
於 11-22-2017 04:35 PM 發表 (460296 瀏覽)
過去 OTA升級對 system 的驗證有兩次的改變
初期 OTA/**/updater-script 是驗證 system資料夾 內的眾多 檔案...
以 M8為例
代碼:ui_print("Verifying current system..."); show_progress(0.100000, 0); apply_patch_check("/system/app/AntHalService/AntHalService.apk", "2733b31cfce27889b099595f94d049874da17733", "b4104889aab31f634308dff669feb866383c0907") || abort("\"/system/app/AntHalService/AntHalService.apk\" has unexpected contents."); apply_patch_check("/system/app/AntHalService/oat/arm/AntHalService.odex", "d158fadf33a7a9c82cba5416792227b031a62550", "6cb9ad0f402bc0ec7e9cb443b1a83a09e9d2ffb8") || abort("\"/system/app/AntHalService/oat/arm/AntHalService.odex\" has unexpected contents."); apply_patch_check("/system/app/BasicDreams/BasicDreams.apk", "7dbe625e8de6799764bbb704047934d7e9090102", "c3d75f969ac8d5a2b10d4c20d4c888fc6c0d8207") || abort("\"/system/app/BasicDreams/BasicDreams.apk\" has unexpected contents."); apply_patch_check("/system/app/BasicDreams/oat/arm/BasicDreams.odex", "767b45f8e9b3ee49c0bdc401a9f23a87c65546f6", "22c8c5c2c05dc71270f6cad64cc5365a4e83ac66") || abort("\"/system/app/BasicDreams/oat/arm/BasicDreams.odex\" has unexpected contents."); apply_patch_check("/system/app/Bluetooth/Bluetooth.apk", "7e599ffa5a8fd1033ce5c2ba70f86312ebe1ae3a", "9d4b484d6e8ac15624a347d17cecb3575bbf7575") || abort("\"/system/app/Bluetooth/Bluetooth.apk\" has unexpected contents."); apply_patch_check("/system/app/Bluetooth/oat/arm/Bluetooth.odex", "5487c708d4b87d838b9c8f16f96fc63dd9771f06", "09dfe0f4bf5a40eb62dadd4ed3303ffb76b74263") || abort("\"/system/app/Bluetooth/oat/arm/Bluetooth.odex\" has unexpected contents."); apply_patch_check("/system/app/BluetoothMidiService/BluetoothMidiService.apk", "91c1174231c54686c48e49019f545810224402fa", "c757cba5595f015f20b0e117503427653bd553a8") || abort("\"/system/app/BluetoothMidiService/BluetoothMidiService.apk\" has unexpected contents."); ..... .....
第一次的改變:於 HTC 第一支原生 Android 5.0系統 M9
OTA包裡的 system 改為 dat 格式的檔案. 同時對於 system的驗證變成直接驗證 system SHA-1碼
代碼:ui_print("Verified system image..."); else if (htc_range_sha1("/dev/block/bootdevice/by-name/system", "2,0,1146880") == "5a24e274155f0c4cf29a163036c49b3f20515a5c") then set_tgt_total_sha1("5a24e274155f0c4cf29a163036c49b3f20515a5c"); else abort("system partition has unexpected contents");
第二次的改變:於 HTC 第一支原生 Android 8.0系統 U11 Plus
代碼:ui_print("Verified system image..."); else if (htc_range_sha1("/dev/block/bootdevice/by-name/system", "136,0,32767,32768,32770,33025,33027,33533,65534,65536,65538,66044,70604,98304,98306,98561,98563,99069,131071,131072,131074,131580,131662,163840,163842,164097,164099,164605,196607,196608,196610,197116,197191,229376,229378,229633,229635,230141,262143,262144,262146,262652,294910,294912,294914,295169,295171,295677,327679,327680,327682,328188,360446,360448,360450,360956,393214,393216,393218,393724,425982,425984,425986,426492,458750,458752,458754,459260,491518,491520,491522,492028,524286,524288,524290,524796,557054,557056,557058,557564,589822,589824,589826,590332,622590,622592,622594,623100,655358,655360,655362,655868,688126,688128,688130,688636,720894,720896,720898,721404,753662,753664,753666,754172,786430,786432,786434,786940,819041,819200,819202,819457,819459,819965,851967,851968,851970,852476,857948,884736,884738,884993,884995,885501,917502,917504,917506,950272,950274,983040,983042,1015808,1015810,1016316,1036243,1036244,1052672") == "7c3028858eb476af098d02e6c7fb6f45e84c1926") then set_tgt_total_sha1("7c3028858eb476af098d02e6c7fb6f45e84c1926"); else abort("E1000: system partition has unexpected contents");
註:對於有充分 備份 習慣的機友來說 這些改變並不會造成什麼差異