From 3a03012242c8303b3616e0630c42992070920fc7 Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Sat, 30 Jul 2016 12:08:25 +0200 Subject: [PATCH] cm: extract_utils: Fixup xml files Change-Id: Icb8efcca0e6e37a3ea7432716fcbfbd631d96c19 --- build/tools/extract_utils.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index b4b8fafe..309a8a9b 100644 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -652,6 +652,21 @@ function init_adb_connection() { sleep 0.3 } +# +# fix_xml: +# +# $1: xml file to fix +# +function fix_xml() { + local XML="$1" + local TEMP_XML="$TMPDIR/`basename "$XML"`.temp" + + grep '^ "$TEMP_XML" + grep -v '^> "$TEMP_XML" + + mv "$TEMP_XML" "$XML" +} + # # extract: # @@ -739,6 +754,8 @@ function extract() { rm "$TMPDIR/classes.dex" printf ' (updated %s from odex files)\n' "/$FILE" fi + elif [[ "$DEST" =~ .xml$ ]]; then + fix_xml "$DEST" fi fi