This commit is contained in:
Peter Njeim 2022-11-23 19:44:33 -04:00
commit de2544e9c5
8 changed files with 39 additions and 16 deletions

View File

@ -57,6 +57,11 @@ on:
required: true required: true
default: true default: true
type: boolean type: boolean
# nofix_props:
# description: Props Remain Unfixed
# required: true
# default: false
# type: boolean
compression: compression:
description: "Compression Algorithm" description: "Compression Algorithm"
required: true required: true
@ -99,7 +104,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,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"]="pico" ["GAPPS_VAR,Full"]="full" ["REMOVE_AMAZON,true"]="--remove-amazon" ["COMPRESSION,ZIP"]="zip" ["COMPRESSION,7-Zip"]="7z" ["COMPRESSION,XZ"]="xz" ) 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"]="pico" ["GAPPS_VAR,Full"]="full" ["REMOVE_AMAZON,true"]="--remove-amazon" ["NOFIX_PROPS,true"]="--nofix-props" ["COMPRESSION,ZIP"]="zip" ["COMPRESSION,7-Zip"]="7z" ["COMPRESSION,XZ"]="xz" )
ARCH="${opts[ARCH,${{ inputs.arch }}]}" ARCH="${opts[ARCH,${{ inputs.arch }}]}"
@ -208,6 +213,8 @@ jobs:
REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}" REMOVE_AMAZON="${opts[REMOVE_AMAZON,${{ inputs.remove_amazon }}]}"
NOFIX_PROPS="${opts[NOFIX_PROPS,${{ inputs.nofix_props }}]}"
COMPRESSION="--compress --compress-format ${opts[COMPRESSION,${{ inputs.compression }}]}" COMPRESSION="--compress --compress-format ${opts[COMPRESSION,${{ inputs.compression }}]}"
if [[ "${{ inputs.gapps_var }}" == "Custom"* ]]; then if [[ "${{ inputs.gapps_var }}" == "Custom"* ]]; then
@ -225,7 +232,7 @@ jobs:
OFFLINE="--offline" OFFLINE="--offline"
fi fi
COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --root-sol "$ROOT_SOL" --magisk-ver "$MAGISK_VER" "$CUSTOM_MAGISK" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$COMPRESSION" "$REMOVE_AMAZON" "$OFFLINE") COMMAND_LINE=(--arch "$ARCH" --release-type "$RELEASE_TYPE" --root-sol "$ROOT_SOL" --magisk-ver "$MAGISK_VER" "$CUSTOM_MAGISK" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VAR" "$COMPRESSION" "$REMOVE_AMAZON" "$NOFIX_PROPS" "$OFFLINE")
echo "COMMAND_LINE=${COMMAND_LINE[*]}" echo "COMMAND_LINE=${COMMAND_LINE[*]}"
chmod +x ./build.sh chmod +x ./build.sh

View File

@ -25,7 +25,7 @@
## Uninstallation ## Uninstallation
> Note: If you want to preseve your data, make a backup of the `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx` file. After uninstalling, copy the VHDX file back to the `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache` folder. To then restore your app icons to the start menu, install [WSAHelper](https://github.com/LSPosed/WSAHelper/releases/latest) and follow their instructions > Note: If you want to preseve your data, make a backup of the `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx` file. After uninstalling, copy the VHDX file back to the `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache` folder.
1. Go to the Start Menu 1. Go to the Start Menu
2. Type `Windows Subsystem for Android` 2. Type `Windows Subsystem for Android`

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,10 +215,14 @@ 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 OpenGApps --nofix-props
./build.sh --release-type WIS --gapps-brand none ./build.sh --release-type WIS --gapps-brand none
./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,12 +262,13 @@ 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"; MAGISK_VER=$CUSTOM_MAGISK; 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 ;; --help ) usage; exit 0 ;;
@ -266,6 +276,12 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
if [ "$CUSTOM_MAGISK" ]; then
if [ -z "$MAGISK_VER" ]; then
MAGISK_VER=$CUSTOM_MAGISK
fi
fi
check_list() { check_list() {
local input=$1 local input=$1
if [ -n "$input" ]; then if [ -n "$input" ]; then
@ -312,7 +328,7 @@ RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort
echo -e "Build: RELEASE_TYPE=$RELEASE_NAME" echo -e "Build: RELEASE_TYPE=$RELEASE_NAME"
WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$ARCH-$RELEASE_TYPE.zip WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$RELEASE_TYPE.zip
vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx
xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx
MAGISK_ZIP=magisk-$MAGISK_VER.zip MAGISK_ZIP=magisk-$MAGISK_VER.zip
@ -433,10 +449,6 @@ if [ "$GAPPS_BRAND" != 'none' ]; then
rm -rf "${WORK_DIR:?}"/gapps/system || abort rm -rf "${WORK_DIR:?}"/gapps/system || abort
fi fi
cp -r ../"$ARCH"/gapps/* "$WORK_DIR"/gapps || abort cp -r ../"$ARCH"/gapps/* "$WORK_DIR"/gapps || abort
if [ "$GAPPS_BRAND" = "MindTheGapps" ]; then
mv "$WORK_DIR"/gapps/priv-app/* "$WORK_DIR"/gapps/system_ext/priv-app || abort
rm -rf "${WORK_DIR:?}"/gapps/priv-app || abort
fi
else else
echo "The $GAPPS_BRAND zip package does not exist." echo "The $GAPPS_BRAND zip package does not exist."
abort abort
@ -674,10 +686,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 {} \;

View File

@ -91,7 +91,7 @@ for i, v, f in identities:
# out_file_name = f"Microsoft.VCLibs.140.00.UWPDesktop_{arch}.appx" # out_file_name = f"Microsoft.VCLibs.140.00.UWPDesktop_{arch}.appx"
# out_file = download_dir / out_file_name # out_file = download_dir / out_file_name
elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f): elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f):
out_file_name = f"wsa-{arch}-{release_type}.zip" out_file_name = f"wsa-{release_type}.zip"
out_file = download_dir / out_file_name out_file = download_dir / out_file_name
else: else:
continue continue