lineage: Complete the rebrand
* TODO: Rebrand cmsdk when it's in a working state Change-Id: I0d8d573f9e0032110ae3a0f54ebe11a877b83137
This commit is contained in:
committed by
Michael Bestas
parent
91f7620c4d
commit
5c60e4fd24
@@ -45,7 +45,7 @@ trap cleanup EXIT INT TERM ERR
|
||||
#
|
||||
# $1: device name
|
||||
# $2: vendor name
|
||||
# $3: CM root directory
|
||||
# $3: Lineage root directory
|
||||
# $4: is common device - optional, default to false
|
||||
# $5: cleanup - optional, default to true
|
||||
# $6: custom vendor makefile name - optional, default to false
|
||||
@@ -66,15 +66,15 @@ function setup_vendor() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export CM_ROOT="$3"
|
||||
if [ ! -d "$CM_ROOT" ]; then
|
||||
echo "\$CM_ROOT must be set and valid before including this script!"
|
||||
export LINEAGE_ROOT="$3"
|
||||
if [ ! -d "$LINEAGE_ROOT" ]; then
|
||||
echo "\$LINEAGE_ROOT must be set and valid before including this script!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export OUTDIR=vendor/"$VENDOR"/"$DEVICE"
|
||||
if [ ! -d "$CM_ROOT/$OUTDIR" ]; then
|
||||
mkdir -p "$CM_ROOT/$OUTDIR"
|
||||
if [ ! -d "$LINEAGE_ROOT/$OUTDIR" ]; then
|
||||
mkdir -p "$LINEAGE_ROOT/$OUTDIR"
|
||||
fi
|
||||
|
||||
VNDNAME="$6"
|
||||
@@ -82,9 +82,9 @@ function setup_vendor() {
|
||||
VNDNAME="$DEVICE"
|
||||
fi
|
||||
|
||||
export PRODUCTMK="$CM_ROOT"/"$OUTDIR"/"$VNDNAME"-vendor.mk
|
||||
export ANDROIDMK="$CM_ROOT"/"$OUTDIR"/Android.mk
|
||||
export BOARDMK="$CM_ROOT"/"$OUTDIR"/BoardConfigVendor.mk
|
||||
export PRODUCTMK="$LINEAGE_ROOT"/"$OUTDIR"/"$VNDNAME"-vendor.mk
|
||||
export ANDROIDMK="$LINEAGE_ROOT"/"$OUTDIR"/Android.mk
|
||||
export BOARDMK="$LINEAGE_ROOT"/"$OUTDIR"/BoardConfigVendor.mk
|
||||
|
||||
if [ "$4" == "true" ] || [ "$4" == "1" ]; then
|
||||
COMMON=1
|
||||
@@ -678,15 +678,15 @@ function get_file() {
|
||||
# Convert apk|jar .odex in the corresposing classes.dex
|
||||
#
|
||||
function oat2dex() {
|
||||
local CM_TARGET="$1"
|
||||
local LINEAGE_TARGET="$1"
|
||||
local OEM_TARGET="$2"
|
||||
local SRC="$3"
|
||||
local TARGET=
|
||||
local OAT=
|
||||
|
||||
if [ -z "$BAKSMALIJAR" ] || [ -z "$SMALIJAR" ]; then
|
||||
export BAKSMALIJAR="$CM_ROOT"/vendor/lineage/build/tools/smali/baksmali.jar
|
||||
export SMALIJAR="$CM_ROOT"/vendor/lineage/build/tools/smali/smali.jar
|
||||
export BAKSMALIJAR="$LINEAGE_ROOT"/vendor/lineage/build/tools/smali/baksmali.jar
|
||||
export SMALIJAR="$LINEAGE_ROOT"/vendor/lineage/build/tools/smali/smali.jar
|
||||
fi
|
||||
|
||||
# Extract existing boot.oats to the temp folder
|
||||
@@ -706,11 +706,11 @@ function oat2dex() {
|
||||
FULLY_DEODEXED=1 && return 0 # system is fully deodexed, return
|
||||
fi
|
||||
|
||||
if [ ! -f "$CM_TARGET" ]; then
|
||||
if [ ! -f "$LINEAGE_TARGET" ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if grep "classes.dex" "$CM_TARGET" >/dev/null; then
|
||||
if grep "classes.dex" "$LINEAGE_TARGET" >/dev/null; then
|
||||
return 0 # target apk|jar is already odexed, return
|
||||
fi
|
||||
|
||||
@@ -721,7 +721,7 @@ function oat2dex() {
|
||||
|
||||
if get_file "$OAT" "$TMPDIR" "$SRC"; then
|
||||
java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$TMPDIR/$(basename "$OAT")"
|
||||
elif [[ "$CM_TARGET" =~ .jar$ ]]; then
|
||||
elif [[ "$LINEAGE_TARGET" =~ .jar$ ]]; then
|
||||
# try to extract classes.dex from boot.oats for framework jars
|
||||
JAROAT="$TMPDIR/system/framework/$ARCH/boot-$(basename ${OEM_TARGET%.*}).oat"
|
||||
if [ ! -f "$JAROAT" ]; then
|
||||
@@ -809,7 +809,7 @@ function extract() {
|
||||
local HASHLIST=( ${PRODUCT_COPY_FILES_HASHES[@]} ${PRODUCT_PACKAGES_HASHES[@]} )
|
||||
local COUNT=${#FILELIST[@]}
|
||||
local SRC="$2"
|
||||
local OUTPUT_ROOT="$CM_ROOT"/"$OUTDIR"/proprietary
|
||||
local OUTPUT_ROOT="$LINEAGE_ROOT"/"$OUTDIR"/proprietary
|
||||
local OUTPUT_TMP="$TMPDIR"/"$OUTDIR"/proprietary
|
||||
|
||||
if [ "$SRC" = "adb" ]; then
|
||||
@@ -817,7 +817,7 @@ function extract() {
|
||||
fi
|
||||
|
||||
if [ -f "$SRC" ] && [ "${SRC##*.}" == "zip" ]; then
|
||||
DUMPDIR="$CM_ROOT"/system_dump
|
||||
DUMPDIR="$LINEAGE_ROOT"/system_dump
|
||||
|
||||
# Check if we're working with the same zip that was passed last time.
|
||||
# If so, let's just use what's already extracted.
|
||||
@@ -837,7 +837,7 @@ function extract() {
|
||||
# If OTA is block based, extract it.
|
||||
elif [ -a "$DUMPDIR"/system.new.dat ]; then
|
||||
echo "Converting system.new.dat to system.img"
|
||||
python "$CM_ROOT"/vendor/lineage/build/tools/sdat2img.py "$DUMPDIR"/system.transfer.list "$DUMPDIR"/system.new.dat "$DUMPDIR"/system.img 2>&1
|
||||
python "$LINEAGE_ROOT"/vendor/lineage/build/tools/sdat2img.py "$DUMPDIR"/system.transfer.list "$DUMPDIR"/system.new.dat "$DUMPDIR"/system.img 2>&1
|
||||
rm -rf "$DUMPDIR"/system.new.dat "$DUMPDIR"/system
|
||||
mkdir "$DUMPDIR"/system "$DUMPDIR"/tmp
|
||||
echo "Requesting sudo access to mount the system.img"
|
||||
@@ -897,14 +897,14 @@ function extract() {
|
||||
local DEST="$OUTPUT_DIR/$FROM"
|
||||
|
||||
if [ "$SRC" = "adb" ]; then
|
||||
# Try CM target first
|
||||
# Try Lineage target first
|
||||
adb pull "/$TARGET" "$DEST"
|
||||
# if file does not exist try OEM target
|
||||
if [ "$?" != "0" ]; then
|
||||
adb pull "/$FILE" "$DEST"
|
||||
fi
|
||||
else
|
||||
# Try CM target first
|
||||
# Try Lineage target first
|
||||
if [ -f "$SRC/$TARGET" ]; then
|
||||
cp "$SRC/$TARGET" "$DEST"
|
||||
# if file does not exist try OEM target
|
||||
@@ -996,7 +996,7 @@ function extract_firmware() {
|
||||
local FILELIST=( ${PRODUCT_COPY_FILES_LIST[@]} )
|
||||
local COUNT=${#FILELIST[@]}
|
||||
local SRC="$2"
|
||||
local OUTPUT_DIR="$CM_ROOT"/"$OUTDIR"/radio
|
||||
local OUTPUT_DIR="$LINEAGE_ROOT"/"$OUTDIR"/radio
|
||||
|
||||
if [ "$VENDOR_RADIO_STATE" -eq "0" ]; then
|
||||
echo "Cleaning firmware output directory ($OUTPUT_DIR).."
|
||||
|
||||
Reference in New Issue
Block a user