update_engine: Add --properties_format flag to delta_generator

We need to be able to capture information about a payload by just
looking at it. These information needed for nebraska to be able to
process a response from a request. These information includes:
- Payload and its metadata hashes and sizes.
- Payload metadata signature.
- The APP ID of the original image.
- Whether the payload is a delta or full.
- The payload's target version.

This CL adds the ability to generate a json file with the payloads
properties such as above.

Also this CL refactors how this information is generated into a single
class.

BUG=chromium:960433
TEST=delta_generator --in_file=hello-signed-delta --properties_file=prop
TEST=delta_generator --in_file=hello-signed-delta
--properties_file=payload.json --properties_format="json"

Change-Id: Ia61be0bf37bcacfd82f8982a7977fdae2f18cb30
Reviewed-on: https://chromium-review.googlesource.com/1610801
Tested-by: Amin Hassani <ahassani@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
9 files changed
tree: a797a388e19254cdbe9e81c872da5e6b9c72443c
  1. binder_bindings/
  2. client-headers/
  3. client_library/
  4. common/
  5. dbus_bindings/
  6. fuzz/
  7. init/
  8. payload_consumer/
  9. payload_generator/
  10. sample_images/
  11. scripts/
  12. update_engine/
  13. update_manager/
  14. update_payload_key/
  15. .clang-format
  16. .gitignore
  17. Android.bp
  18. binder_service_android.cc
  19. binder_service_android.h
  20. binder_service_brillo.cc
  21. binder_service_brillo.h
  22. boot_control_android.cc
  23. boot_control_android.h
  24. boot_control_android_unittest.cc
  25. boot_control_chromeos.cc
  26. boot_control_chromeos.h
  27. boot_control_chromeos_unittest.cc
  28. BUILD.gn
  29. certificate_checker.cc
  30. certificate_checker.h
  31. certificate_checker_unittest.cc
  32. chrome_browser_proxy_resolver.cc
  33. chrome_browser_proxy_resolver.h
  34. COMMIT-QUEUE.ini
  35. common_service.cc
  36. common_service.h
  37. common_service_unittest.cc
  38. connection_manager.cc
  39. connection_manager.h
  40. connection_manager_android.cc
  41. connection_manager_android.h
  42. connection_manager_interface.h
  43. connection_manager_unittest.cc
  44. connection_utils.cc
  45. connection_utils.h
  46. CPPLINT.cfg
  47. daemon.cc
  48. daemon.h
  49. daemon_state_android.cc
  50. daemon_state_android.h
  51. daemon_state_interface.h
  52. dbus_connection.cc
  53. dbus_connection.h
  54. dbus_service.cc
  55. dbus_service.h
  56. dbus_test_utils.h
  57. dlcservice_chromeos.cc
  58. dlcservice_chromeos.h
  59. dynamic_partition_control_android.cc
  60. dynamic_partition_control_android.h
  61. dynamic_partition_control_interface.h
  62. fake_file_writer.h
  63. fake_p2p_manager.h
  64. fake_p2p_manager_configuration.h
  65. fake_shill_proxy.cc
  66. fake_shill_proxy.h
  67. fake_system_state.cc
  68. fake_system_state.h
  69. generate_pc_file.sh
  70. hardware_android.cc
  71. hardware_android.h
  72. hardware_chromeos.cc
  73. hardware_chromeos.h
  74. hardware_chromeos_unittest.cc
  75. image_properties.h
  76. image_properties_android.cc
  77. image_properties_android_unittest.cc
  78. image_properties_chromeos.cc
  79. image_properties_chromeos_unittest.cc
  80. libcurl_http_fetcher.cc
  81. libcurl_http_fetcher.h
  82. local_coverage_rate
  83. main.cc
  84. metrics_constants.h
  85. metrics_reporter_android.cc
  86. metrics_reporter_android.h
  87. metrics_reporter_interface.h
  88. metrics_reporter_omaha.cc
  89. metrics_reporter_omaha.h
  90. metrics_reporter_omaha_unittest.cc
  91. metrics_reporter_stub.cc
  92. metrics_reporter_stub.h
  93. metrics_utils.cc
  94. metrics_utils.h
  95. metrics_utils_unittest.cc
  96. mock_boot_control_hal.h
  97. mock_certificate_checker.h
  98. mock_connection_manager.h
  99. mock_dynamic_partition_control.h
  100. mock_file_writer.h
  101. mock_metrics_reporter.h
  102. mock_omaha_request_params.h
  103. mock_p2p_manager.h
  104. mock_payload_state.h
  105. mock_power_manager.h
  106. mock_service_observer.h
  107. mock_update_attempter.h
  108. MODULE_LICENSE_APACHE2
  109. network_selector.h
  110. network_selector_android.cc
  111. network_selector_android.h
  112. network_selector_interface.h
  113. network_selector_stub.cc
  114. network_selector_stub.h
  115. NOTICE
  116. omaha_request_action.cc
  117. omaha_request_action.h
  118. omaha_request_action_fuzzer.cc
  119. omaha_request_action_unittest.cc
  120. omaha_request_builder_xml.cc
  121. omaha_request_builder_xml.h
  122. omaha_request_builder_xml_unittest.cc
  123. omaha_request_params.cc
  124. omaha_request_params.h
  125. omaha_request_params_unittest.cc
  126. omaha_response.h
  127. omaha_response_handler_action.cc
  128. omaha_response_handler_action.h
  129. omaha_response_handler_action_unittest.cc
  130. omaha_utils.cc
  131. omaha_utils.h
  132. omaha_utils_unittest.cc
  133. OWNERS
  134. p2p_manager.cc
  135. p2p_manager.h
  136. p2p_manager_unittest.cc
  137. parcelable_update_engine_status.cc
  138. parcelable_update_engine_status.h
  139. parcelable_update_engine_status_unittest.cc
  140. payload_state.cc
  141. payload_state.h
  142. payload_state_interface.h
  143. payload_state_unittest.cc
  144. power_manager_android.cc
  145. power_manager_android.h
  146. power_manager_chromeos.cc
  147. power_manager_chromeos.h
  148. power_manager_interface.h
  149. PRESUBMIT.cfg
  150. PREUPLOAD.cfg
  151. pylintrc
  152. real_system_state.cc
  153. real_system_state.h
  154. run_unittests
  155. sample_omaha_v3_response.xml
  156. service_delegate_android_interface.h
  157. service_observer_interface.h
  158. shill_proxy.cc
  159. shill_proxy.h
  160. shill_proxy_interface.h
  161. sideload_main.cc
  162. system_state.h
  163. tar_bunzip2.gni
  164. test_http_server.cc
  165. test_subprocess.cc
  166. testrunner.cc
  167. unittest_key.pem
  168. unittest_key2.pem
  169. update_attempter.cc
  170. update_attempter.h
  171. update_attempter_android.cc
  172. update_attempter_android.h
  173. update_attempter_android_unittest.cc
  174. update_attempter_unittest.cc
  175. update_boot_flags_action.cc
  176. update_boot_flags_action.h
  177. update_boot_flags_action_unittest.cc
  178. update_engine.conf
  179. update_engine.rc
  180. update_engine_client.cc
  181. update_engine_client_android.cc
  182. update_metadata.proto
  183. update_status_utils.cc
  184. update_status_utils.h
  185. UpdateEngine.conf