diff options
-rw-r--r-- | build/tools/extract_utils.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index b4b8faf..309a8a9 100644 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -653,6 +653,21 @@ function init_adb_connection() { } # +# fix_xml: +# +# $1: xml file to fix +# +function fix_xml() { + local XML="$1" + local TEMP_XML="$TMPDIR/`basename "$XML"`.temp" + + grep '^<?xml version' "$XML" > "$TEMP_XML" + grep -v '^<?xml version' "$XML" >> "$TEMP_XML" + + mv "$TEMP_XML" "$XML" +} + +# # extract: # # $1: file containing the list of items to 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 |