Add option to skip fix system props (#254)

Co-authored-by: Howard Wu <40033067+Howard20181@users.noreply.github.com>
This commit is contained in:
Syuugo 2022-11-15 10:07:29 +09:00 committed by GitHub
parent 7d2cca6f15
commit 73eb7dc19e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View File

@ -162,9 +162,13 @@ ARR_TO_STR() {
printf -v joined "%s, " "${arr[@]}" printf -v joined "%s, " "${arr[@]}"
echo "${joined%, }" 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() { usage() {
default default
echo "Usage: echo -e "
Usage:
--arch Architecture of WSA. --arch Architecture of WSA.
Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}") Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}")
@ -211,11 +215,15 @@ Additional Options:
--magisk-custom Install custom Magisk --magisk-custom Install custom Magisk
--debug Debug build mode --debug Debug build mode
--help Show this help message and exit --help Show this help message and exit
--nofix-props No fix \"build.prop\"
$GAPPS_PROPS_MSG1
$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
./build.sh --arch arm64 --release-type WIF --gapps-brand MindTheGapps ./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 ./build.sh --offline --gapps-variant pico --magisk-custom
" "
} }
@ -226,6 +234,7 @@ ARGUMENT_LIST=(
"magisk-ver:" "magisk-ver:"
"gapps-brand:" "gapps-brand:"
"gapps-variant:" "gapps-variant:"
"nofix-props"
"root-sol:" "root-sol:"
"compress-format:" "compress-format:"
"remove-amazon" "remove-amazon"
@ -253,9 +262,10 @@ while [[ $# -gt 0 ]]; do
--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 ;;
--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="remove"; 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 ;;
@ -680,10 +690,14 @@ if [ "$GAPPS_BRAND" != 'none' ]; then
fi fi
if [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
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" echo "Fix $GAPPS_BRAND prop"
$SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort
echo -e "done\n" echo -e "done\n"
fi fi
fi
echo "Umount images" echo "Umount images"
$SUDO find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \; $SUDO find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \;