• Torne (Richard Coles)'s avatar
    Work around bad XML output by dexdump. · 24c982a7
    Torne (Richard Coles) authored
    The version of dexdump in build-tools 30.0.1 includes more information
    than previous versions in its output, which has revealed that it doesn't
    encode its output as valid XML in all cases; Java strings with control
    characters or nulls end up emitted literally in the XML output, which
    breaks ElementTree's parser. b/161925303 has been filed internally to
    track fixing this in dexdump itself.
    
    Since we only need to be able to extract a few specific things from the
    dexdump output in our tooling, just replace invalid characters in the
    output with the Unicode replacement character (as Python does when using
    the 'replace' error handler in encoding) before parsing it.
    
    Bug: 1106471
    Change-Id: Id1c3a40e5ce91125dbee9fdf1923383d02314f55
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314986Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Auto-Submit: Richard Coles <torne@chromium.org>
    Commit-Queue: Richard Coles <torne@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#791232}
    24c982a7
dexdump.py 3.54 KB