diff --git a/mvt/android/artifacts/dumpstate_artifact.py b/mvt/android/artifacts/dumpstate_artifact.py index f6e702b..3722510 100644 --- a/mvt/android/artifacts/dumpstate_artifact.py +++ b/mvt/android/artifacts/dumpstate_artifact.py @@ -15,7 +15,8 @@ from .artifact import AndroidArtifact # to close the previous section. This is a heuristic approach, and may not work in all cases. We can't do # this for all sections as we will detect subsections as new sections. SECTION_BROKEN_TERMINATORS = [ - b"VM TRACES AT LAST ANR" + b"VM TRACES AT LAST ANR", + b"DIGITAL_HALL", ] @@ -60,11 +61,14 @@ class DumpStateArtifact(AndroidArtifact): if header_match.group(2): section_command = header_match.group(2).strip(b"()") else: - # Some headers can missed the command + # Some headers can missing the command section_command = "" - # import pdb; pdb.set_trace() - has_broken_terminator = section_name in SECTION_BROKEN_TERMINATORS + has_broken_terminator = False + for broken_section in SECTION_BROKEN_TERMINATORS: + if broken_section in section_name: + has_broken_terminator = True + break section = { "section_name": section_name, @@ -90,14 +94,22 @@ class DumpStateArtifact(AndroidArtifact): # Regexes to parse headers section_name_re = re.compile(rb"------ ([\w\d\s\-\/\&]+)(\(.*\))? ------") + end_of_section_re = re.compile(rb"------ End of .* ------") missing_file_error_re = re.compile(rb"\*\*\* (.*): No such file or directory") - generic_error_re = re.compile(rb"\*\*\* (.*)") + generic_error_re = re.compile(rb"\*\*\* (.*) (?