Add function to extract timestamp from boot image
Also add toybox to otatools list.
Bug: 169169031
Test: build OTA
Change-Id: Ib14dbf46a8385ccf2a9c5a9c6f4e7fa9399cf0ba
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index f5dfbec..f256900 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -814,6 +814,15 @@
props._LoadBuildProp(data)
return props
+ @staticmethod
+ def FromBuildPropFile(name, build_prop_file):
+ """Constructs an instance from a build prop file."""
+
+ props = PartitionBuildProps("unknown", name)
+ with open(build_prop_file) as f:
+ props._LoadBuildProp(f.read())
+ return props
+
def _LoadBuildProp(self, data):
for line in data.split('\n'):
line = line.strip()