cm: extract_utils: Fixup xml files

Change-Id: Icb8efcca0e6e37a3ea7432716fcbfbd631d96c19
This commit is contained in:
Luca Stefani 2016-07-30 12:08:25 +02:00 committed by Steve Kondik
parent 7f9fff2317
commit 3a03012242
1 changed files with 17 additions and 0 deletions

View File

@ -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 '^<?xml version' "$XML" > "$TEMP_XML"
grep -v '^<?xml version' "$XML" >> "$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