From 73eb7dc19eeb60dbde345a0e4c9dcea5dde36a2e Mon Sep 17 00:00:00 2001 From: Syuugo Date: Tue, 15 Nov 2022 10:07:29 +0900 Subject: [PATCH] Add option to skip fix system props (#254) Co-authored-by: Howard Wu <40033067+Howard20181@users.noreply.github.com> --- scripts/build.sh | 26 ++++++++++++++++++++------ scripts/run.sh | 2 +- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index a588686..a9c8b1a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -162,9 +162,13 @@ ARR_TO_STR() { printf -v joined "%s, " "${arr[@]}" echo "${joined%, }" } +GAPPS_PROPS_MSG1="\033[0;31mWARNING: Services such as the Play Store may stop working properly." +GAPPS_PROPS_MSG2="We are not responsible for any problems caused by this!\033[0m" +GAPPS_PROPS_MSG3="Info: https://support.google.com/android/answer/10248227" usage() { default - echo "Usage: + echo -e " +Usage: --arch Architecture of WSA. Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}") @@ -211,11 +215,15 @@ Additional Options: --magisk-custom Install custom Magisk --debug Debug build mode --help Show this help message and exit + --nofix-props No fix \"build.prop\" + $GAPPS_PROPS_MSG1 + $GAPPS_PROPS_MSG2 + $GAPPS_PROPS_MSG3 Example: ./build.sh --release-type RP --magisk-ver beta --gapps-variant pico --remove-amazon ./build.sh --arch arm64 --release-type WIF --gapps-brand MindTheGapps - ./build.sh --release-type WIS --gapps-brand none + ./build.sh --release-type WIS --gapps-brand none --nofix-props ./build.sh --offline --gapps-variant pico --magisk-custom " } @@ -226,6 +234,7 @@ ARGUMENT_LIST=( "magisk-ver:" "gapps-brand:" "gapps-variant:" + "nofix-props" "root-sol:" "compress-format:" "remove-amazon" @@ -253,9 +262,10 @@ while [[ $# -gt 0 ]]; do --release-type ) RELEASE_TYPE="$2"; shift 2 ;; --gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;; --gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;; + --nofix-props ) NOFIX_PROPS="yes"; shift ;; --root-sol ) ROOT_SOL="$2"; shift 2 ;; --compress-format ) COMPRESS_FORMAT="$2"; shift 2 ;; - --remove-amazon ) REMOVE_AMAZON="remove"; shift ;; + --remove-amazon ) REMOVE_AMAZON="yes"; shift ;; --compress ) COMPRESS_OUTPUT="yes"; shift ;; --offline ) OFFLINE="on"; shift ;; --magisk-custom ) CUSTOM_MAGISK="debug"; shift ;; @@ -680,9 +690,13 @@ if [ "$GAPPS_BRAND" != 'none' ]; then fi if [ "$GAPPS_BRAND" != 'none' ]; then - echo "Fix $GAPPS_BRAND prop" - $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort - echo -e "done\n" + if [ "$NOFIX_PROPS" ]; then + echo -e "Skip fix $GAPPS_BRAND prop!\n$GAPPS_PROPS_MSG1\n$GAPPS_PROPS_MSG2\n$GAPPS_PROPS_MSG3\n" + else + echo "Fix $GAPPS_BRAND prop" + $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort + echo -e "done\n" + fi fi echo "Umount images" diff --git a/scripts/run.sh b/scripts/run.sh index a6659ac..60aab8b 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -110,7 +110,7 @@ if [ -n "${NEED_INSTALL[*]}" ]; then NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1 NEED_INSTALL_FIX=${NEED_INSTALL_FIX//xz-utils/xz} 2>&1 } >> /dev/null - + readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX "; unset 'NEED_INSTALL[-1]'; elif [ "$PM" = "apk" ]; then NEED_INSTALL_FIX=${NEED_INSTALL[*]}