Skip to content

Commit

Permalink
tank: move apks to vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-cr committed Aug 7, 2020
1 parent 94adf67 commit 80205ec
Show file tree
Hide file tree
Showing 19 changed files with 153 additions and 221 deletions.
12 changes: 0 additions & 12 deletions apps/AtvRemoteService/Android.mk

This file was deleted.

Binary file removed apps/AtvRemoteService/AtvRemoteService.apk
Binary file not shown.
12 changes: 0 additions & 12 deletions apps/GlobalKeyInterceptor/Android.mk

This file was deleted.

Binary file removed apps/GlobalKeyInterceptor/GlobalKeyInterceptor.apk
Binary file not shown.
11 changes: 0 additions & 11 deletions apps/LeanbackIme/Android.mk

This file was deleted.

Binary file removed apps/LeanbackIme/LeanbackIme.apk
Binary file not shown.
11 changes: 0 additions & 11 deletions apps/LeanbackLauncher/Android.mk

This file was deleted.

Binary file removed apps/LeanbackLauncher/LeanbackLauncher.apk
Binary file not shown.
11 changes: 0 additions & 11 deletions apps/Overscan/Android.mk

This file was deleted.

Binary file removed apps/Overscan/Overscan.apk
Binary file not shown.
12 changes: 0 additions & 12 deletions apps/RemoteControlService/Android.mk

This file was deleted.

Binary file removed apps/RemoteControlService/RemoteControlService.apk
Binary file not shown.
12 changes: 0 additions & 12 deletions apps/TV/Android.mk

This file was deleted.

Binary file removed apps/TV/TV.apk
Binary file not shown.
3 changes: 0 additions & 3 deletions device.mk

This file was deleted.

81 changes: 45 additions & 36 deletions extract-files.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,58 @@
#!/bin/bash

VENDOR=amazon
DEVICE=tank
export VENDOR=amazon
export DEVICE_VENDOR=amazon
export DEVICE=tank

# Check to see if the user passed a folder in to extract from rather than adb pull
if [ $# -eq 1 ]; then
COPY_FROM=$1
test ! -d "$COPY_FROM" && echo error reading dir "$COPY_FROM" && exit 1
fi

test -z "$DEVICE" && echo device not set && exit 2
test -z "$VENDOR" && echo vendor not set && exit 2
test -z "$VENDORDEVICEDIR" && VENDORDEVICEDIR=$DEVICE
export VENDORDEVICEDIR
set -e

BASE=../../../vendor/$VENDOR/$VENDORDEVICEDIR/proprietary
rm -rf $BASE/*

for FILE in `egrep -v '(^#|^$)' ../$DEVICE/proprietary-files.txt`; do
echo "Extracting /system/$FILE ..."
OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
DEST=${PARSING_ARRAY[1]}
if [ -z $DEST ]
then
DEST=$FILE
fi
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
if [ "$COPY_FROM" = "" ]; then
adb pull /system/$FILE $BASE/$DEST
# if file dot not exist try destination
if [ "$?" != "0" ]
then
adb pull /system/$DEST $BASE/$DEST
function extract() {
for FILE in `egrep -v '(^#|^$)' $1`; do
echo "Extracting /system/$FILE ..."
OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
DEST=${PARSING_ARRAY[1]}
if [ -z $DEST ]; then
DEST=$FILE
fi
DIR=`dirname $FILE`
if [ ! -d $2/$DIR ]; then
mkdir -p $2/$DIR
fi
else
cp $COPY_FROM/$FILE $BASE/$DEST
# if file does not exist try destination
if [ "$?" != "0" ]
then
cp $COPY_FROM/$DEST $BASE/$DEST
if [ "$COPY_FROM" = "" ]; then
# Try destination target first
if [ -f /system/$DEST ]; then
adb pull /system/$DEST $2/$DEST
else
# if file does not exist try OEM target
if [ "$?" != "0" ]; then
adb pull /system/$FILE $2/$DEST
fi
fi
else
# Try destination target first
if [ -f $COPY_FROM/$DEST ]; then
cp $COPY_FROM/$DEST $2/$DEST
else
# if file does not exist try OEM target
if [ "$?" != "0" ]; then
cp $COPY_FROM/$FILE $2/$DEST
fi
fi
fi
fi
done
done
}

DEVICE_BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $DEVICE_BASE/*

# Extract the device specific files
extract ../../$DEVICE_VENDOR/$DEVICE/proprietary-files.txt $DEVICE_BASE

./setup-makefiles.sh
9 changes: 1 addition & 8 deletions full_tank.mk
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ PRODUCT_PACKAGES += \
TvProvider \
TvSettings \
tv_input.default \
LeanbackLauncher \
LeanbackIme \
Overscan \
TV \
RemoteControlService \
AtvRemoteService \
GlobalKeyInterceptor \
AppDrawer

# Enable frame-exact AV sync
Expand Down Expand Up @@ -217,4 +210,4 @@ $(call inherit-product, frameworks/native/build/tablet-7in-hdpi-1024-dalvik-heap
$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk)

# Get non-open-source specific aspects
$(call inherit-product-if-exists, vendor/amazon/tank/tank-vendor.mk)
$(call inherit-product-if-exists, vendor/amazon/tank/device-vendor.mk)
10 changes: 9 additions & 1 deletion proprietary-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,13 @@ vendor/smartvolume/tank/dgtl_dock_headeset.csv
vendor/smartvolume/tank/speaker.csv
vendor/smartvolume/tank/wired_headphone.csv
vendor/smartvolume/tank/wired_headset.csv
-vendor/app/Ds/Ds.apk


-priv-app/LeanbackLauncher/LeanbackLauncher.apk
-priv-app/LeanbackIme/LeanbackIme.apk
-priv-app/Overscan/Overscan.apk
-priv-app/AtvRemoteService/AtvRemoteService.apk
#-priv-app/GamepadPairingService/GamepadPairingService.apk
-priv-app/GlobalKeyInterceptor/GlobalKeyInterceptor.apk
-priv-app/RemoteControlService/RemoteControlService.apk
-priv-app/TV/TV.apk
Loading

0 comments on commit 80205ec

Please sign in to comment.