cm: extract_utils: Fixup xml files
Change-Id: Icb8efcca0e6e37a3ea7432716fcbfbd631d96c19
This commit is contained in:
parent
7f9fff2317
commit
3a03012242
@ -652,6 +652,21 @@ function init_adb_connection() {
|
|||||||
sleep 0.3
|
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:
|
# extract:
|
||||||
#
|
#
|
||||||
@ -739,6 +754,8 @@ function extract() {
|
|||||||
rm "$TMPDIR/classes.dex"
|
rm "$TMPDIR/classes.dex"
|
||||||
printf ' (updated %s from odex files)\n' "/$FILE"
|
printf ' (updated %s from odex files)\n' "/$FILE"
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$DEST" =~ .xml$ ]]; then
|
||||||
|
fix_xml "$DEST"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user