Skip to content

Commit 2726a69

Browse files
committed
When installing GApps explicitly prompts to install Magisk instead of silently installing it
1 parent 8c71c33 commit 2726a69

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

scripts/build.sh

+16-6
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,18 @@ if [ "$DEBUG" ]; then
300300
set -x
301301
fi
302302

303-
if [ "$HAS_GAPPS" ] && [ "$ROOT_SOL" = "kernelsu" ]; then
304-
abort "Unsupported combination: Install GApps and KernelSU"
303+
if [ "$HAS_GAPPS" ]; then
304+
case "$ROOT_SOL" in
305+
"none")
306+
ROOT_SOL="magisk"
307+
echo "WARN: Force install Magisk since GApps needs it to mount the file"
308+
;;
309+
"kernelsu")
310+
abort "Unsupported combination: Install GApps and KernelSU"
311+
;;
312+
*)
313+
;;
314+
esac
305315
fi
306316

307317
# shellcheck disable=SC1091
@@ -402,7 +412,7 @@ if [[ "$WSA_MAJOR_VER" -lt 2211 ]]; then
402412
fi
403413
if [ -z ${OFFLINE+x} ]; then
404414
echo "Generating Download Links"
405-
if [ "$HAS_GAPPS" ] || [ "$ROOT_SOL" = "magisk" ]; then
415+
if [ "$ROOT_SOL" = "magisk" ]; then
406416
if [ -z ${CUSTOM_MAGISK+x} ]; then
407417
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
408418
fi
@@ -429,7 +439,7 @@ if [ -z ${OFFLINE+x} ]; then
429439
fi
430440
fi
431441
declare -A FILES_CHECK_LIST=([xaml_PATH]="$xaml_PATH" [vclibs_PATH]="$vclibs_PATH" [UWPVCLibs_PATH]="$UWPVCLibs_PATH")
432-
if [ "$HAS_GAPPS" ] || [ "$ROOT_SOL" = "magisk" ]; then
442+
if [ "$ROOT_SOL" = "magisk" ]; then
433443
FILES_CHECK_LIST+=(["MAGISK_PATH"]="$MAGISK_PATH" ["CUST_PATH"]="$CUST_PATH")
434444
fi
435445
if [ "$ROOT_SOL" = "kernelsu" ]; then
@@ -449,7 +459,7 @@ done
449459
if [ "$FILE_MISSING" ]; then
450460
abort "Some files are missing"
451461
fi
452-
if [ "$HAS_GAPPS" ] || [ "$ROOT_SOL" = "magisk" ]; then
462+
if [ "$ROOT_SOL" = "magisk" ]; then
453463
echo "Extracting Magisk"
454464
if [ -f "$MAGISK_PATH" ]; then
455465
MAGISK_VERSION_NAME=""
@@ -472,7 +482,7 @@ if [ "$HAS_GAPPS" ] || [ "$ROOT_SOL" = "magisk" ]; then
472482
echo -e "done\n"
473483
fi
474484

475-
if [ "$HAS_GAPPS" ] || [ "$ROOT_SOL" = "magisk" ]; then
485+
if [ "$ROOT_SOL" = "magisk" ]; then
476486
echo "Integrating Magisk"
477487
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk64" "$WORK_DIR/magisk/magisk64.xz"
478488
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk32" "$WORK_DIR/magisk/magisk32.xz"

0 commit comments

Comments
 (0)