Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
X00T: Update extractors and introduce kang mode
Browse files Browse the repository at this point in the history
Change-Id: Idc196359a7cb6fd8de53ebdc23700322486a2a7d
  • Loading branch information
vladimiroltean authored and pranavkapoor001 committed May 28, 2020
1 parent 35d2b2a commit 6e98118
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions extract-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,45 @@ VENDOR=asus

# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi

LINEAGE_ROOT="$MY_DIR"/../../..
LINEAGE_ROOT="${MY_DIR}/../../.."

HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
if [ ! -f "$HELPER" ]; then
echo "Unable to find helper script at $HELPER"
HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
. "$HELPER"
source "${HELPER}"

# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
SECTION=
KANG=

while [ "$1" != "" ]; do
case $1 in
case "$1" in
-n | --no-cleanup ) CLEAN_VENDOR=false
;;
-k | --kang) KANG="--kang"
;;
-s | --section ) shift
SECTION=$1
SECTION="$1"
CLEAN_VENDOR=false
;;
* ) SRC=$1
* ) SRC="$1"
;;
esac
shift
done

if [ -z "$SRC" ]; then
if [ -z "${SRC}" ]; then
SRC=adb
fi

# Initialize the helper
setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT" false "$CLEAN_VENDOR"

extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}"

. "$MY_DIR"/setup-makefiles.sh
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" ${KANG} --section "${SECTION}"

"${MY_DIR}/setup-makefiles.sh"

0 comments on commit 6e98118

Please sign in to comment.