Refine menu (#427)

Close #426
This commit is contained in:
Howard Wu 2023-03-19 19:34:31 +08:00 committed by GitHub
parent 960760f07c
commit 81d59ad9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,6 @@ function YesNoBox {
ARCH=$(
Radiolist '([title]="Build arch"
[default]="x64")' \
\
'x64' "X86_64" 'on' \
'arm64' "AArch64" 'off'
)
@ -56,34 +55,42 @@ ARCH=$(
RELEASE_TYPE=$(
Radiolist '([title]="WSA release type"
[default]="retail")' \
\
'retail' "Stable Channel" 'on' \
'release preview' "Release Preview Channel" 'off' \
'insider slow' "Beta Channel" 'off' \
'insider fast' "Dev Channel" 'off'
)
if [ -z "${CUSTOM_MAGISK+x}" ]; then
if (YesNoBox '([title]="Root" [text]="Do you want to Root WSA?")'); then
ROOT_SOL=$(
Radiolist '([title]="Root solution"
[default]="magisk")' \
'magisk' "Magisk" 'on' \
'kernelsu' "KernelSU" 'off'
)
else
ROOT_SOL="none"
fi
if [ "$ROOT_SOL" = "magisk" ]; then
MAGISK_VER=$(
Radiolist '([title]="Magisk version"
[default]="stable")' \
\
'stable' "Stable Channel" 'on' \
'beta' "Beta Channel" 'off' \
'canary' "Canary Channel" 'off' \
'debug' "Canary Channel Debug Build" 'off'
)
else
MAGISK_VER=debug
MAGISK_VER=stable
fi
if (YesNoBox '([title]="Install GApps" [text]="Do you want to install GApps?")'); then
GAPPS_BRAND=$(
Radiolist '([title]="Which GApps do you want to install?"
[default]="MindTheGapps")' \
\
'OpenGApps' "This flavor may cause startup failure" 'off' \
'MindTheGapps' "Recommend" 'on'
'MindTheGapps' "Recommend" 'on' \
'OpenGApps' "This flavor may cause startup failure" 'off'
)
else
GAPPS_BRAND="none"
@ -94,7 +101,6 @@ if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
GAPPS_VARIANT=$(
Radiolist '([title]="Variants of GApps"
[default]="pico")' \
\
'super' "" 'off' \
'stock' "" 'off' \
'full' "" 'off' \
@ -118,15 +124,6 @@ else
REMOVE_AMAZON="--remove-amazon"
fi
ROOT_SOL=$(
Radiolist '([title]="Root solution"
[default]="magisk")' \
\
'magisk' "Magisk" 'on' \
'kernelsu' "KernelSU" 'off' \
'none' "Without root" 'off'
)
if (YesNoBox '([title]="Compress output" [text]="Do you want to compress the output?")'); then
COMPRESS_OUTPUT="--compress"
else
@ -136,18 +133,12 @@ if [ "$COMPRESS_OUTPUT" = "--compress" ]; then
COMPRESS_FORMAT=$(
Radiolist '([title]="Compress format"
[default]="7z")' \
\
'zip' "Zip" 'off' \
'7z' "7-Zip" 'on' \
'xz' "tar.xz" 'off'
)
fi
# if (YesNoBox '([title]="Off line mode" [text]="Do you want to enable off line mode?")'); then
# OFFLINE="--offline"
# else
# OFFLINE=""
# fi
# OFFLINE="--offline"
clear
declare -A RELEASE_TYPE_MAP=(["retail"]="retail" ["release preview"]="RP" ["insider slow"]="WIS" ["insider fast"]="WIF")
COMMAND_LINE=(--arch "$ARCH" --release-type "${RELEASE_TYPE_MAP[$RELEASE_TYPE]}" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VARIANT" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$COMPRESS_OUTPUT" "$OFFLINE" "$DEBUG" "$CUSTOM_MAGISK" --compress-format "$COMPRESS_FORMAT")