This commit is contained in:
Peter Njeim 2022-09-04 18:38:42 -03:00
commit bde50303cd
3 changed files with 240 additions and 130 deletions

View File

@ -9,7 +9,7 @@ on:
type: choice type: choice
options: options:
- x86_64 - x86_64
- AArch64 - ARM64
release_type: release_type:
description: "WSA Release Channel" description: "WSA Release Channel"
required: true required: true
@ -31,7 +31,7 @@ on:
- Beta - Beta
- Canary - Canary
- Debug - Debug
- Custom (URL) - Custom
magisk_url: magisk_url:
description: "Custom Magisk APK/ZIP URL" description: "Custom Magisk APK/ZIP URL"
required: false required: false
@ -43,11 +43,12 @@ on:
type: choice type: choice
options: options:
- None - None
- Pico - Pico (OpenGApps)
- Full - Full (OpenGApps)
- MindTheGapps (URL) - Custom (OpenGApps)
mindthegapps_url: - Custom (MindTheGapps)
description: "MindTheGapps ZIP URL" gapps_url:
description: "Custom GApps ZIP URL"
required: false required: false
type: string type: string
remove_amazon: remove_amazon:
@ -55,11 +56,6 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
offline_mode:
description: "Offline Mode"
required: false
default: false
type: boolean
permissions: permissions:
contents: write contents: write
@ -83,7 +79,7 @@ jobs:
DOWNLOAD_DIR=../download DOWNLOAD_DIR=../download
DOWNLOAD_CONF_NAME=download.list DOWNLOAD_CONF_NAME=download.list
declare -A opts=( ["ARCH,x86_64"]="x64" ["ARCH,AArch64"]="arm64" ["RELEASE_TYPE,General Availability Channel"]="retail" ["RELEASE_TYPE,Release Preview Channel"]="RP" ["RELEASE_TYPE,Beta Channel"]="WIS" ["RELEASE_TYPE,Dev Channel"]="WIF" ["MAGISK_VER,Stable"]="stable" ["MAGISK_VER,Beta"]="beta" ["MAGISK_VER,Canary"]="canary" ["MAGISK_VER,Debug"]="debug" ["GAPPS_VAR,None"]="none" ["GAPPS_VAR,Pico"]="pico" ["GAPPS_VAR,Full"]="full" ["GAPPS_VAR,MindTheGapps (URL)"]="MindTheGapps" ["REMOVE_AMAZON,true"]="--remove-amazon" ["REMOVE_AMAZON,false"]="" ["OFFLINE_MODE,true"]="--offline" ["OFFLINE_MODE,false"]="" ) declare -A opts=( ["ARCH,x86_64"]="x64" ["ARCH,ARM64"]="arm64" ["RELEASE_TYPE,General Availability Channel"]="retail" ["RELEASE_TYPE,Release Preview Channel"]="RP" ["RELEASE_TYPE,Beta Channel"]="WIS" ["RELEASE_TYPE,Dev Channel"]="WIF" ["MAGISK_VER,Stable"]="stable" ["MAGISK_VER,Beta"]="beta" ["MAGISK_VER,Canary"]="canary" ["MAGISK_VER,Debug"]="debug" ["MAGISK_VER,Custom"]="--magisk-custom" ["GAPPS_VAR,None"]="none" ["GAPPS_VAR,Pico (OpenGApps)"]="pico" ["GAPPS_VAR,Full (OpenGApps)"]="full" ["REMOVE_AMAZON,true"]="--remove-amazon" ["REMOVE_AMAZON,false"]="" )
ARCH="${opts[ARCH,${{ inputs.arch }}]}" ARCH="${opts[ARCH,${{ inputs.arch }}]}"
@ -91,16 +87,16 @@ jobs:
if [ "${{inputs.magisk_ver }}" != "None" ]; then if [ "${{inputs.magisk_ver }}" != "None" ]; then
ROOT_SOL="magisk" ROOT_SOL="magisk"
if [ "${{ inputs.magisk_ver }}" != "Custom (URL)" ]; then if [ "${{ inputs.magisk_ver }}" != "Custom" ]; then
MAGISK_VER="${opts[MAGISK_VER,${{ inputs.magisk_ver }}]}" MAGISK_VER="${opts[MAGISK_VER,${{ inputs.magisk_ver }}]}"
else else
echo "${{ inputs.magisk_url }}" > "$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME" echo "${{ inputs.magisk_url }}" > "$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_custom_magisk_download.log" -R --allow-overwrite -d"$DOWNLOAD_DIR" -o magisk-debug.zip -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_custom_magisk_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -o magisk-debug.zip -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
echo "Custom Magisk download error!" echo "Magisk download error!"
exit 1 exit 1
fi fi
CUSTOM_MAGISK="1" CUSTOM_MAGISK="${opts[MAGISK_VER,Custom]}"
MAGISK_VER="${opts[MAGISK_VER,Debug]}" MAGISK_VER="${opts[MAGISK_VER,Debug]}"
fi fi
else else
@ -108,25 +104,73 @@ jobs:
MAGISK_VER="${opts[MAGISK_VER,Stable]}" MAGISK_VER="${opts[MAGISK_VER,Stable]}"
fi fi
if [ "$ARCH" != "arm64" ]; then if [ "$ARCH" == "x86_64" ]; then
GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}" GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}"
else else
# TODO: keep it 11.0 since official opengapps does not support 12+ yet # TODO: keep it 11.0 since official opengapps does not support 12+ yet
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and download the corresponding version # As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and download the corresponding version
if [ "${{ inputs.gapps_var }}" == "Full" ]; then if [ "${{ inputs.gapps_var }}" == "Full (OpenGApps)" ]; then
GAPPS_VAR="pico" GAPPS_VAR="${opts[GAPPS_VAR,Pico (OpenGApps)]}"
else else
GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}" GAPPS_VAR="${opts[GAPPS_VAR,${{ inputs.gapps_var }}]}"
fi fi
fi fi
if [ "${{inputs.gapps_var }}" != "None" ]; then if [ "${{inputs.gapps_var }}" != "None" ]; then
if [ "${{ inputs.gapps_var }}" != "MindTheGapps (URL)" ]; then if [ "${{ inputs.gapps_var }}" != "Custom (MindTheGapps)" ]; then
GAPPS_BRAND="OpenGApps" GAPPS_BRAND="OpenGApps"
else if [ "${{ inputs.gapps_var }}" == "Custom (OpenGApps)" ]; then
echo "${{ inputs.mindthegapps_url }}" > -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME" if [ -z "${${{ inputs.gapps_url }}+x}" ]; then
GAPPS_VARIANT_MAP=(
"super"
"stock"
"full"
"mini"
"micro"
"nano"
"pico"
"tvstock"
"tvmini"
)
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_mindthegapps_download.log" -R --allow-overwrite -d"$DOWNLOAD_DIR" -o MindTheGapps-"$ARCH".zip -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then for file in "$DOWNLOAD_DIR"/OpenGApps-"$ARCH"-*.zip; do
GAPPS_VAR=${file%%\.*}
GAPPS_VAR=${GAPPS_VAR##*-}
list_count=${#GAPPS_VARIANT_MAP[@]}
for i in "${GAPPS_VARIANT_MAP[@]}"; do
if [ "$GAPPS_VAR" == "$i" ]; then
echo "INFO: GApps Variant: $GAPPS_VAR"
valid_gapps_var="true"
break
fi
((list_count--))
if (("$list_count" <= 0)); then
echo "Invalid GApps Variant: $GAPPS_VAR"
fi
done
if [[ "$valid_gapps_var" == "true" ]]; then
break
fi
done
if [[ "$valid_gapps_var" != "true" ]]; then
echo "Missing OpenGApps file!"
exit 1
fi
echo "opengapps_var=${GAPPS_VAR^}" >> $GITHUB_ENV
else
GAPPS_VAR="pico"
echo "${{ inputs.gapps_url }}" > -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_gapps_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -o OpenGApps-"$ARCH"-"$GAPPS_VAR".zip -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
echo "OpenGApps download error!"
exit 1
fi
echo "opengapps_var=custom" >> $GITHUB_ENV
fi
fi
else
echo "${{ inputs.gapps_url }}" > -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"
if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_gapps_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -o MindTheGapps-"$ARCH".zip -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
echo "MindTheGapps download error!" echo "MindTheGapps download error!"
exit 1 exit 1
fi fi
@ -138,9 +182,22 @@ jobs:
REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}" REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}"
OFFLINE_MODE="${opts[OFFLINE_MODE,${{ inputs.offline_mode }}]}" if [ "${{ inputs.gapps_var }}" == "Custom (OpenGApps)" ]; then
echo "Generate Download Links"
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
if [ "${{ inputs.magisk_ver }}" != "Custom" ]; then
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME"
fi
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$COMPRESS_OUTPUT" "$OFFLINE" "$DEBUG" "$CUSTOM_MAGISK") 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 --check-integrity --continue --allow-overwrite --conditional-get -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
echo "Artifact download error!"
exit 1
fi
OFFLINE="--offline"
fi
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$CUSTOM_MAGISK" "$OFFLINE")
echo "COMMAND_LINE=${COMMAND_LINE[*]}" echo "COMMAND_LINE=${COMMAND_LINE[*]}"
chmod +x ./build.sh chmod +x ./build.sh
@ -152,7 +209,7 @@ jobs:
if [[ "${{ inputs.magisk_ver }}" == "None" ]]; then if [[ "${{ inputs.magisk_ver }}" == "None" ]]; then
magiskVer="" magiskVer=""
elif [[ "${{ inputs.magisk_ver }}" == "Custom (URL)" ]]; then elif [[ "${{ inputs.magisk_ver }}" == "Custom" ]]; then
magiskVer="_Magisk-Custom" magiskVer="_Magisk-Custom"
else else
magiskVer="_Magisk-$(curl -s https://raw.githubusercontent.com/topjohnwu/magisk-files/master/${magisk_vers[${{ inputs.magisk_ver }}]}.json | jq -r ".magisk.version")" magiskVer="_Magisk-$(curl -s https://raw.githubusercontent.com/topjohnwu/magisk-files/master/${magisk_vers[${{ inputs.magisk_ver }}]}.json | jq -r ".magisk.version")"
@ -160,8 +217,10 @@ jobs:
if [[ "${{ inputs.gapps_var }}" == "None" ]]; then if [[ "${{ inputs.gapps_var }}" == "None" ]]; then
gappsVar="" gappsVar=""
elif [[ "${{ inputs.gapps_var }}" == "MindTheGapps (URL)" ]]; then elif [[ "${{ inputs.gapps_var }}" == "Custom (MindTheGapps)" ]]; then
gappsVar="_MindTheGapps" gappsVar="_MindTheGapps"
elif [[ "${{ inputs.gapps_var }}" == "Custom (OpenGApps)" ]]; then
gappsVar="_${{ env.opengapps_var }}-OpenGApps"
else else
gappsVar="_${{ inputs.gapps_var }}-OpenGApps" gappsVar="_${{ inputs.gapps_var }}-OpenGApps"
fi fi

View File

@ -42,7 +42,7 @@
## Help ## Help
How can I get a logcat? How do I get a logcat?
- `adb logcat` - `adb logcat`
@ -50,7 +50,7 @@ or
- `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat` - `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat`
How can I update Magisk? How do I update Magisk?
- Wait for a new MagiskOnWSA release that includes the newer Magisk version, then follow the [Installation instructions](#installation) to update - Wait for a new MagiskOnWSA release that includes the newer Magisk version, then follow the [Installation instructions](#installation) to update
@ -58,7 +58,7 @@ Can I pass SafetyNet/Play Integrity?
- No. Virtual machines like WSA cannot pass these mechanisms on their own due to the lack of signing by Google. Passing requires more exotic (and untested) solutions: <https://github.com/kdrag0n/safetynet-fix/discussions/145#discussioncomment-2170917> - No. Virtual machines like WSA cannot pass these mechanisms on their own due to the lack of signing by Google. Passing requires more exotic (and untested) solutions: <https://github.com/kdrag0n/safetynet-fix/discussions/145#discussioncomment-2170917>
Virtualization? What is virtualization?
- Virtualization is required to run virtual machines like WSA. `Install.ps1` helps you enable it. After rebooting, re-run `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in your BIOS/UEFI. Instructions vary by PC vendor, look for help online - Virtualization is required to run virtual machines like WSA. `Install.ps1` helps you enable it. After rebooting, re-run `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in your BIOS/UEFI. Instructions vary by PC vendor, look for help online
@ -66,10 +66,30 @@ Can I remount system partition as read-write?
- No. WSA is mounted as read-only by Hyper-V. You can, however, modify the system partition by creating a Magisk module, or by directly modifying the system.img file - No. WSA is mounted as read-only by Hyper-V. You can, however, modify the system partition by creating a Magisk module, or by directly modifying the system.img file
How can I uninstall Magisk? How do I uninstall Magisk?
- Download a WSA version that doesn't include Magisk from the [Releases page](https://github.com/PeterNjeim/MagiskOnWSA/releases). Then follow the [Installation instructions](#installation) - Download a WSA version that doesn't include Magisk from the [Releases page](https://github.com/PeterNjeim/MagiskOnWSA/releases). Then follow the [Installation instructions](#installation)
How do I install custom Magisk or GApps?
1. Fork this repository
2. **A)** Magisk
1. **a)** Via local file:
1. Create a folder named `download in the root
2. Move your custom Magisk APK/ZIP file to the `download` folder and rename it to `magisk-debug.zip`
2. In GitHub Actions, click on `Build MagiskOnWSA`
3. Choose `Custom` in the `Magisk Version` field
4. **b)** Via URL:
1. Input the URL pointing to your custom Magisk APK/ZIP file in the `Custom Magisk APK/ZIP URL` field
3. **B)** GApps
1. **a)** Via local file:
1. Create a folder named `download in the root
2. Move your custom OpenGApps or MindTheGapps ZIP file to the `download` folder and rename it to `OpenGApps-{arch}-{variant}.zip` or `MindTheGapps-{arch}.zip` *(e.g. `OpenGApps-x64-pico.zip` or `MindTheGapps-arm64.zip`)*
2. In GitHub Actions, click on `Build MagiskOnWSA`
3. Choose `Custom (OpenGApps)` or `Custom (MindTheGapps)` in the `GApps Variant` field
4. **b)** Via URL:
1. Input the URL pointing to your custom OpenGApps or MindTheGapps ZIP file in the `Custom GApps ZIP URL` field
## Credits ## Credits
- [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA - [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA

View File

@ -80,7 +80,6 @@ function Gen_Rand_Str {
head /dev/urandom | tr -dc A-Za-z0-9 | head -c"$1" head /dev/urandom | tr -dc A-Za-z0-9 | head -c"$1"
} }
default() { default() {
ARCH=x64 ARCH=x64
RELEASE_TYPE=retail RELEASE_TYPE=retail
@ -93,29 +92,105 @@ default(){
exit_with_message() { exit_with_message() {
echo "ERROR: $1" echo "ERROR: $1"
usage usage
abort exit 1
} }
ARCH_MAP=(
"x64"
"arm64"
)
RELEASE_TYPE_MAP=(
"retail"
"RP"
"WIS"
"WIF"
)
MAGISK_VER_MAP=(
"stable"
"beta"
"canary"
"debug"
)
GAPPS_BRAND_MAP=(
"OpenGApps"
"MindTheGapps"
"none"
)
GAPPS_VARIANT_MAP=(
"super"
"stock"
"full"
"mini"
"micro"
"nano"
"pico"
"tvstock"
"tvmini"
)
ROOT_SOL_MAP=(
"magisk"
"none"
)
ARR_TO_STR() {
local arr=("$@")
local joined
printf -v joined "%s, " "${arr[@]}"
echo "${joined%, }"
}
usage() { usage() {
default default
echo "Usage: echo "Usage:
--arch Architecture of WSA, x64 or arm64, default: $ARCH --arch Architecture of WSA.
--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 Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}")
--gapps-brand GApps brand, OpenGApps or MindTheGApps, default: $GAPPS_BRAND Default: $ARCH
--gapps-variant GApps variant, pico or full, etc...., default: $GAPPS_VARIANT
--root-sol Root solution, magisk or none, default: $ROOT_SOL --release-type Release type of WSA.
--remove-amazon Remove Amazon from the system, default: false RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast.
--compress Compress the WSA, default: false
--offline Build WSA offline, default: false Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}")
--magisk-custom Install custom Magisk, default: false Default: $RELEASE_TYPE
--debug Debug build mode, default: false
--magisk-ver Magisk version.
Possible values: $(ARR_TO_STR "${MAGISK_VER_MAP[@]}")
Default: $MAGISK_VER
--gapps-brand GApps brand.
\"none\" for no integration of GApps
Possible values: $(ARR_TO_STR "${GAPPS_BRAND_MAP[@]}")
Default: $GAPPS_BRAND
--gapps-variant GApps variant.
Possible values: $(ARR_TO_STR "${GAPPS_VARIANT_MAP[@]}")
Default: $GAPPS_VARIANT
--root-sol Root solution.
\"none\" means no root.
Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}")
Default: $ROOT_SOL
Additional Options:
--remove-amazon Remove Amazon Appstore from the system
--compress Compress the WSA
--offline Build WSA offline
--magisk-custom Install custom Magisk
--debug Debug build mode
--help Show this help message and exit --help Show this help message and exit
Example: Example:
./build.sh --arch x64 --release-type retail --magisk-ver stable --gapps-brand OpenGApps --gapps-variant pico --remove-amazon ./build.sh --release-type RP --magisk-ver beta --gapps-variant pico --remove-amazon
./build.sh --arch x64 --release-type retail --remove-amazon --magisk-custom --offline ./build.sh --arch arm64 --release-type WIF --gapps-brand MindTheGapps
./build.sh --release-type RP ./build.sh --release-type WIS --gapps-brand none
./build.sh --offline --gapps-variant pico --magisk-custom
" "
} }
@ -136,7 +211,8 @@ ARGUMENT_LIST=(
default default
opts=$(getopt \ opts=$(
getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \ --longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$(basename "$0")" \ --name "$(basename "$0")" \
--options "" \ --options "" \
@ -162,49 +238,6 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
ARCH_MAP=(
"x64"
"arm64"
)
RELEASE_TYPE_MAP=(
"retail"
"RP"
"WIS"
"WIF"
)
MAGISK_VER_MAP=(
"stable"
"beta"
"canary"
"debug"
)
GAPPS_BRAND_MAP=(
"OpenGApps"
"MindTheGApps"
"none"
)
GAPPS_VARIANT_MAP=(
"super"
"stock"
"full"
"mini"
"micro"
"nano"
"pico"
"tvstock"
"tvmini"
"none"
)
ROOT_SOL_MAP=(
"magisk"
"none"
)
check_list() { check_list() {
local input=$1 local input=$1
local name=$2 local name=$2
@ -264,14 +297,12 @@ if [ -z "${OFFLINE+x}" ]; then
if [ -z "${CUSTOM_MAGISK+x}" ]; then if [ -z "${CUSTOM_MAGISK+x}" ]; then
python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
fi fi
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ]; then
if [ "$GAPPS_BRAND" = "OpenGApps" ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort python3 generateGappsLink.py "$ARCH" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
fi fi
fi
echo "Download Artifacts" 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 --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." echo "We have encountered an error while downloading files."
exit 1 exit 1
fi fi
@ -283,7 +314,7 @@ else
OFFLINE_ERR="1" OFFLINE_ERR="1"
fi fi
done done
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
if [ ! -f "$GAPPS_PATH" ]; then if [ ! -f "$GAPPS_PATH" ]; then
echo "Offline mode: missing [$GAPPS_PATH]." echo "Offline mode: missing [$GAPPS_PATH]."
OFFLINE_ERR="1" OFFLINE_ERR="1"
@ -329,7 +360,7 @@ else
fi fi
echo -e "done\n" echo -e "done\n"
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
echo "Extract GApps" echo "Extract GApps"
mkdir -p "$WORK_DIR"/gapps || abort mkdir -p "$WORK_DIR"/gapps || abort
if [ -f "$GAPPS_PATH" ]; then if [ -f "$GAPPS_PATH" ]; then
@ -532,7 +563,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 {} \; 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" 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" echo "Integrate GApps"
find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \; find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \;
@ -593,7 +624,7 @@ if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRA
echo -e "Integrate GApps done\n" echo -e "Integrate GApps done\n"
fi fi
if [ "$GAPPS_VARIANT" != 'none' ] && [ "$GAPPS_VARIANT" != '' ] && [ "$GAPPS_BRAND" != 'none' ]; then if [ "$GAPPS_BRAND" != 'none' ]; then
echo "Fix GApps prop" echo "Fix GApps prop"
sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort
echo -e "done\n" echo -e "done\n"
@ -724,7 +755,7 @@ elif [[ "$ROOT_SOL" = "" ]]; then
else else
name1="-with-$ROOT_SOL-$MAGISK_VER" name1="-with-$ROOT_SOL-$MAGISK_VER"
fi fi
if [[ "$GAPPS_VARIANT" = "none" || "$GAPPS_VARIANT" = "" || "$GAPPS_BRAND" = "none" ]]; then if [ "$GAPPS_BRAND" = "none" ]; then
name2="-NoGApps" name2="-NoGApps"
else else
if [ "$GAPPS_BRAND" = "OpenGApps" ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then