Change the integration GApps conditions

This commit is contained in:
Howard Wu 2022-09-03 23:44:52 +08:00
parent 1591313b20
commit 0d08462c49
2 changed files with 19 additions and 23 deletions

View File

@ -99,18 +99,18 @@ exit_with_message(){
usage(){ usage(){
default default
echo "Usage: echo "Usage:
--arch Architecture of WSA, x64 or arm64, default: $ARCH --arch Architecture of WSA. x64 or arm64. default: $ARCH
--release-type Release type of WSA, retail, RP (Release Preview), WIS (Insider Slow) or WIF (Insider Fast), default: $RELEASE_TYPE --release-type Release type of WSA. retail, RP (Release Preview), WIS (Insider Slow) or WIF (Insider Fast). default: $RELEASE_TYPE
--magisk-ver Magisk version, stable or canary, default: $MAGISK_VER --magisk-ver Magisk version, stable or canary, default: $MAGISK_VER
--gapps-brand GApps brand, OpenGApps or MindTheGapps, default: $GAPPS_BRAND --gapps-brand GApps brand. OpenGApps, MindTheGapps or none for no integration of GApps. default: $GAPPS_BRAND
--gapps-variant GApps variant, pico or full, etc...., default: $GAPPS_VARIANT --gapps-variant GApps variant. pico or full, etc...., default: $GAPPS_VARIANT
--root-sol Root solution, magisk or none, default: $ROOT_SOL --root-sol Root solution. magisk or none, default: $ROOT_SOL
--remove-amazon Remove Amazon Appstore from the system, default: false --remove-amazon Remove Amazon Appstore from the system. default: false
--compress Compress the WSA, default: false --compress Compress the WSA. default: false
--offline Build WSA offline, default: false --offline Build WSA offline. default: false
--magisk-custom Install custom Magisk, default: false --magisk-custom Install custom Magisk. default: false
--debug Debug build mode, default: false --debug Debug build mode. default: false
--help Show this help message and exit --help Show this help message and exit.
Example: Example:
./build.sh --arch x64 --release-type retail --magisk-ver stable --gapps-brand OpenGApps --gapps-variant pico --remove-amazon ./build.sh --arch x64 --release-type retail --magisk-ver stable --gapps-brand OpenGApps --gapps-variant pico --remove-amazon
@ -197,8 +197,6 @@ GAPPS_VARIANT_MAP=(
"pico" "pico"
"tvstock" "tvstock"
"tvmini" "tvmini"
"none"
"MindTheGapps"
) )
ROOT_SOL_MAP=( ROOT_SOL_MAP=(
@ -265,10 +263,8 @@ if [ -z "${OFFLINE+x}" ]; then
if [ -z "${CUSTOM_MAGISK+x}" ]; then if [ -z "${CUSTOM_MAGISK+x}" ]; then
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
fi fi
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
if [ "$GAPPS_BRAND" = "OpenGApps" ]; then python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
fi
fi fi
echo "Download Artifacts" echo "Download Artifacts"
@ -284,7 +280,7 @@ else
OFFLINE_ERR="1" OFFLINE_ERR="1"
fi fi
done done
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
if [ ! -f "$GAPPS_PATH" ]; then if [ ! -f "$GAPPS_PATH" ]; then
echo "Offline mode: missing [$GAPPS_PATH]." echo "Offline mode: missing [$GAPPS_PATH]."
OFFLINE_ERR="1" OFFLINE_ERR="1"
@ -330,7 +326,7 @@ else
fi fi
echo -e "done\n" echo -e "done\n"
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
echo "Extract GApps" echo "Extract GApps"
mkdir -p "$WORK_DIR"/gapps || abort mkdir -p "$WORK_DIR"/gapps || abort
if [ -f "$GAPPS_PATH" ]; then if [ -f "$GAPPS_PATH" ]; then
@ -533,7 +529,7 @@ find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '
find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -type f -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions/platform.xml {} \; find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -type f -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions/platform.xml {} \;
echo -e "Add extra packages done\n" echo -e "Add extra packages done\n"
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
echo "Integrate GApps" echo "Integrate GApps"
find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \; find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \;
@ -594,7 +590,7 @@ if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRA
echo -e "Integrate GApps done\n" echo -e "Integrate GApps done\n"
fi fi
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
echo "Fix GApps prop" echo "Fix GApps prop"
sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort
echo -e "done\n" echo -e "done\n"
@ -725,7 +721,7 @@ elif [[ "$ROOT_SOL" = "" ]]; then
else else
name1="-with-$ROOT_SOL-$MAGISK_VER" name1="-with-$ROOT_SOL-$MAGISK_VER"
fi fi
if [[ "$GAPPS_VARIANT" = "none" || "$GAPPS_VARIANT" = "" || "$GAPPS_BRAND" = "none" ]]; then if [ "$GAPPS_BRAND" = "none" ]; then
name2="-NoGApps" name2="-NoGApps"
else else
if [ "$GAPPS_BRAND" = "OpenGApps" ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then

View File

@ -122,7 +122,7 @@ if [ $GAPPS_BRAND = "OpenGApps" ]; then
GAPPS_VARIANT=pico GAPPS_VARIANT=pico
fi fi
else else
GAPPS_VARIANT=$GAPPS_BRAND GAPPS_VARIANT="pico"
fi fi
if (YesNoBox '([title]="Remove Amazon Appstore" [text]="Do you want to keep Amazon Appstore?")'); then if (YesNoBox '([title]="Remove Amazon Appstore" [text]="Do you want to keep Amazon Appstore?")'); then