import re


def GetVersion(native_heap):
  """Get the version of the native heap dump."""

  re_line = re.compile("Android\s+Native\s+Heap\s+Dump\s+(?P<version>v\d+\.\d+)\s*$")
  matched = 0
  with open(native_heap, "r") as f:
    for line in f:
      m = re_line.match(line)
      if m:
        return m.group('version')
  return None