vendor: update extract_utils to extract vdex files
note: we're already on baksmali v2.2.1 which supports
oreo vdex files.
Change-Id: Ie4ccee32891e805d27f940f96a2e63287392d526
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index 19645f9..4bed018 100755
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -682,7 +682,9 @@
local OEM_TARGET="$2"
local SRC="$3"
local TARGET=
- local OAT=
+ local DEXBASE=
+ local ODEX=
+ local VDEX=
if [ -z "$BAKSMALIJAR" ] || [ -z "$SMALIJAR" ]; then
export BAKSMALIJAR="$CM_ROOT"/vendor/omni/build/tools/smali/baksmali.jar
@@ -717,10 +719,14 @@
for ARCH in $ARCHES; do
BOOTOAT="$TMPDIR/system/framework/$ARCH/boot.oat"
- local OAT="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}").odex"
+ local DEXBASE="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}")"
+ local ODEX="${DEXBASE}.odex"
+ local VDEX="${DEXBASE}.vdex"
- if get_file "$OAT" "$TMPDIR" "$SRC"; then
- java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$TMPDIR/$(basename "$OAT")"
+ if get_file "$ODEX" "$TMPDIR" "$SRC"; then
+ # If there was an odex, also look for a vdex.
+ get_file "$VDEX" "$TMPDIR" "$SRC"
+ java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$TMPDIR/$(basename "$ODEX")"
elif [[ "$CM_TARGET" =~ .jar$ ]]; then
# try to extract classes.dex from boot.oats for framework jars
JAROAT="$TMPDIR/system/framework/$ARCH/boot-$(basename ${OEM_TARGET%.*}).oat"