summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheStrix <parthbhatia98@gmail.com>2020-04-10 18:20:19 +0530
committerLuca Stefani <luca.stefani.ge1@gmail.com>2021-08-23 17:58:01 +0200
commit3749ce5b2983b72bab996b4c046680b450f06b25 (patch)
tree0e628c4ca85d1d9b88c13365723cb88acbd3136d
parenteed0c8ca3b84eef0cd53989f6e94c3098c530d37 (diff)
extract_utils: Add support for overriding packages
* An example of how this can be used is say a device wants to use the original OEM camera, e.g. Essential PH-1. Klik is required in order to use the external camera module that you could buy for the device so it's preferred to use it over Camera2 or Snap. * An example of how to use this argument: -system/priv-app/Klik/Klik.apk;OVERRIDES=Camera2 Change-Id: I2504cbb760b20ed86c2dc088cc4bd74b78ba64d9
-rw-r--r--extract_utils.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/extract_utils.sh b/extract_utils.sh
index 7d2785f..94c717d 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -358,6 +358,7 @@ function write_blueprint_packages() {
local EXTENSION=
local PKGNAME=
local SRC=
+ local OVERRIDEPKG=
for P in "${FILELIST[@]}"; do
FILE=$(target_file "$P")
@@ -423,12 +424,21 @@ function write_blueprint_packages() {
SRC="$SRC/app"
fi
printf '\tapk: "%s/%s",\n' "$SRC" "$FILE"
- if [ "$ARGS" = "PRESIGNED" ]; then
- printf '\tpresigned: true,\n'
- elif [ ! -z "$ARGS" ]; then
- printf '\tcertificate: "%s",\n' "$ARGS"
- else
+ ARGS=(${ARGS//;/ })
+ if [ -z "$ARGS" ]; then
printf '\tcertificate: "platform",\n'
+ else
+ for ARG in "${ARGS[@]}"; do
+ if [ "$ARG" = "PRESIGNED" ]; then
+ printf '\tpresigned: true,\n'
+ elif [[ "$ARG" =~ "OVERRIDES" ]]; then
+ OVERRIDEPKG=${ARG#*=}
+ OVERRIDEPKG=${OVERRIDEPKG//,/ }
+ printf '\toverrides: ["%s"],\n' "$OVERRIDEPKG"
+ elif [ ! -z "$ARG" ]; then
+ printf '\tcertificate: "%s",\n' "$ARG"
+ fi
+ done
fi
elif [ "$CLASS" = "JAVA_LIBRARIES" ]; then
printf 'dex_import {\n'