extract-utils: Try to use arch specific vdex for JARs
* Also don't print errors when no classes are found
Change-Id: I0c88716f2214f90948378a8773b3d645f6dc3abc
diff --git a/extract_utils.sh b/extract_utils.sh
index 0c37342..1f5cf91 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -1379,11 +1379,14 @@
if [ ! -f "$JAROAT" ]; then
JAROAT=$BOOTOAT
fi
+ if [ ! -f "$JARVDEX" ]; then
+ JARVDEX="/system/framework/$ARCH/boot-$(basename ${OEM_TARGET%.*}).vdex"
+ fi
# try to extract classes.dex from boot.vdex for frameworks jars
# fallback to boot.oat if vdex is not available
if get_file "$JARVDEX" "$EXTRACT_TMP_DIR" "$SRC"; then
"$VDEXEXTRACTOR" -o "$EXTRACT_TMP_DIR/" -i "$EXTRACT_TMP_DIR/$(basename "$JARVDEX")" > /dev/null
- CLASSES=$(ls "$EXTRACT_TMP_DIR/$(basename "${JARVDEX%.*}")_classes"*)
+ CLASSES=$(ls "$EXTRACT_TMP_DIR/$(basename "${JARVDEX%.*}")_classes"* 2> /dev/null)
for CLASS in $CLASSES; do
NEWCLASS=$(echo "$CLASS" | sed 's/.*_//;s/cdex/dex/')
# Check if we have to deal with CompactDex