From 60f5c87ceaca0eb93e934852cc28f3238ea965a0 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sat, 3 Sep 2022 13:32:52 +0900 Subject: [PATCH 1/8] Minor Changes --- README.md | 4 +++- scripts/build.sh | 2 +- scripts/run.sh | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 82130076a0..bdb917e0b7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ## Pre-request - Ubuntu (you can use WSL2) + - [Ubuntu 22.04 LTS](https://apps.microsoft.com/store/detail/9PN20MSR04DW) + - [Ubuntu 20.04 LTS](https://apps.microsoft.com/store/detail/9MTTCL66CPXJ) ## Features @@ -10,7 +12,7 @@ - Keep each build up to date - Support both ARM64 and x64 - Support all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead) -- Remove Amazon AppStore +- Remove Amazon Appstore - Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs)) - Add device management feature - Unattended installation diff --git a/scripts/build.sh b/scripts/build.sh index 848913f08e..d63f59a6e4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -105,7 +105,7 @@ usage(){ --gapps-brand GApps brand, OpenGApps or MindTheGApps, default: $GAPPS_BRAND --gapps-variant GApps variant, pico or full, etc...., default: $GAPPS_VARIANT --root-sol Root solution, magisk or none, default: $ROOT_SOL - --remove-amazon Remove Amazon from the system, default: false + --remove-amazon Remove Amazon Appstore from the system, default: false --compress Compress the WSA, default: false --offline Build WSA offline, default: false --magisk-custom Install custom Magisk, default: false diff --git a/scripts/run.sh b/scripts/run.sh index d04911da37..5fab14fa86 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -47,7 +47,7 @@ function YesNoBox { } echo "Dependencies" -sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs python3-pip aria2 +sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs python3-pip aria2 ca-certificates python3 -m pip install requests cp -r ../wine/.cache/* ~/.cache winetricks msxml6 || abort @@ -123,7 +123,7 @@ else GAPPS_VARIANT=$GAPPS_BRAND fi -if (YesNoBox '([title]="Remove Amazon AppStore" [text]="Do you want to keep Amazon AppStore?")'); then +if (YesNoBox '([title]="Remove Amazon Appstore" [text]="Do you want to keep Amazon Appstore?")'); then REMOVE_AMAZON="" else REMOVE_AMAZON="--remove-amazon" From 8970dcd7cafb6ca9e3c0c088ef071f95176b62a1 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sat, 3 Sep 2022 13:52:15 +0900 Subject: [PATCH 2/8] Fix Jump links --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bdb917e0b7..044a82c2b2 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ ## Pre-request - Ubuntu (you can use WSL2) - - [Ubuntu 22.04 LTS](https://apps.microsoft.com/store/detail/9PN20MSR04DW) - - [Ubuntu 20.04 LTS](https://apps.microsoft.com/store/detail/9MTTCL66CPXJ) + - [Search page](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited) ## Features From c111114d241cf81df0c1263858802f40b3ae9ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A2=A7=E8=88=9E=E3=81=99=E3=81=BF=E3=81=BB?= Date: Sat, 3 Sep 2022 19:40:44 +0900 Subject: [PATCH 3/8] Update build.sh Fix nameserver timeout error --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 848913f08e..06ba153534 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -271,7 +271,7 @@ if [ -z "${OFFLINE+x}" ]; then fi echo "Download Artifacts" - if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --allow-overwrite=true --conditional-get=true -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then + if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --allow-overwrite=true --conditional-get=true -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then echo "We have encountered an error while downloading files." exit 1 fi From 2ef1502adcb5fd59b8e059b0502cf34f894cf15d Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sat, 3 Sep 2022 22:19:03 +0900 Subject: [PATCH 4/8] Eliminate `ca-certificates` --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 5fab14fa86..6d1eca4c63 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -47,7 +47,7 @@ function YesNoBox { } echo "Dependencies" -sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs python3-pip aria2 ca-certificates +sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs python3-pip aria2 python3 -m pip install requests cp -r ../wine/.cache/* ~/.cache winetricks msxml6 || abort From b03a18f7d161bcd25c0876dccad5b211da4ffea8 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 3 Sep 2022 21:50:35 +0800 Subject: [PATCH 5/8] Enable file integrity checks and resume incomplete downloads --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index caeea7e94b..76960c3b0a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -271,7 +271,7 @@ if [ -z "${OFFLINE+x}" ]; then fi echo "Download Artifacts" - if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --allow-overwrite=true --conditional-get=true -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then + if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity=true --continue=true --allow-overwrite=true --conditional-get=true -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then echo "We have encountered an error while downloading files." exit 1 fi From 07d36084cce286ece1b21e21e59f0518e9bb974d Mon Sep 17 00:00:00 2001 From: someone5678 Date: Sat, 3 Sep 2022 23:26:38 +0900 Subject: [PATCH 6/8] scripts: Fix MindTheGapps integration * Fix MindTheGapps integration failure in build.sh due to missing element in GAPPS_BRAND_MAP and GAPPS_VARIANT_MAP * Change MindTheGApps to MindTheGapps as that is the official name of the project[1] * Add PRODUCT_SIZE caculation as MindTheGApps has gapps blobs and packages in product partion too ref: [1] https://gitlab.com/MindTheGapps/vendor_gapps --- scripts/build.sh | 8 ++++++-- scripts/run.sh | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 76960c3b0a..c228f85495 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -102,7 +102,7 @@ usage(){ --arch Architecture of WSA, x64 or arm64, default: $ARCH --release-type Release type of WSA, retail, RP (Release Preview), WIS (Insider Slow) or WIF (Insider Fast), default: $RELEASE_TYPE --magisk-ver Magisk version, stable or canary, default: $MAGISK_VER - --gapps-brand GApps brand, OpenGApps or MindTheGApps, default: $GAPPS_BRAND + --gapps-brand GApps brand, OpenGApps or MindTheGapps, default: $GAPPS_BRAND --gapps-variant GApps variant, pico or full, etc...., default: $GAPPS_VARIANT --root-sol Root solution, magisk or none, default: $ROOT_SOL --remove-amazon Remove Amazon Appstore from the system, default: false @@ -183,7 +183,7 @@ MAGISK_VER_MAP=( GAPPS_BRAND_MAP=( "OpenGApps" - "MindTheGApps" + "MindTheGapps" "none" ) @@ -198,6 +198,7 @@ GAPPS_VARIANT_MAP=( "tvstock" "tvmini" "none" + "MindTheGapps" ) ROOT_SOL_MAP=( @@ -382,6 +383,9 @@ if [ -d "$WORK_DIR"/gapps ]; then if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi + if [ -d "$WORK_DIR"/gapps/product ]; then + PRODUCT_SIZE=$(( PRODUCT_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) + fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) diff --git a/scripts/run.sh b/scripts/run.sh index 6d1eca4c63..07083ca859 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -21,6 +21,8 @@ # DEBUG=--debug # CUSTOM_MAGISK=--magisk-custom +DOWNLOAD_DIR=../download + if [ ! "$BASH_VERSION" ] ; then echo "Please do not use sh to run this script, just execute it directly" 1>&2 exit 1 From 1591313b20f1bee36966f3664db77ff724ed5015 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 3 Sep 2022 23:18:38 +0800 Subject: [PATCH 7/8] Remove duplicate product size calculation. --- scripts/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index c228f85495..3efbbefe95 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -383,9 +383,6 @@ if [ -d "$WORK_DIR"/gapps ]; then if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi - if [ -d "$WORK_DIR"/gapps/product ]; then - PRODUCT_SIZE=$(( PRODUCT_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) - fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) From 0d08462c49a66315578ef3e1af7010bbaeb8a81f Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sat, 3 Sep 2022 23:44:52 +0800 Subject: [PATCH 8/8] Change the integration GApps conditions --- scripts/build.sh | 40 ++++++++++++++++++---------------------- scripts/run.sh | 2 +- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 3efbbefe95..7b28a1975b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -99,18 +99,18 @@ exit_with_message(){ usage(){ default echo "Usage: - --arch Architecture of WSA, x64 or arm64, default: $ARCH - --release-type Release type of WSA, retail, RP (Release Preview), WIS (Insider Slow) or WIF (Insider Fast), default: $RELEASE_TYPE + --arch Architecture of WSA. x64 or arm64. default: $ARCH + --release-type Release type of WSA. retail, RP (Release Preview), WIS (Insider Slow) or WIF (Insider Fast). default: $RELEASE_TYPE --magisk-ver Magisk version, stable or canary, default: $MAGISK_VER - --gapps-brand GApps brand, OpenGApps or MindTheGapps, default: $GAPPS_BRAND - --gapps-variant GApps variant, pico or full, etc...., default: $GAPPS_VARIANT - --root-sol Root solution, magisk or none, default: $ROOT_SOL - --remove-amazon Remove Amazon Appstore from the system, default: false - --compress Compress the WSA, default: false - --offline Build WSA offline, default: false - --magisk-custom Install custom Magisk, default: false - --debug Debug build mode, default: false - --help Show this help message and exit + --gapps-brand GApps brand. OpenGApps, MindTheGapps or none for no integration of GApps. default: $GAPPS_BRAND + --gapps-variant GApps variant. pico or full, etc...., default: $GAPPS_VARIANT + --root-sol Root solution. magisk or none, default: $ROOT_SOL + --remove-amazon Remove Amazon Appstore from the system. default: false + --compress Compress the WSA. default: false + --offline Build WSA offline. default: false + --magisk-custom Install custom Magisk. default: false + --debug Debug build mode. default: false + --help Show this help message and exit. Example: ./build.sh --arch x64 --release-type retail --magisk-ver stable --gapps-brand OpenGApps --gapps-variant pico --remove-amazon @@ -197,8 +197,6 @@ GAPPS_VARIANT_MAP=( "pico" "tvstock" "tvmini" - "none" - "MindTheGapps" ) ROOT_SOL_MAP=( @@ -265,10 +263,8 @@ if [ -z "${OFFLINE+x}" ]; then if [ -z "${CUSTOM_MAGISK+x}" ]; then python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort fi - if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ]; then - if [ "$GAPPS_BRAND" = "OpenGApps" ]; then - python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort - fi + if [ "$GAPPS_BRAND" = "OpenGApps" ]; then + python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort fi echo "Download Artifacts" @@ -284,7 +280,7 @@ else OFFLINE_ERR="1" fi done - if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then + if [ "$GAPPS_BRAND" != 'none' ]; then if [ ! -f "$GAPPS_PATH" ]; then echo "Offline mode: missing [$GAPPS_PATH]." OFFLINE_ERR="1" @@ -330,7 +326,7 @@ else fi echo -e "done\n" -if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then +if [ "$GAPPS_BRAND" != 'none' ]; then echo "Extract GApps" mkdir -p "$WORK_DIR"/gapps || abort if [ -f "$GAPPS_PATH" ]; then @@ -533,7 +529,7 @@ find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf ' find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -type f -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions/platform.xml {} \; echo -e "Add extra packages done\n" -if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then +if [ "$GAPPS_BRAND" != 'none' ]; then echo "Integrate GApps" find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \; @@ -594,7 +590,7 @@ if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRA echo -e "Integrate GApps done\n" fi -if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then +if [ "$GAPPS_BRAND" != 'none' ]; then echo "Fix GApps prop" sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort echo -e "done\n" @@ -725,7 +721,7 @@ elif [[ "$ROOT_SOL" = "" ]]; then else name1="-with-$ROOT_SOL-$MAGISK_VER" fi -if [[ "$GAPPS_VARIANT" = "none" || "$GAPPS_VARIANT" = "" || "$GAPPS_BRAND" = "none" ]]; then +if [ "$GAPPS_BRAND" = "none" ]; then name2="-NoGApps" else if [ "$GAPPS_BRAND" = "OpenGApps" ]; then diff --git a/scripts/run.sh b/scripts/run.sh index 07083ca859..fcb70a1095 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -122,7 +122,7 @@ if [ $GAPPS_BRAND = "OpenGApps" ]; then GAPPS_VARIANT=pico fi else - GAPPS_VARIANT=$GAPPS_BRAND + GAPPS_VARIANT="pico" fi if (YesNoBox '([title]="Remove Amazon Appstore" [text]="Do you want to keep Amazon Appstore?")'); then