summaryrefslogtreecommitdiff
path: root/extract_utils.sh
diff options
context:
space:
mode:
authorRashed Abdel-Tawab <rashed@linux.com>2017-08-05 23:11:35 -0400
committerRashed Abdel-Tawab <rashedabdeltawab@gmail.com>2017-10-07 21:24:15 +0000
commitc16a2ab1af793c09516ddfef434fe32a772e163c (patch)
tree8e9b022eb44d9bb0ba59795b238a988938c02024 /extract_utils.sh
parent03e81b42230d3701c1e4c7425fbc96d19bf15fe1 (diff)
extract_files: Adjust deodex path and tmpdir
* Make a tempdir using the mktemp command rather than just making a dir in /tmp to accomodate for systems that don't set proper perms or dont have /tmp * Fix the deodex procedure to pull files from the right path Change-Id: I181863599b6670e3a149069dbb7b13ebf73bae8e
Diffstat (limited to 'extract_utils.sh')
-rw-r--r--extract_utils.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/extract_utils.sh b/extract_utils.sh
index beef77e..eacfb69 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -26,8 +26,7 @@ COMMON=-1
ARCHES=
FULLY_DEODEXED=-1
-TMPDIR="/tmp/extractfiles.$$"
-mkdir "$TMPDIR"
+TMPDIR=$(mktemp -d)
#
# cleanup
@@ -700,7 +699,12 @@ function oat2dex() {
echo "Checking if system is odexed and locating boot.oats..."
for ARCH in "arm64" "arm" "x86_64" "x86"; do
mkdir -p "$TMPDIR/system/framework/$ARCH"
- if get_file "system/framework/$ARCH/" "$TMPDIR/system/framework/" "$SRC"; then
+ if [ -d "$SRC/framework" ] && [ "$SRC" != "adb" ]; then
+ ARCHDIR="framework/$ARCH/"
+ else
+ ARCHDIR="system/framework/$ARCH/"
+ fi
+ if get_file "$ARCHDIR" "$TMPDIR/system/framework/" "$SRC"; then
ARCHES+="$ARCH "
else
rmdir "$TMPDIR/system/framework/$ARCH"