{"id":3262,"date":"2021-08-05T11:36:12","date_gmt":"2021-08-05T03:36:12","guid":{"rendered":"https:\/\/learn-house.idv.tw\/?p=3262"},"modified":"2022-08-09T16:16:16","modified_gmt":"2022-08-09T08:16:16","slug":"androidota%e5%b7%ae%e5%88%86%e5%8c%85incremental-ota%e5%8d%87%e7%b4%9a%e5%a4%b1%e6%95%97%e8%a8%8a%e6%81%af%e8%88%87%e8%a7%a3%e6%b3%95","status":"publish","type":"post","link":"https:\/\/learn-house.idv.tw\/?p=3262","title":{"rendered":"[Android]OTA\u5dee\u5206\u5305(Incremental OTA)\u5347\u7d1a\u5931\u6557\u8a0a\u606f\u8207\u89e3\u6cd5"},"content":{"rendered":"<p>\u6211\u5011\u90fd\u77e5\u9053\u8981\u7522\u751fIncremental OTA\u7684\u65b9\u6cd5\u53ef\u4ee5\u900f\u904e\u4e0b\u5217\u6307\u4ee4\uff1a<\/p>\n<table style=\"border: 1px solid #fcfcfc; padding: 4px; background-color: #000000;\" width=\"100%\">\n<tbody>\n<tr>\n<td>\n<div style=\"padding: 8px; color: #ffffff; line-height: 1.5;\">$.\/build\/tools\/releasetools\/ota_from_target_files -v --block -p out\/host\/linux-x86 -k YOUR_KEY -i target_files-old.zip target_files-new.zip update.zip<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4e2d<br \/>\n-k YOUR_KEY\u6307\u7684\u662f\u4f60\u7684KEY\u8def\u5f91\uff0c\u901a\u5e38\u662fvendor\/<span style=\"color: #ff0000;\">company<\/span>\/security\/releasekey<br \/>\n-i target_files-old.zip\u662f\u4e0a\u4e00\u6b21build\u7684target file\uff0c\u7522\u751f\u5728.\/out\/target\/product\/<span style=\"color: #ff0000;\">device<\/span>\/obj\/PACKAGING\/target_files_intermediates\u4e0b\uff1btarget_files-new.zip\u5247\u662f\u9019\u6b21build\u7684\uff0c\u8def\u5f91\u4e5f\u662f\u5728\u4e00\u6a23\u7684\u5730\u65b9\uff1bupdate.zip\u5247\u662f\u8981\u7522\u751f\u7684\u5dee\u5206\u5305\u3002<br \/>\n<span style=\"color: #ff0000;\">\u7d05\u8272<\/span>\u7684\u90e8\u5206\u662f\u4f9d\u4f60\u7684project\u4e0d\u540c\u5247\u6709\u4e0d\u540c\u7684\u540d\u7a31\u3002<br \/>\n<!--more--><br \/>\n\u7576\u5f88\u7406\u6240\u7576\u7136\u5730\u7522\u751f\u51fa\u4f86\u5f8c\uff0c\u537b\u767c\u73fe\u5347\u7d1a\u90fd\u6703\u51fa\u73feErrorCode::kDownloadStateInitializationError\uff0c\u6574\u9ad4\u7684\u932f\u8aa4\u5167\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n08-04 17:45:16.799   ERROR:fec_file_descriptor.cc(30)] No ECC data in the passed file\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(430)] Unable to open ECC source partition boot on slot A, file \/dev\/block\/by-name\/boot_a: Invalid argument (22)\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(1135)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(1140)] Expected:   sha256|hex = 6534AC84D075B5CDA8CDB45CB3B169C86CCB376853EC4E28AA1242B89A440B6A\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(1143)] Calculated: sha256|hex = 464588BD71E535D8E424CF692EF13A574097D673ACB896538FAB5B42E6CD0C5F\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(1154)] Operation source (offset:size) in blocks: 0:2194\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(1435)] source_fd != nullptr failed.\r\n08-04 17:45:16.800   ERROR:delta_performer.cc(296)] Failed to perform BROTLI_BSDIFF operation 0, which is the operation 0 in partition &quot;boot&quot;\r\n08-04 17:45:16.801   ERROR:download_action.cc(336)] Error ErrorCode::kDownloadStateInitializationError (20) in DeltaPerformer's Write method when processing the received payload -- Terminating processing\r\n08-04 17:45:16.802   INFO:delta_performer.cc(313)] Discarding 122 unused downloaded bytes\r\n08-04 17:45:16.802   INFO:multi_range_http_fetcher.cc(177)] Received transfer terminated.\r\n08-04 17:45:16.803   INFO:multi_range_http_fetcher.cc(129)] TransferEnded w\/ code 200\r\n08-04 17:45:16.803   INFO:multi_range_http_fetcher.cc(131)] Terminating.\r\n08-04 17:45:16.806   INFO:action_processor.cc(116)] ActionProcessor: finished DownloadAction with code ErrorCode::kDownloadStateInitializationError\r\n08-04 17:45:16.806   INFO:action_processor.cc(121)] ActionProcessor: Aborting processing due to failure.\r\n08-04 17:45:16.806   INFO:update_attempter_android.cc(469)] Processing Done.\r\n<\/pre>\n<p>\u9019\u662f\u56e0\u70bamake otapackage\u6642\u6703\u5c07out\u4e0b\u7528\u7d66tool\u71d2\u5165\u7684system.img\u91cd\u65b0\u6253\u5305\u4e00\u6b21\uff0c\u5c0e\u81f4\u71d2\u9304\u7684\u548c\u4f7f\u7528OTA\u7684system.img\u7684Hash\u503c\u4e0d\u4e00\u81f4\u3002\u6574\u5305\u5347\u7d1a(Full OTA)\u6703\u66ff\u63dbsystem.img\uff0c\u800c\u5dee\u5206\u5305\u5347\u7d1a(Increment OTA)\u5247\u9700\u8981\u4fdd\u8b49\u7cfb\u7d71\u5167\u90e8\u7684system.img\u548c\u6574\u5305\u4e2dsystem.img\u4e00\u81f4\u624d\u80fd\u5347\u7d1a\u6210\u529f\u3002<br \/>\n<span style=\"color: #ff0000;\"><strong>\u56e0\u6b64\u5c31\u8981\u5148\u7528Full OTA\u5237\u904e\u4e00\u6b21\uff0c\u624d\u53ef\u4ee5\u4ee5\u9019\u7248\u7684target-file\u70babase\u88fd\u4f5c\u65b0\u7684Increment OTA<\/strong><\/span><\/p>\n<p>\u800c\u7576\u4f60\u51fa\u73fe\u7684\u662fErrorCode::kDownloadMetadataSignatureMismatch\u5c31\u4ee3\u8868\u4f60\u7528\u932f\u52a0\u5bc6\u7684key\u4e86\uff0c\u53ea\u8981\u4fee\u6b63-k\u53c3\u6578\u7684KEY\u8def\u5f91\u6307\u5411\u5c0d\u7684\u5c31\u80fd\u89e3\u6c7a\uff0c\u6574\u9ad4\u7684\u932f\u8aa4\u5167\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n08-02 13:52:23.192   ERROR:payload_verifier.cc(84)] None of the 1 signatures is correct. Expected hash before padding:\r\n08-02 13:52:23.192   INFO:utils.cc(439)] Logging array of length: 32\r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000000 : 93 ce 57 06 9e 7e 2e 86 70 c6 52 40 55 e0 ef 2a \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000010 : b4 c4 c9 7c cc 71 65 24 14 8f 8c 57 23 db f5 ae \r\n08-02 13:52:23.192   ERROR:payload_verifier.cc(87)] But found decrypted hashes:\r\n08-02 13:52:23.192   INFO:utils.cc(439)] Logging array of length: 256\r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000000 : cb 99 ca ee 49 83 fe 71 95 3a 71 44 68 86 4e 77 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000010 : 82 3c fa b6 40 21 34 c3 48 06 20 c6 b1 0e 67 1d \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000020 : b4 1f 8b 60 bd 24 9d 9c 97 94 6d 85 e3 31 5a 36 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000030 : 4c 02 14 47 ce b3 8e 89 3d d0 15 89 21 86 21 74 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000040 : ef 73 75 b3 aa 1c b2 a0 6a 9b b6 6f 13 be fe 6b \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000050 : 67 7a 7b c6 ab 18 e6 8e 3d e1 e6 6e 5d ed 41 5a \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000060 : 5e 2f f8 91 46 f8 b9 ca 9d e0 d4 b9 af a8 e2 ab \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000070 : f0 ba f1 0a 75 75 8f 77 9d 29 4d 27 fc be 98 30 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000080 : 70 f2 29 35 ec c6 44 a1 85 81 b9 b2 fb fe 76 fa \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x00000090 : 64 b3 dc 1f e0 15 4e 1d ae 6e 52 43 a3 f6 e6 8c \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000a0 : b9 8c 78 1c c1 df 48 20 01 9e 82 3d 6a e1 30 79 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000b0 : 4b 42 dc f4 b2 38 1d b9 6a ad ff 83 0c 52 89 80 \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000c0 : fd db 24 74 74 b8 92 f8 7d 92 8b 48 be d2 cb fd \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000d0 : bc f7 2f a5 71 cb 6b f3 b9 24 cc a3 c7 32 9f 2b \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000e0 : de 41 3d 1d d7 5a d2 d2 3c 9f 49 bf 55 68 72 bb \r\n08-02 13:52:23.192   INFO:utils.cc(456)] 0x000000f0 : 78 81 07 de 7b ed 2d af fc 74 39 45 89 94 82 db \r\n08-02 13:52:23.192   ERROR:payload_metadata.cc(230)] Manifest hash verification failed.\r\n08-02 13:52:23.192   ERROR:delta_performer.cc(544)] Mandatory metadata signature validation failed\r\n08-02 13:52:23.193   ERROR:download_action.cc(336)] Error ErrorCode::kDownloadMetadataSignatureMismatch (26) in DeltaPerformer's Write method when processing the received payload -- Terminating processing\r\n08-02 13:52:23.193   INFO:delta_performer.cc(313)] Discarding 96843 unused downloaded bytes\r\n08-02 13:52:23.193   INFO:multi_range_http_fetcher.cc(177)] Received transfer terminated.\r\n08-02 13:52:23.193   INFO:multi_range_http_fetcher.cc(129)] TransferEnded w\/ code 200\r\n08-02 13:52:23.193   INFO:multi_range_http_fetcher.cc(131)] Terminating.\r\n08-02 13:52:23.193   INFO:action_processor.cc(116)] ActionProcessor: finished DownloadAction with code ErrorCode::kDownloadMetadataSignatureMismatch\r\n08-02 13:52:23.193   INFO:action_processor.cc(121)] ActionProcessor: Aborting processing due to failure.\r\n08-02 13:52:23.193   INFO:update_attempter_android.cc(469)] Processing Done.\r\n<\/pre>\n<p>\u5b98\u65b9\u9023\u7d50\uff1ahttps:\/\/source.android.com\/devices\/tech\/ota\/tools#incremental-updates<\/p>\n<div id=\"gtx-trans\" style=\"position: absolute; left: 0px; top: 1865.67px;\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u5011\u90fd\u77e5\u9053\u8981\u7522\u751fIncremental OTA\u7684\u65b9\u6cd5\u53ef\u4ee5\u900f\u904e\u4e0b\u5217\u6307\u4ee4\uff1a $.\/build\/tools\/rele [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-3262","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3262"}],"collection":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3262"}],"version-history":[{"count":0,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3262\/revisions"}],"wp:attachment":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}