Add skip download wsa (#287)

This commit is contained in:
Howard Wu 2022-12-09 18:10:28 +08:00 committed by GitHub
parent c86cd29e33
commit 67682f8ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,56 +173,57 @@ usage() {
default default
echo -e " echo -e "
Usage: Usage:
--arch Architecture of WSA. --arch Architecture of WSA.
Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}") Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}")
Default: $ARCH Default: $ARCH
--release-type Release type of WSA. --release-type Release type of WSA.
RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast. RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast.
Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}") Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}")
Default: $RELEASE_TYPE Default: $RELEASE_TYPE
--magisk-ver Magisk version. --magisk-ver Magisk version.
Possible values: $(ARR_TO_STR "${MAGISK_VER_MAP[@]}") Possible values: $(ARR_TO_STR "${MAGISK_VER_MAP[@]}")
Default: $MAGISK_VER Default: $MAGISK_VER
--gapps-brand GApps brand. --gapps-brand GApps brand.
\"none\" for no integration of GApps \"none\" for no integration of GApps
Possible values: $(ARR_TO_STR "${GAPPS_BRAND_MAP[@]}") Possible values: $(ARR_TO_STR "${GAPPS_BRAND_MAP[@]}")
Default: $GAPPS_BRAND Default: $GAPPS_BRAND
--gapps-variant GApps variant. --gapps-variant GApps variant.
Possible values: $(ARR_TO_STR "${GAPPS_VARIANT_MAP[@]}") Possible values: $(ARR_TO_STR "${GAPPS_VARIANT_MAP[@]}")
Default: $GAPPS_VARIANT Default: $GAPPS_VARIANT
--root-sol Root solution. --root-sol Root solution.
\"none\" means no root. \"none\" means no root.
Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}") Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}")
Default: $ROOT_SOL Default: $ROOT_SOL
--compress-format --compress-format
Compress format of output file. Compress format of output file.
If this option is not specified and --compress is not specified, the generated file will not be compressed If this option is not specified and --compress is not specified, the generated file will not be compressed
Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}") Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}")
Additional Options: Additional Options:
--remove-amazon Remove Amazon Appstore from the system --remove-amazon Remove Amazon Appstore from the system
--compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format --compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format
--offline Build WSA offline --offline Build WSA offline
--magisk-custom Install custom Magisk --magisk-custom Install custom Magisk
--debug Debug build mode --skip-download-wsa Skip download WSA
--help Show this help message and exit --debug Debug build mode
--nofix-props No fix \"build.prop\" --help Show this help message and exit
$GAPPS_PROPS_MSG1 --nofix-props No fix \"build.prop\"
$GAPPS_PROPS_MSG2 $GAPPS_PROPS_MSG1
$GAPPS_PROPS_MSG3 $GAPPS_PROPS_MSG2
$GAPPS_PROPS_MSG3
Example: Example:
./build.sh --release-type RP --magisk-ver beta --gapps-variant pico --remove-amazon ./build.sh --release-type RP --magisk-ver beta --gapps-variant pico --remove-amazon
@ -247,6 +248,7 @@ ARGUMENT_LIST=(
"magisk-custom" "magisk-custom"
"debug" "debug"
"help" "help"
"skip-download-wsa"
) )
default default
@ -262,21 +264,22 @@ opts=$(
eval set --"$opts" eval set --"$opts"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--arch ) ARCH="$2"; shift 2 ;; --arch ) ARCH="$2"; shift 2 ;;
--release-type ) RELEASE_TYPE="$2"; shift 2 ;; --release-type ) RELEASE_TYPE="$2"; shift 2 ;;
--gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;; --gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;;
--gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;; --gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;;
--nofix-props ) NOFIX_PROPS="yes"; shift ;; --nofix-props ) NOFIX_PROPS="yes"; shift ;;
--root-sol ) ROOT_SOL="$2"; shift 2 ;; --root-sol ) ROOT_SOL="$2"; shift 2 ;;
--compress-format ) COMPRESS_FORMAT="$2"; shift 2 ;; --compress-format ) COMPRESS_FORMAT="$2"; shift 2 ;;
--remove-amazon ) REMOVE_AMAZON="yes"; shift ;; --remove-amazon ) REMOVE_AMAZON="yes"; shift ;;
--compress ) COMPRESS_OUTPUT="yes"; shift ;; --compress ) COMPRESS_OUTPUT="yes"; shift ;;
--offline ) OFFLINE="on"; shift ;; --offline ) OFFLINE="on"; shift ;;
--magisk-custom ) CUSTOM_MAGISK="debug"; shift ;; --magisk-custom ) CUSTOM_MAGISK="debug"; shift ;;
--magisk-ver ) MAGISK_VER="$2"; shift 2 ;; --magisk-ver ) MAGISK_VER="$2"; shift 2 ;;
--debug ) DEBUG="on"; shift ;; --debug ) DEBUG="on"; shift ;;
--help ) usage; exit 0 ;; --skip-download-wsa ) DOWN_WSA="no"; shift ;;
-- ) shift; break;; --help ) usage; exit 0 ;;
-- ) shift; break;;
esac esac
done done
@ -364,10 +367,14 @@ update_gapps_zip_name
if [ -z "${OFFLINE+x}" ]; then if [ -z "${OFFLINE+x}" ]; then
trap 'rm -f -- "${DOWNLOAD_DIR:?}/${DOWNLOAD_CONF_NAME}"' EXIT trap 'rm -f -- "${DOWNLOAD_DIR:?}/${DOWNLOAD_CONF_NAME}"' EXIT
require_su require_su
echo "Generate Download Links" if [ "${DOWN_WSA}" != "no" ]; then
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort echo "Generate Download Links"
# shellcheck disable=SC1091 python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
source "${WORK_DIR:?}/ENV" || abort # shellcheck disable=SC1091
source "${WORK_DIR:?}/ENV" || abort
else
DOWN_WSA_MAIN_VERSION=2211
fi
if [[ "$DOWN_WSA_MAIN_VERSION" -ge 2211 ]]; then if [[ "$DOWN_WSA_MAIN_VERSION" -ge 2211 ]]; then
ANDROID_API=33 ANDROID_API=33
update_gapps_zip_name update_gapps_zip_name
@ -426,14 +433,14 @@ fi
echo "Extract Magisk" echo "Extract Magisk"
if [ -f "$MAGISK_PATH" ]; then if [ -f "$MAGISK_PATH" ]; then
version="" version=""
versionCode=0 versionCode=0
if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then
echo "Unzip Magisk failed, is the download incomplete?" echo "Unzip Magisk failed, is the download incomplete?"
CLEAN_DOWNLOAD_MAGISK=1 CLEAN_DOWNLOAD_MAGISK=1
abort abort
fi fi
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source "${WORK_DIR:?}/ENV" || abort source "${WORK_DIR:?}/ENV" || abort
$SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort
$SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort