WSA + crt netfree + netspark
-
כרגע פרוייקט גיטאהב הראשי https://github.com/LSPosed/MagiskOnWSALocal
משתמש לבניית הWSA בקוד הבא#!/bin/bash # # This file is part of MagiskOnWSALocal. # # MagiskOnWSALocal is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # MagiskOnWSALocal is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with MagiskOnWSALocal. If not, see <https://www.gnu.org/licenses/>. # # Copyright (C) 2023 LSPosed Contributors # if [ ! "$BASH_VERSION" ]; then echo "Please do not use sh to run this script, just execute it directly" 1>&2 exit 1 fi HOST_ARCH=$(uname -m) if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then echo "Unsupported architectures: $HOST_ARCH" exit 1 fi cd "$(dirname "$0")" || exit 1 # export TMPDIR=$(dirname "$PWD")/WORK_DIR_ if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR" fi WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1 MOUNT_DIR="$WORK_DIR"/system SUDO="$(which sudo 2>/dev/null)" if [ -z "$SUDO" ]; then unset SUDO fi DOWNLOAD_DIR=../download DOWNLOAD_CONF_NAME=download.list umount_clean() { if [ -d "$MOUNT_DIR" ]; then echo "Cleanup Mount Directory" if [ -d "$MOUNT_DIR/vendor" ]; then $SUDO umount -v "$MOUNT_DIR"/vendor fi if [ -d "$MOUNT_DIR/product" ]; then $SUDO umount -v "$MOUNT_DIR"/product fi if [ -d "$MOUNT_DIR/system_ext" ]; then $SUDO umount -v "$MOUNT_DIR"/system_ext fi $SUDO umount -v "$MOUNT_DIR" $SUDO rm -rf "${WORK_DIR:?}" else rm -rf "${WORK_DIR:?}" fi if [ "$TMPDIR" ] && [ -d "$TMPDIR" ]; then echo "Cleanup Temp Directory" rm -rf "${TMPDIR:?}" unset TMPDIR fi rm -f "${DOWNLOAD_DIR:?}/$DOWNLOAD_CONF_NAME" } trap umount_clean EXIT OUTPUT_DIR=../output WSA_WORK_ENV="${WORK_DIR:?}"/ENV if [ -f "$WSA_WORK_ENV" ]; then rm -f "${WSA_WORK_ENV:?}"; fi touch "$WSA_WORK_ENV" export WSA_WORK_ENV clean_download() { if [ -d "$DOWNLOAD_DIR" ]; then echo "Cleanup Download Directory" if [ "$CLEAN_DOWNLOAD_WSA" ]; then rm -f "${WSA_ZIP_PATH:?}" fi if [ "$CLEAN_DOWNLOAD_MAGISK" ]; then rm -f "${MAGISK_PATH:?}" fi if [ "$CLEAN_DOWNLOAD_GAPPS" ]; then rm -f "${GAPPS_PATH:?}" fi fi } abort() { echo "Build: an error has occurred, exit" if [ -d "$WORK_DIR" ]; then echo -e "\nCleanup Work Directory" umount_clean fi clean_download exit 1 } trap abort INT TERM Gen_Rand_Str() { head /dev/urandom | tr -dc '[:lower:]' | head -c"$1" } default() { ARCH=x64 RELEASE_TYPE=retail MAGISK_VER=stable GAPPS_BRAND=MindTheGapps GAPPS_VARIANT=pico ROOT_SOL=magisk } exit_with_message() { echo "ERROR: $1" usage exit 1 } ARCH_MAP=( "x64" "arm64" ) RELEASE_TYPE_MAP=( "retail" "RP" "WIS" "WIF" ) MAGISK_VER_MAP=( "stable" "beta" "canary" "debug" "release" ) GAPPS_BRAND_MAP=( "OpenGApps" "MindTheGapps" "none" ) GAPPS_VARIANT_MAP=( "super" "stock" "full" "mini" "micro" "nano" "pico" "tvstock" "tvmini" ) ROOT_SOL_MAP=( "magisk" "none" ) COMPRESS_FORMAT_MAP=( "7z" "xz" "zip" ) ARR_TO_STR() { local arr=("$@") local joined 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 -e " Usage: --arch Architecture of WSA. Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}") Default: $ARCH --release-type Release type of WSA. RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast. Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}") Default: $RELEASE_TYPE --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 --compress-format Compress format of output file. If this option is not specified and --compress is not specified, the generated file will not be compressed Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}") Additional Options: --remove-amazon Remove Amazon Appstore from the system --compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format --offline Build WSA offline --magisk-custom Install custom Magisk --skip-download-wsa Skip download WSA --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 OpenGApps --nofix-props ./build.sh --release-type WIS --gapps-brand none ./build.sh --offline --gapps-variant pico --magisk-custom " } ARGUMENT_LIST=( "arch:" "release-type:" "magisk-ver:" "gapps-brand:" "gapps-variant:" "nofix-props" "root-sol:" "compress-format:" "remove-amazon" "compress" "offline" "magisk-custom" "debug" "help" "skip-download-wsa" ) default opts=$( getopt \ --longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \ --name "$(basename "$0")" \ --options "" \ -- "$@" ) || exit_with_message "Failed to parse options, please check your input" eval set --"$opts" while [[ $# -gt 0 ]]; do case "$1" in --arch ) ARCH="$2"; shift 2 ;; --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="yes"; shift ;; --compress ) COMPRESS_OUTPUT="yes"; shift ;; --offline ) OFFLINE="on"; shift ;; --magisk-custom ) CUSTOM_MAGISK="debug"; shift ;; --magisk-ver ) MAGISK_VER="$2"; shift 2 ;; --debug ) DEBUG="on"; shift ;; --skip-download-wsa ) DOWN_WSA="no"; shift ;; --help ) usage; exit 0 ;; -- ) shift; break;; esac done if [ "$CUSTOM_MAGISK" ]; then if [ -z "$MAGISK_VER" ]; then MAGISK_VER=$CUSTOM_MAGISK fi fi check_list() { local input=$1 if [ -n "$input" ]; then local name=$2 shift local arr=("$@") local list_count=${#arr[@]} for i in "${arr[@]}"; do if [ "$input" == "$i" ]; then echo "INFO: $name: $input" break fi ((list_count--)) if (("$list_count" <= 0)); then exit_with_message "Invalid $name: $input" fi done fi } check_list "$ARCH" "Architecture" "${ARCH_MAP[@]}" check_list "$RELEASE_TYPE" "Release Type" "${RELEASE_TYPE_MAP[@]}" check_list "$MAGISK_VER" "Magisk Version" "${MAGISK_VER_MAP[@]}" check_list "$GAPPS_BRAND" "GApps Brand" "${GAPPS_BRAND_MAP[@]}" check_list "$GAPPS_VARIANT" "GApps Variant" "${GAPPS_VARIANT_MAP[@]}" check_list "$ROOT_SOL" "Root Solution" "${ROOT_SOL_MAP[@]}" check_list "$COMPRESS_FORMAT" "Compress Format" "${COMPRESS_FORMAT_MAP[@]}" if [ "$DEBUG" ]; then set -x fi require_su() { if test "$(id -u)" != "0"; then if [ -z "$SUDO" ] || [ "$($SUDO id -u)" != "0" ]; then echo "ROOT/SUDO is required to run this script" abort fi fi } declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast") declare -A ANDROID_API_MAP=(["30"]="11.0" ["32"]="12.1" ["33"]="13.0") RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort echo -e "Build: RELEASE_TYPE=$RELEASE_NAME" WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$RELEASE_TYPE.zip vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx MAGISK_ZIP=magisk-$MAGISK_VER.zip MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP if [ "$CUSTOM_MAGISK" ]; then if [ ! -f "$MAGISK_PATH" ]; then echo "Custom Magisk $MAGISK_ZIP not found" MAGISK_ZIP=app-$MAGISK_VER.apk echo "Fallback to $MAGISK_ZIP" MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP if [ ! -f "$MAGISK_PATH" ]; then echo -e "Custom Magisk $MAGISK_ZIP not found\nPlease put custom Magisk in $DOWNLOAD_DIR" abort fi fi fi ANDROID_API=33 update_gapps_zip_name() { if [ "$GAPPS_BRAND" = "OpenGApps" ]; then ANDROID_API=30 GAPPS_ZIP_NAME="$GAPPS_BRAND-$ARCH-${ANDROID_API_MAP[$ANDROID_API]}-$GAPPS_VARIANT".zip else GAPPS_ZIP_NAME="$GAPPS_BRAND-$ARCH-${ANDROID_API_MAP[$ANDROID_API]}".zip fi GAPPS_PATH=$DOWNLOAD_DIR/$GAPPS_ZIP_NAME } update_gapps_zip_name if [ -z "${OFFLINE+x}" ]; then require_su if [ "${DOWN_WSA}" != "no" ]; then echo "Generate Download Links" python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort else DOWN_WSA_MAIN_VERSION=$(python3 getWSAMainVersion.py "$ARCH" "$WSA_ZIP_PATH") fi if [[ "$DOWN_WSA_MAIN_VERSION" -lt 2211 ]]; then ANDROID_API=32 update_gapps_zip_name fi if [ -z "${CUSTOM_MAGISK+x}" ]; then python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort fi if [ "$GAPPS_BRAND" != "none" ]; then python3 generateGappsLink.py "$ARCH" "$GAPPS_BRAND" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" "$ANDROID_API" "$GAPPS_ZIP_NAME" || abort 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 --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 else # Offline mode DOWN_WSA_MAIN_VERSION=$(python3 getWSAMainVersion.py "$ARCH" "$WSA_ZIP_PATH") if [[ "$DOWN_WSA_MAIN_VERSION" -lt 2211 ]]; then ANDROID_API=32 update_gapps_zip_name fi declare -A FILES_CHECK_LIST=([WSA_ZIP_PATH]="$WSA_ZIP_PATH" [xaml_PATH]="$xaml_PATH" [vclibs_PATH]="$vclibs_PATH" [MAGISK_PATH]="$MAGISK_PATH") for i in "${FILES_CHECK_LIST[@]}"; do if [ ! -f "$i" ]; then echo "Offline mode: missing [$i]." OFFLINE_ERR="1" fi done if [ "$GAPPS_BRAND" != 'none' ]; then if [ ! -f "$GAPPS_PATH" ]; then echo "Offline mode: missing [$GAPPS_PATH]." OFFLINE_ERR="1" fi fi if [ "$OFFLINE_ERR" ]; then echo "Offline mode: Some files are missing, please disable offline mode." exit 1 fi require_su fi echo "Extract WSA" if [ -f "$WSA_ZIP_PATH" ]; then if ! python3 extractWSA.py "$ARCH" "$WSA_ZIP_PATH" "$WORK_DIR"; then echo "Unzip WSA failed, is the download incomplete?" CLEAN_DOWNLOAD_WSA=1 abort fi echo -e "Extract done\n" # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort else echo "The WSA zip package does not exist, is the download incomplete?" exit 1 fi echo "Extract Magisk" if [ -f "$MAGISK_PATH" ]; then MAGISK_VERSION_NAME="" MAGISK_VERSION_CODE=0 if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then echo "Unzip Magisk failed, is the download incomplete?" CLEAN_DOWNLOAD_MAGISK=1 abort fi # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO chmod +x "../linker/$HOST_ARCH/linker64" || abort $SUDO patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort elif [ -z "${CUSTOM_MAGISK+x}" ]; then echo "The Magisk zip package does not exist, is the download incomplete?" exit 1 else echo "The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder." exit 1 fi echo -e "done\n" if [ "$GAPPS_BRAND" != 'none' ]; then echo "Extract $GAPPS_BRAND" mkdir -p "$WORK_DIR"/gapps || abort if [ -f "$GAPPS_PATH" ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then if ! unzip -p "$GAPPS_PATH" {Core,GApps}/'*.lz' | tar --lzip -C "$WORK_DIR"/gapps -xf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' --exclude='packageinstallergoogle-all' --exclude='speech-common' --exclude='markup-lib-arm' --exclude='markup-lib-arm64' --exclude='markup-all' --exclude='setupwizarddefault-x86_64' --exclude='pixellauncher-all' --exclude='pixellauncher-common'; then echo "Unzip OpenGApps failed, is the download incomplete?" CLEAN_DOWNLOAD_GAPPS=1 abort fi else if ! unzip "$GAPPS_PATH" "system/*" -x "system/addon.d/*" "system/system_ext/priv-app/SetupWizard/*" -d "$WORK_DIR"/gapps; then echo "Unzip MindTheGapps failed, package is corrupted?" CLEAN_DOWNLOAD_GAPPS=1 abort fi mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort rm -rf "${WORK_DIR:?}"/gapps/system || abort fi cp -r ../"$ARCH"/gapps/* "$WORK_DIR"/gapps || abort else echo "The $GAPPS_BRAND zip package does not exist." abort fi echo -e "Extract done\n" fi echo "Expand images" if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$SYSTEM_EXT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort PRODUCT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/product.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/product ]; then PRODUCT_SIZE=$(( PRODUCT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort SYSTEM_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps | cut -f1) - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) fi if [ -f "$MAGISK_PATH" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) )) fi if [ -d "../$ARCH/system" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort VENDOR_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/vendor.img | cut -f1) + 20000)) resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort echo -e "Expand images done\n" echo "Mount images" $SUDO mkdir "$MOUNT_DIR" || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$MOUNT_DIR"/system_ext || abort echo -e "done\n" if [ "$REMOVE_AMAZON" ]; then echo "Remove Amazon Appstore" find "${MOUNT_DIR:?}"/product/{etc/permissions,etc/sysconfig,framework,priv-app} 2>/dev/null | grep -e amazon -e venezia | $SUDO xargs rm -rf find "${MOUNT_DIR:?}"/system_ext/{etc/*permissions,framework,priv-app} 2>/dev/null | grep -e amazon -e venezia | $SUDO xargs rm -rf echo -e "done\n" fi echo "Add device administration features" $SUDO sed -i -e '/cts/a \ \ \ \ <feature name="android.software.device_admin" />' -e '/print/i \ \ \ \ <feature name="android.software.managed_users" />' "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml $SUDO setfattr -n security.selinux -v "u:object_r:vendor_configs_file:s0" "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml || abort echo -e "done\n" if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then echo "Integrate Magisk" $SUDO mkdir "$MOUNT_DIR"/sbin $SUDO setfattr -n security.selinux -v "u:object_r:rootfs:s0" "$MOUNT_DIR"/sbin || abort $SUDO chown root:root "$MOUNT_DIR"/sbin $SUDO chmod 0700 "$MOUNT_DIR"/sbin $SUDO cp "$WORK_DIR"/magisk/magisk/* "$MOUNT_DIR"/sbin/ $SUDO cp "$MAGISK_PATH" "$MOUNT_DIR"/sbin/magisk.apk $SUDO tee -a "$MOUNT_DIR"/sbin/loadpolicy.sh <<EOF >/dev/null #!/system/bin/sh mkdir -p /data/adb/magisk cp /sbin/* /data/adb/magisk/ sync chmod -R 755 /data/adb/magisk restorecon -R /data/adb/magisk for module in \$(ls /data/adb/modules); do if ! [ -f "/data/adb/modules/\$module/disable" ] && [ -f "/data/adb/modules/\$module/sepolicy.rule" ]; then /sbin/magiskpolicy --live --apply "/data/adb/modules/\$module/sepolicy.rule" fi done EOF $SUDO find "$MOUNT_DIR"/sbin -type f -exec chmod 0755 {} \; $SUDO find "$MOUNT_DIR"/sbin -type f -exec chown root:root {} \; $SUDO find "$MOUNT_DIR"/sbin -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort TMP_PATH=$(Gen_Rand_Str 8) echo "/dev/$TMP_PATH(/.*)? u:object_r:magisk_file:s0" | $SUDO tee -a "$MOUNT_DIR"/vendor/etc/selinux/vendor_file_contexts echo '/data/adb/magisk(/.*)? u:object_r:magisk_file:s0' | $SUDO tee -a "$MOUNT_DIR"/vendor/etc/selinux/vendor_file_contexts $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --magisk "allow * magisk_file lnk_file *" || abort LOAD_POLICY_SVC_NAME=$(Gen_Rand_Str 12) PFD_SVC_NAME=$(Gen_Rand_Str 12) LS_SVC_NAME=$(Gen_Rand_Str 12) $SUDO tee -a "$MOUNT_DIR"/system/etc/init/hw/init.rc <<EOF >/dev/null on post-fs-data start adbd mkdir /dev/$TMP_PATH mount tmpfs tmpfs /dev/$TMP_PATH mode=0755 copy /sbin/magisk64 /dev/$TMP_PATH/magisk64 chmod 0755 /dev/$TMP_PATH/magisk64 symlink ./magisk64 /dev/$TMP_PATH/magisk symlink ./magisk64 /dev/$TMP_PATH/su symlink ./magisk64 /dev/$TMP_PATH/resetprop copy /sbin/magisk32 /dev/$TMP_PATH/magisk32 chmod 0755 /dev/$TMP_PATH/magisk32 copy /sbin/magiskinit /dev/$TMP_PATH/magiskinit chmod 0755 /dev/$TMP_PATH/magiskinit copy /sbin/magiskpolicy /dev/$TMP_PATH/magiskpolicy chmod 0755 /dev/$TMP_PATH/magiskpolicy mkdir /dev/$TMP_PATH/.magisk 700 mkdir /dev/$TMP_PATH/.magisk/mirror 700 mkdir /dev/$TMP_PATH/.magisk/block 700 copy /sbin/magisk.apk /dev/$TMP_PATH/stub.apk chmod 0644 /dev/$TMP_PATH/stub.apk rm /dev/.magisk_unblock exec_start $LOAD_POLICY_SVC_NAME start $PFD_SVC_NAME wait /dev/.magisk_unblock 40 rm /dev/.magisk_unblock service $LOAD_POLICY_SVC_NAME /system/bin/sh /sbin/loadpolicy.sh user root seclabel u:r:magisk:s0 oneshot service $PFD_SVC_NAME /dev/$TMP_PATH/magisk --post-fs-data user root seclabel u:r:magisk:s0 oneshot service $LS_SVC_NAME /dev/$TMP_PATH/magisk --service class late_start user root seclabel u:r:magisk:s0 oneshot on property:sys.boot_completed=1 mkdir /data/adb/magisk 755 copy /sbin/magisk.apk /data/adb/magisk/magisk.apk exec /dev/$TMP_PATH/magisk --boot-complete on property:init.svc.zygote=restarting exec /dev/$TMP_PATH/magisk --zygote-restart on property:init.svc.zygote=stopped exec /dev/$TMP_PATH/magisk --zygote-restart EOF echo -e "Integrate Magisk done\n" fi cp "$WORK_DIR/wsa/$ARCH/resources.pri" "$WORK_DIR"/wsa/pri/en-us.pri \ && cp "$WORK_DIR/wsa/$ARCH/AppxManifest.xml" "$WORK_DIR"/wsa/xml/en-us.xml && { echo "Merge Language Resources" tee "$WORK_DIR"/wsa/priconfig.xml <<EOF >/dev/null <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resources targetOsVersion="10.0.0" majorVersion="1"> <index root="\" startIndexAt="\"> <indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/> <indexer-config type="PRI"/> </index> </resources> EOF if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then ../wine/"$HOST_ARCH"/makepri.exe new /pr "$(wslpath -w "$WORK_DIR"/wsa/pri)" /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$(wslpath -w "$WORK_DIR"/wsa/priconfig.xml)" /of "$(wslpath -w "$WORK_DIR"/wsa/"$ARCH"/resources.pri)" /o elif which wine64 > /dev/null; then wine64 ../wine/"$HOST_ARCH"/makepri.exe new /pr "$WORK_DIR"/wsa/pri /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$WORK_DIR"/wsa/priconfig.xml /of "$WORK_DIR"/wsa/"$ARCH"/resources.pri /o else res_merge_failed=1 fi [ -z "$res_merge_failed" ] && sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR"/wsa/"$ARCH"/AppxManifest.xml && \ echo -e "Merge Language Resources done\n" } && [ -n "$res_merge_failed" ] && echo -e "Merge Language Resources failed\n" && unset res_merge_failed echo "Add extra packages" $SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages done\n" if [ "$GAPPS_BRAND" != 'none' ]; then echo "Integrate $GAPPS_BRAND" find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chmod 0755 {} \; find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chown root:root {} \; file_list="$(find "$WORK_DIR/gapps/" -mindepth 1 -type f | cut -d/ -f5-)" for file in $file_list; do $SUDO chown root:root "$WORK_DIR/gapps/${file}" $SUDO chmod 0644 "$WORK_DIR/gapps/${file}" done if [ "$GAPPS_BRAND" = "OpenGApps" ]; then find "$WORK_DIR"/gapps/ -maxdepth 1 -mindepth 1 -type d -not -path '*product' -exec $SUDO cp --preserve=all -r {} "$MOUNT_DIR"/system \; || abort elif [ "$GAPPS_BRAND" = "MindTheGapps" ]; then $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/system_ext/* "$MOUNT_DIR"/system_ext/ || abort if [ -e "$MOUNT_DIR"/system_ext/priv-app/SetupWizard ]; then rm -rf "${MOUNT_DIR:?}/system_ext/priv-app/Provision" fi fi $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/product/* "$MOUNT_DIR"/product || abort find "$WORK_DIR"/gapps/product/overlay -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/overlay/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:vendor_overlay_file:s0" {} \; || abort if [ "$GAPPS_BRAND" = "OpenGApps" ]; then find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort else find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort $SUDO setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" "$MOUNT_DIR"/product/lib || abort find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib64/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort fi $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" "allow gmscore_app system_server_tmpfs dir search" "allow gmscore_app system_server_tmpfs file open" "allow gmscore_app system_server_tmpfs filesystem getattr" "allow gmscore_app gpu_device dir search" || abort echo -e "Integrate $GAPPS_BRAND done\n" fi 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" $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort echo -e "done\n" fi fi echo "Umount images" $SUDO find "$MOUNT_DIR" -exec touch -ht 200901010000.00 {} \; $SUDO umount -v "$MOUNT_DIR"/vendor $SUDO umount -v "$MOUNT_DIR"/product $SUDO umount -v "$MOUNT_DIR"/system_ext $SUDO umount -v "$MOUNT_DIR" echo -e "done\n" echo "Shrink images" e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/product.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort echo -e "Shrink images done\n" echo "Remove signature and add scripts" $SUDO rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR"/wsa/"$ARCH"/AppxBlockMap.xml "$WORK_DIR"/wsa/"$ARCH"/AppxSignature.p7x "$WORK_DIR"/wsa/"$ARCH"/AppxMetadata || abort cp "$vclibs_PATH" "$xaml_PATH" "$WORK_DIR"/wsa/"$ARCH" || abort cp ../installer/Install.ps1 "$WORK_DIR"/wsa/"$ARCH" || abort cp ../installer/Run.bat "$WORK_DIR"/wsa/"$ARCH" || abort find "$WORK_DIR"/wsa/"$ARCH" -maxdepth 1 -mindepth 1 -printf "%P\n" > "$WORK_DIR"/wsa/"$ARCH"/filelist.txt || abort echo -e "Remove signature and add scripts done\n" echo "Generate info" if [[ "$ROOT_SOL" = "none" ]]; then name1="" elif [ "$ROOT_SOL" = "" ] || [ "$ROOT_SOL" = "magisk" ]; then name1="-with-magisk-$MAGISK_VERSION_NAME($MAGISK_VERSION_CODE)-$MAGISK_VER" else name1="-with-$ROOT_SOL-$MAGISK_VER" fi if [ "$GAPPS_BRAND" = "none" ]; then name2="-NoGApps" else if [ "$GAPPS_BRAND" = "OpenGApps" ]; then name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}-${GAPPS_VARIANT}" else name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}" fi if [ "$GAPPS_BRAND" = "OpenGApps" ]; then echo -e "\033[0;31m:warning: Since $GAPPS_BRAND doesn't officially support Android 12.1 and 13 yet, lock the variant to pico! $GAPPS_BRAND may cause startup failure \033[0m" fi fi artifact_name="WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2}" if [ "$NOFIX_PROPS" = "yes" ]; then artifact_name+="-NoFixProps" fi if [ "$REMOVE_AMAZON" = "yes" ]; then artifact_name+="-RemovedAmazon" fi echo "$artifact_name" echo -e "\nFinishing building...." if [ -f "$OUTPUT_DIR" ]; then $SUDO rm -rf "${OUTPUT_DIR:?}" fi if [ ! -d "$OUTPUT_DIR" ]; then mkdir -p "$OUTPUT_DIR" fi OUTPUT_PATH="${OUTPUT_DIR:?}/$artifact_name" if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name" if [ -z "$COMPRESS_FORMAT" ]; then COMPRESS_FORMAT="7z" fi if [ -n "$COMPRESS_FORMAT" ]; then FILE_EXT=".$COMPRESS_FORMAT" if [ "$FILE_EXT" = ".xz" ]; then FILE_EXT=".tar$FILE_EXT" fi OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT" fi rm -f "${OUTPUT_PATH:?}" || abort if [ "$COMPRESS_FORMAT" = "7z" ]; then echo "Compressing with 7z" 7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort elif [ "$COMPRESS_FORMAT" = "xz" ]; then echo "Compressing with tar xz" if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name"); then echo "Out of memory? Trying again with single threads..." tar -cPJvf "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi elif [ "$COMPRESS_FORMAT" = "zip" ]; then 7z -tzip a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi else rm -rf "${OUTPUT_PATH:?}" || abort cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_PATH" || abort fi echo -e "done\n" echo "Cleanup Work Directory" $SUDO rm -rf "${WORK_DIR:?}" echo "done"
-
ואילו אני בקוד הזה
#!/bin/bash # # This file is part of MagiskOnWSALocal. # # MagiskOnWSALocal is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # MagiskOnWSALocal is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with MagiskOnWSALocal. If not, see <https://www.gnu.org/licenses/>. # # Copyright (C) 2023 LSPosed Contributors # if [ ! "$BASH_VERSION" ]; then echo "Please do not use sh to run this script, just execute it directly" 1>&2 exit 1 fi HOST_ARCH=$(uname -m) if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then echo "Unsupported architectures: $HOST_ARCH" exit 1 fi cd "$(dirname "$0")" || exit 1 # export TMPDIR=$(dirname "$PWD")/WORK_DIR_ if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR" fi WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1 MOUNT_DIR="$WORK_DIR"/system SUDO="$(which sudo 2>/dev/null)" if [ -z "$SUDO" ]; then unset SUDO fi DOWNLOAD_DIR=../download DOWNLOAD_CONF_NAME=download.list umount_clean() { if [ -d "$MOUNT_DIR" ]; then echo "Cleanup Mount Directory" if [ -d "$MOUNT_DIR/vendor" ]; then $SUDO umount -v "$MOUNT_DIR"/vendor fi if [ -d "$MOUNT_DIR/product" ]; then $SUDO umount -v "$MOUNT_DIR"/product fi if [ -d "$MOUNT_DIR/system_ext" ]; then $SUDO umount -v "$MOUNT_DIR"/system_ext fi $SUDO umount -v "$MOUNT_DIR" $SUDO rm -rf "${WORK_DIR:?}" else rm -rf "${WORK_DIR:?}" fi if [ "$TMPDIR" ] && [ -d "$TMPDIR" ]; then echo "Cleanup Temp Directory" rm -rf "${TMPDIR:?}" unset TMPDIR fi rm -f "${DOWNLOAD_DIR:?}/$DOWNLOAD_CONF_NAME" } trap umount_clean EXIT OUTPUT_DIR=../output WSA_WORK_ENV="${WORK_DIR:?}"/ENV if [ -f "$WSA_WORK_ENV" ]; then rm -f "${WSA_WORK_ENV:?}"; fi touch "$WSA_WORK_ENV" export WSA_WORK_ENV clean_download() { if [ -d "$DOWNLOAD_DIR" ]; then echo "Cleanup Download Directory" if [ "$CLEAN_DOWNLOAD_WSA" ]; then rm -f "${WSA_ZIP_PATH:?}" fi if [ "$CLEAN_DOWNLOAD_MAGISK" ]; then rm -f "${MAGISK_PATH:?}" fi if [ "$CLEAN_DOWNLOAD_GAPPS" ]; then rm -f "${GAPPS_PATH:?}" fi fi } abort() { echo "Build: an error has occurred, exit" if [ -d "$WORK_DIR" ]; then echo -e "\nCleanup Work Directory" umount_clean fi clean_download exit 1 } trap abort INT TERM Gen_Rand_Str() { head /dev/urandom | tr -dc '[:lower:]' | head -c"$1" } default() { ARCH=x64 RELEASE_TYPE=retail MAGISK_VER=stable GAPPS_BRAND=MindTheGapps GAPPS_VARIANT=pico ROOT_SOL=magisk } exit_with_message() { echo "ERROR: $1" usage exit 1 } ARCH_MAP=( "x64" "arm64" ) RELEASE_TYPE_MAP=( "retail" "RP" "WIS" "WIF" ) MAGISK_VER_MAP=( "stable" "beta" "canary" "debug" "release" ) GAPPS_BRAND_MAP=( "OpenGApps" "MindTheGapps" "none" ) GAPPS_VARIANT_MAP=( "super" "stock" "full" "mini" "micro" "nano" "pico" "tvstock" "tvmini" ) ROOT_SOL_MAP=( "magisk" "none" ) COMPRESS_FORMAT_MAP=( "7z" "xz" "zip" ) ARR_TO_STR() { local arr=("$@") local joined 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 -e " Usage: --arch Architecture of WSA. Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}") Default: $ARCH --release-type Release type of WSA. RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast. Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}") Default: $RELEASE_TYPE --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 --compress-format Compress format of output file. If this option is not specified and --compress is not specified, the generated file will not be compressed Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}") Additional Options: --remove-amazon Remove Amazon Appstore from the system --compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format --offline Build WSA offline --magisk-custom Install custom Magisk --skip-download-wsa Skip download WSA --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 OpenGApps --nofix-props ./build.sh --release-type WIS --gapps-brand none ./build.sh --offline --gapps-variant pico --magisk-custom " } ARGUMENT_LIST=( "arch:" "release-type:" "magisk-ver:" "gapps-brand:" "gapps-variant:" "nofix-props" "root-sol:" "compress-format:" "remove-amazon" "compress" "offline" "magisk-custom" "debug" "help" "skip-download-wsa" ) default opts=$( getopt \ --longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \ --name "$(basename "$0")" \ --options "" \ -- "$@" ) || exit_with_message "Failed to parse options, please check your input" eval set --"$opts" while [[ $# -gt 0 ]]; do case "$1" in --arch ) ARCH="$2"; shift 2 ;; --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="yes"; shift ;; --compress ) COMPRESS_OUTPUT="yes"; shift ;; --offline ) OFFLINE="on"; shift ;; --magisk-custom ) CUSTOM_MAGISK="debug"; shift ;; --magisk-ver ) MAGISK_VER="$2"; shift 2 ;; --debug ) DEBUG="on"; shift ;; --skip-download-wsa ) DOWN_WSA="no"; shift ;; --help ) usage; exit 0 ;; -- ) shift; break;; esac done if [ "$CUSTOM_MAGISK" ]; then if [ -z "$MAGISK_VER" ]; then MAGISK_VER=$CUSTOM_MAGISK fi fi check_list() { local input=$1 if [ -n "$input" ]; then local name=$2 shift local arr=("$@") local list_count=${#arr[@]} for i in "${arr[@]}"; do if [ "$input" == "$i" ]; then echo "INFO: $name: $input" break fi ((list_count--)) if (("$list_count" <= 0)); then exit_with_message "Invalid $name: $input" fi done fi } check_list "$ARCH" "Architecture" "${ARCH_MAP[@]}" check_list "$RELEASE_TYPE" "Release Type" "${RELEASE_TYPE_MAP[@]}" check_list "$MAGISK_VER" "Magisk Version" "${MAGISK_VER_MAP[@]}" check_list "$GAPPS_BRAND" "GApps Brand" "${GAPPS_BRAND_MAP[@]}" check_list "$GAPPS_VARIANT" "GApps Variant" "${GAPPS_VARIANT_MAP[@]}" check_list "$ROOT_SOL" "Root Solution" "${ROOT_SOL_MAP[@]}" check_list "$COMPRESS_FORMAT" "Compress Format" "${COMPRESS_FORMAT_MAP[@]}" if [ "$DEBUG" ]; then set -x fi require_su() { if test "$(id -u)" != "0"; then if [ -z "$SUDO" ] || [ "$($SUDO id -u)" != "0" ]; then echo "ROOT/SUDO is required to run this script" abort fi fi } declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast") declare -A ANDROID_API_MAP=(["30"]="11.0" ["32"]="12.1" ["33"]="13.0") RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort echo -e "Build: RELEASE_TYPE=$RELEASE_NAME" WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$RELEASE_TYPE.zip vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx MAGISK_ZIP=magisk-$MAGISK_VER.zip MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP if [ "$CUSTOM_MAGISK" ]; then if [ ! -f "$MAGISK_PATH" ]; then echo "Custom Magisk $MAGISK_ZIP not found" MAGISK_ZIP=app-$MAGISK_VER.apk echo "Fallback to $MAGISK_ZIP" MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP if [ ! -f "$MAGISK_PATH" ]; then echo -e "Custom Magisk $MAGISK_ZIP not found\nPlease put custom Magisk in $DOWNLOAD_DIR" abort fi fi fi ANDROID_API=33 update_gapps_zip_name() { if [ "$GAPPS_BRAND" = "OpenGApps" ]; then ANDROID_API=30 GAPPS_ZIP_NAME="$GAPPS_BRAND-$ARCH-${ANDROID_API_MAP[$ANDROID_API]}-$GAPPS_VARIANT".zip else GAPPS_ZIP_NAME="$GAPPS_BRAND-$ARCH-${ANDROID_API_MAP[$ANDROID_API]}".zip fi GAPPS_PATH=$DOWNLOAD_DIR/$GAPPS_ZIP_NAME } update_gapps_zip_name if [ -z "${OFFLINE+x}" ]; then require_su if [ "${DOWN_WSA}" != "no" ]; then echo "Generate Download Links" python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort else DOWN_WSA_MAIN_VERSION=$(python3 getWSAMainVersion.py "$ARCH" "$WSA_ZIP_PATH") fi if [[ "$DOWN_WSA_MAIN_VERSION" -lt 2211 ]]; then ANDROID_API=32 update_gapps_zip_name fi if [ -z "${CUSTOM_MAGISK+x}" ]; then python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort fi if [ "$GAPPS_BRAND" != "none" ]; then python3 generateGappsLink.py "$ARCH" "$GAPPS_BRAND" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" "$ANDROID_API" "$GAPPS_ZIP_NAME" || abort 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 --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 else # Offline mode DOWN_WSA_MAIN_VERSION=$(python3 getWSAMainVersion.py "$ARCH" "$WSA_ZIP_PATH") if [[ "$DOWN_WSA_MAIN_VERSION" -lt 2211 ]]; then ANDROID_API=32 update_gapps_zip_name fi declare -A FILES_CHECK_LIST=([WSA_ZIP_PATH]="$WSA_ZIP_PATH" [xaml_PATH]="$xaml_PATH" [vclibs_PATH]="$vclibs_PATH" [MAGISK_PATH]="$MAGISK_PATH") for i in "${FILES_CHECK_LIST[@]}"; do if [ ! -f "$i" ]; then echo "Offline mode: missing [$i]." OFFLINE_ERR="1" fi done if [ "$GAPPS_BRAND" != 'none' ]; then if [ ! -f "$GAPPS_PATH" ]; then echo "Offline mode: missing [$GAPPS_PATH]." OFFLINE_ERR="1" fi fi if [ "$OFFLINE_ERR" ]; then echo "Offline mode: Some files are missing, please disable offline mode." exit 1 fi require_su fi echo "Extract WSA" if [ -f "$WSA_ZIP_PATH" ]; then if ! python3 extractWSA.py "$ARCH" "$WSA_ZIP_PATH" "$WORK_DIR"; then echo "Unzip WSA failed, is the download incomplete?" CLEAN_DOWNLOAD_WSA=1 abort fi echo -e "Extract done\n" # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort else echo "The WSA zip package does not exist, is the download incomplete?" exit 1 fi echo "Extract Magisk" if [ -f "$MAGISK_PATH" ]; then MAGISK_VERSION_NAME="" MAGISK_VERSION_CODE=0 if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then echo "Unzip Magisk failed, is the download incomplete?" CLEAN_DOWNLOAD_MAGISK=1 abort fi # shellcheck disable=SC1091 source "${WORK_DIR:?}/ENV" || abort $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO chmod +x "../linker/$HOST_ARCH/linker64" || abort $SUDO patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort elif [ -z "${CUSTOM_MAGISK+x}" ]; then echo "The Magisk zip package does not exist, is the download incomplete?" exit 1 else echo "The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder." exit 1 fi echo -e "done\n" if [ "$GAPPS_BRAND" != 'none' ]; then echo "Extract $GAPPS_BRAND" mkdir -p "$WORK_DIR"/gapps || abort if [ -f "$GAPPS_PATH" ]; then if [ "$GAPPS_BRAND" = "OpenGApps" ]; then if ! unzip -p "$GAPPS_PATH" {Core,GApps}/'*.lz' | tar --lzip -C "$WORK_DIR"/gapps -xf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' --exclude='packageinstallergoogle-all' --exclude='speech-common' --exclude='markup-lib-arm' --exclude='markup-lib-arm64' --exclude='markup-all' --exclude='setupwizarddefault-x86_64' --exclude='pixellauncher-all' --exclude='pixellauncher-common'; then echo "Unzip OpenGApps failed, is the download incomplete?" CLEAN_DOWNLOAD_GAPPS=1 abort fi else if ! unzip "$GAPPS_PATH" "system/*" -x "system/addon.d/*" "system/system_ext/priv-app/SetupWizard/*" -d "$WORK_DIR"/gapps; then echo "Unzip MindTheGapps failed, package is corrupted?" CLEAN_DOWNLOAD_GAPPS=1 abort fi mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort rm -rf "${WORK_DIR:?}"/gapps/system || abort fi cp -r ../"$ARCH"/gapps/* "$WORK_DIR"/gapps || abort else echo "The $GAPPS_BRAND zip package does not exist." abort fi echo -e "Extract done\n" fi echo "Expand images" if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$SYSTEM_EXT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort PRODUCT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/product.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/product ]; then PRODUCT_SIZE=$(( PRODUCT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort SYSTEM_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps | cut -f1) - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) fi if [ -f "$MAGISK_PATH" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) )) fi if [ -d "../$ARCH/system" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort VENDOR_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/vendor.img | cut -f1) + 20000)) resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort echo -e "Expand images done\n" echo "Mount images" $SUDO mkdir "$MOUNT_DIR" || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort $SUDO mount -vo loop "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$MOUNT_DIR"/system_ext || abort echo -e "done\n" if [ "$REMOVE_AMAZON" ]; then echo "Remove Amazon Appstore" find "${MOUNT_DIR:?}"/product/{etc/permissions,etc/sysconfig,framework,priv-app} 2>/dev/null | grep -e amazon -e venezia | $SUDO xargs rm -rf find "${MOUNT_DIR:?}"/system_ext/{etc/*permissions,framework,priv-app} 2>/dev/null | grep -e amazon -e venezia | $SUDO xargs rm -rf echo -e "done\n" fi echo "Add device administration features" $SUDO sed -i -e '/cts/a \ \ \ \ <feature name="android.software.device_admin" />' -e '/print/i \ \ \ \ <feature name="android.software.managed_users" />' "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml $SUDO setfattr -n security.selinux -v "u:object_r:vendor_configs_file:s0" "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml || abort echo -e "done\n" if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then echo "Integrate Magisk" $SUDO mkdir "$MOUNT_DIR"/sbin $SUDO setfattr -n security.selinux -v "u:object_r:rootfs:s0" "$MOUNT_DIR"/sbin || abort $SUDO chown root:root "$MOUNT_DIR"/sbin $SUDO chmod 0700 "$MOUNT_DIR"/sbin $SUDO cp "$WORK_DIR"/magisk/magisk/* "$MOUNT_DIR"/sbin/ $SUDO cp "$MAGISK_PATH" "$MOUNT_DIR"/sbin/magisk.apk $SUDO tee -a "$MOUNT_DIR"/sbin/loadpolicy.sh <<EOF >/dev/null #!/system/bin/sh mkdir -p /data/adb/magisk cp /sbin/* /data/adb/magisk/ sync chmod -R 755 /data/adb/magisk restorecon -R /data/adb/magisk for module in \$(ls /data/adb/modules); do if ! [ -f "/data/adb/modules/\$module/disable" ] && [ -f "/data/adb/modules/\$module/sepolicy.rule" ]; then /sbin/magiskpolicy --live --apply "/data/adb/modules/\$module/sepolicy.rule" fi done EOF $SUDO find "$MOUNT_DIR"/sbin -type f -exec chmod 0755 {} \; $SUDO find "$MOUNT_DIR"/sbin -type f -exec chown root:root {} \; $SUDO find "$MOUNT_DIR"/sbin -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort TMP_PATH=$(Gen_Rand_Str 8) echo "/dev/$TMP_PATH(/.*)? u:object_r:magisk_file:s0" | $SUDO tee -a "$MOUNT_DIR"/vendor/etc/selinux/vendor_file_contexts echo '/data/adb/magisk(/.*)? u:object_r:magisk_file:s0' | $SUDO tee -a "$MOUNT_DIR"/vendor/etc/selinux/vendor_file_contexts $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --magisk "allow * magisk_file lnk_file *" || abort LOAD_POLICY_SVC_NAME=$(Gen_Rand_Str 12) PFD_SVC_NAME=$(Gen_Rand_Str 12) LS_SVC_NAME=$(Gen_Rand_Str 12) $SUDO tee -a "$MOUNT_DIR"/system/etc/init/hw/init.rc <<EOF >/dev/null on post-fs-data start adbd mkdir /dev/$TMP_PATH mount tmpfs tmpfs /dev/$TMP_PATH mode=0755 copy /sbin/magisk64 /dev/$TMP_PATH/magisk64 chmod 0755 /dev/$TMP_PATH/magisk64 symlink ./magisk64 /dev/$TMP_PATH/magisk symlink ./magisk64 /dev/$TMP_PATH/su symlink ./magisk64 /dev/$TMP_PATH/resetprop copy /sbin/magisk32 /dev/$TMP_PATH/magisk32 chmod 0755 /dev/$TMP_PATH/magisk32 copy /sbin/magiskinit /dev/$TMP_PATH/magiskinit chmod 0755 /dev/$TMP_PATH/magiskinit copy /sbin/magiskpolicy /dev/$TMP_PATH/magiskpolicy chmod 0755 /dev/$TMP_PATH/magiskpolicy mkdir /dev/$TMP_PATH/.magisk 700 mkdir /dev/$TMP_PATH/.magisk/mirror 700 mkdir /dev/$TMP_PATH/.magisk/block 700 copy /sbin/magisk.apk /dev/$TMP_PATH/stub.apk chmod 0644 /dev/$TMP_PATH/stub.apk rm /dev/.magisk_unblock exec_start $LOAD_POLICY_SVC_NAME start $PFD_SVC_NAME wait /dev/.magisk_unblock 40 rm /dev/.magisk_unblock service $LOAD_POLICY_SVC_NAME /system/bin/sh /sbin/loadpolicy.sh user root seclabel u:r:magisk:s0 oneshot service $PFD_SVC_NAME /dev/$TMP_PATH/magisk --post-fs-data user root seclabel u:r:magisk:s0 oneshot service $LS_SVC_NAME /dev/$TMP_PATH/magisk --service class late_start user root seclabel u:r:magisk:s0 oneshot on property:sys.boot_completed=1 mkdir /data/adb/magisk 755 copy /sbin/magisk.apk /data/adb/magisk/magisk.apk exec /dev/$TMP_PATH/magisk --boot-complete on property:init.svc.zygote=restarting exec /dev/$TMP_PATH/magisk --zygote-restart on property:init.svc.zygote=stopped exec /dev/$TMP_PATH/magisk --zygote-restart EOF echo -e "Integrate Magisk done\n" fi cp "$WORK_DIR/wsa/$ARCH/resources.pri" "$WORK_DIR"/wsa/pri/en-us.pri \ && cp "$WORK_DIR/wsa/$ARCH/AppxManifest.xml" "$WORK_DIR"/wsa/xml/en-us.xml && { echo "Merge Language Resources" tee "$WORK_DIR"/wsa/priconfig.xml <<EOF >/dev/null <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resources targetOsVersion="10.0.0" majorVersion="1"> <index root="\" startIndexAt="\"> <indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/> <indexer-config type="PRI"/> </index> </resources> EOF if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then ../wine/"$HOST_ARCH"/makepri.exe new /pr "$(wslpath -w "$WORK_DIR"/wsa/pri)" /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$(wslpath -w "$WORK_DIR"/wsa/priconfig.xml)" /of "$(wslpath -w "$WORK_DIR"/wsa/"$ARCH"/resources.pri)" /o elif which wine64 > /dev/null; then wine64 ../wine/"$HOST_ARCH"/makepri.exe new /pr "$WORK_DIR"/wsa/pri /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$WORK_DIR"/wsa/priconfig.xml /of "$WORK_DIR"/wsa/"$ARCH"/resources.pri /o else res_merge_failed=1 fi [ -z "$res_merge_failed" ] && sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR"/wsa/"$ARCH"/AppxManifest.xml && \ echo -e "Merge Language Resources done\n" } && [ -n "$res_merge_failed" ] && echo -e "Merge Language Resources failed\n" && unset res_merge_failed echo "Add extra packages and Netpree and Netspark security certificates" $SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages and Netpree and Netspark security certificates done\n" if [ "$GAPPS_BRAND" != 'none' ]; then echo "Integrate $GAPPS_BRAND" find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chmod 0755 {} \; find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chown root:root {} \; file_list="$(find "$WORK_DIR/gapps/" -mindepth 1 -type f | cut -d/ -f5-)" for file in $file_list; do $SUDO chown root:root "$WORK_DIR/gapps/${file}" $SUDO chmod 0644 "$WORK_DIR/gapps/${file}" done if [ "$GAPPS_BRAND" = "OpenGApps" ]; then find "$WORK_DIR"/gapps/ -maxdepth 1 -mindepth 1 -type d -not -path '*product' -exec $SUDO cp --preserve=all -r {} "$MOUNT_DIR"/system \; || abort elif [ "$GAPPS_BRAND" = "MindTheGapps" ]; then $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/system_ext/* "$MOUNT_DIR"/system_ext/ || abort if [ -e "$MOUNT_DIR"/system_ext/priv-app/SetupWizard ]; then rm -rf "${MOUNT_DIR:?}/system_ext/priv-app/Provision" fi fi $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/product/* "$MOUNT_DIR"/product || abort find "$WORK_DIR"/gapps/product/overlay -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/overlay/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:vendor_overlay_file:s0" {} \; || abort if [ "$GAPPS_BRAND" = "OpenGApps" ]; then find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort else find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort $SUDO setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" "$MOUNT_DIR"/product/lib || abort find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib64/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort fi $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" "allow gmscore_app system_server_tmpfs dir search" "allow gmscore_app system_server_tmpfs file open" "allow gmscore_app system_server_tmpfs filesystem getattr" "allow gmscore_app gpu_device dir search" || abort echo -e "Integrate $GAPPS_BRAND done\n" fi 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" $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort echo -e "done\n" fi fi echo "Umount images" $SUDO find "$MOUNT_DIR" -exec touch -ht 200901010000.00 {} \; $SUDO umount -v "$MOUNT_DIR"/vendor $SUDO umount -v "$MOUNT_DIR"/product $SUDO umount -v "$MOUNT_DIR"/system_ext $SUDO umount -v "$MOUNT_DIR" echo -e "done\n" echo "Shrink images" e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/product.img || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort echo -e "Shrink images done\n" echo "Remove signature and add scripts" $SUDO rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR"/wsa/"$ARCH"/AppxBlockMap.xml "$WORK_DIR"/wsa/"$ARCH"/AppxSignature.p7x "$WORK_DIR"/wsa/"$ARCH"/AppxMetadata || abort cp "$vclibs_PATH" "$xaml_PATH" "$WORK_DIR"/wsa/"$ARCH" || abort cp ../installer/Install.ps1 "$WORK_DIR"/wsa/"$ARCH" || abort cp ../installer/Run.bat "$WORK_DIR"/wsa/"$ARCH" || abort find "$WORK_DIR"/wsa/"$ARCH" -maxdepth 1 -mindepth 1 -printf "%P\n" > "$WORK_DIR"/wsa/"$ARCH"/filelist.txt || abort echo -e "Remove signature and add scripts done\n" echo "Generate info" if [[ "$ROOT_SOL" = "none" ]]; then name1="" elif [ "$ROOT_SOL" = "" ] || [ "$ROOT_SOL" = "magisk" ]; then name1="-with-magisk-$MAGISK_VERSION_NAME($MAGISK_VERSION_CODE)-$MAGISK_VER" else name1="-with-$ROOT_SOL-$MAGISK_VER" fi if [ "$GAPPS_BRAND" = "none" ]; then name2="-NoGApps" else if [ "$GAPPS_BRAND" = "OpenGApps" ]; then name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}-${GAPPS_VARIANT}" else name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}" fi if [ "$GAPPS_BRAND" = "OpenGApps" ]; then echo -e "\033[0;31m:warning: Since $GAPPS_BRAND doesn't officially support Android 12.1 and 13 yet, lock the variant to pico! $GAPPS_BRAND may cause startup failure \033[0m" fi fi artifact_name="WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2}" if [ "$NOFIX_PROPS" = "yes" ]; then artifact_name+="-NoFixProps" fi if [ "$REMOVE_AMAZON" = "yes" ]; then artifact_name+="-RemovedAmazon" fi echo "$artifact_name" echo -e "\nFinishing building...." if [ -f "$OUTPUT_DIR" ]; then $SUDO rm -rf "${OUTPUT_DIR:?}" fi if [ ! -d "$OUTPUT_DIR" ]; then mkdir -p "$OUTPUT_DIR" fi OUTPUT_PATH="${OUTPUT_DIR:?}/$artifact_name" if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name" if [ -z "$COMPRESS_FORMAT" ]; then COMPRESS_FORMAT="7z" fi if [ -n "$COMPRESS_FORMAT" ]; then FILE_EXT=".$COMPRESS_FORMAT" if [ "$FILE_EXT" = ".xz" ]; then FILE_EXT=".tar$FILE_EXT" fi OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT" fi rm -f "${OUTPUT_PATH:?}" || abort if [ "$COMPRESS_FORMAT" = "7z" ]; then echo "Compressing with 7z" 7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort elif [ "$COMPRESS_FORMAT" = "xz" ]; then echo "Compressing with tar xz" if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name"); then echo "Out of memory? Trying again with single threads..." tar -cPJvf "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi elif [ "$COMPRESS_FORMAT" = "zip" ]; then 7z -tzip a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort fi else rm -rf "${OUTPUT_PATH:?}" || abort cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_PATH" || abort fi echo -e "done\n" echo "Cleanup Work Directory" $SUDO rm -rf "${WORK_DIR:?}" echo "done"
-
ההבדל הוא בקטע הזה
echo "Add extra packages" $SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages done\n"
מול הקטע שלי
echo "Add extra packages and Netpree and Netspark security certificates" $SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/etc/security/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/security/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \; find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages and Netpree and Netspark security certificates done\n"
-
הבעיה היא כזאת
כאשר אני מנסה להכין WSA עדכני (גרסה 2301.40000.7.0) אני נתקל בשגיאה הבאהAdd extra packages and Netpree and Netspark security certificates cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/39698488.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/3f66ddee.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/42afec87.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/482e0622.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/4a3b190e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/4eba579e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/6207c6f5.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/66bbb532.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/820d5f23.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/85c0c4be.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/a4f6f3c0.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/b0396035.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/ea335731.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/f9b4d31c.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/fbb5e364.0': No space left on device Build: an error has occurred, exit
-
וליתר דיוק
הפלט המלאCOMMAND_LINE=--arch x64 --release-type RP --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk --compress --compress-format 7z INFO: Architecture: x64 INFO: Release Type: RP INFO: Magisk Version: stable INFO: GApps Brand: MindTheGapps INFO: GApps Variant: pico INFO: Root Solution: magisk INFO: Compress Format: 7z Build: RELEASE_TYPE=Release Preview [sudo] password for ubuntu: Generate Download Links Generating WSA download link: arch=x64 release_type=Release Preview WSA Version=2301.40000.7.0 download link: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/82207876-51a4-4581-80d3-09369370aadc?P1=1677842691&P2=404&P3=2&P4=lRP2M6xtpgHGrQR59WQHp2tQ61w%2f2u%2fpapNvLDHH88fTdYhwq0WrWd8k%2b3VCOAAgIlfUdL72wvlBOFnJhVSOpw%3d%3d to /home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx download link: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/f347c6de-90ec-413b-897d-20b1194934a7?P1=1677870835&P2=404&P3=2&P4=WhQl72DgL3qom0YdlFqHd%2bmMxE6pxJvLgQHOEKMw2ylbXdJBwmsbTJUyqfryVEKzu9MKfIM54WZvNDuhijNSpA%3d%3d to /home/ubuntu/WSA/download/wsa-RP.zip Generating Magisk download link: release type=stable download link: https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@25.2/app-release.apk Generating MindTheGapps download link: arch=x64 variant=pico download link: https://downloads.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip Download Artifacts 03/03 11:13:48 [NOTICE] Downloading 5 item(s) [DL:13MiB][#72ada4 0B/0B][#9348e0 1.7MiB/5.0MiB(33%)][#abed69 23MiB/1.3GiB(1%)][#6b6d6a 9.9MiB 03/03 11:13:52 [NOTICE] Download complete: /home/ubuntu/WSA/download/magisk-stable.zip [DL:18MiB][#72ada4 0B/0B][#9348e0 3.5MiB/5.0MiB(69%)][#abed69 51MiB/1.3GiB(3%)][#66e792 0B/0B] 03/03 11:13:52 [NOTICE] CUID#7 - Redirecting to https://download.microsoft.com/download/4/7/c/47c6134b-d61f-4024-83bd-b9c9ea951c25/appx/Microsoft.VCLibs.x64.14.00.Desktop.appx [DL:7.6MiB][#72ada4 0B/0B][#9348e0 3.6MiB/5.0MiB(72%)][#abed69 54MiB/1.3GiB(3%)][#66e792 0B/0B 03/03 11:13:57 [NOTICE] CUID#11 - Redirecting to https://netix.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip 03/03 11:13:57 [NOTICE] Download complete: /home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx 03/03 11:13:58 [NOTICE] CUID#53 - Redirecting to https://deac-ams.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip 03/03 11:13:58 [NOTICE] Download complete: /home/ubuntu/WSA/download/Microsoft.VCLibs.x64.14.00.Desktop.appx [DL:41MiB][#abed69 417MiB/1.3GiB(29%)][#66e792 9.9MiB/188MiB(5%)] 03/03 11:14:00 [NOTICE] CUID#54 - Redirecting to https://netix.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [DL:73MiB][#abed69 693MiB/1.3GiB(48%)][#66e792 29MiB/188MiB(15%)] 03/03 11:14:02 [NOTICE] CUID#56 - Redirecting to https://deac-ams.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [DL:189MiB][#abed69 1.0GiB/1.3GiB(78%)][#66e792 54MiB/188MiB(28%)] 03/03 11:14:04 [NOTICE] CUID#58 - Redirecting to https://netix.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [DL:196MiB][#abed69 1.3GiB/1.3GiB(94%)][#66e792 61MiB/188MiB(32%)] 03/03 11:14:05 [NOTICE] Download complete: /home/ubuntu/WSA/download/wsa-RP.zip [#66e792 79MiB/188MiB(42%) CN:6 DL:10MiB ETA:10s] 03/03 11:14:06 [NOTICE] CUID#55 - Redirecting to https://netix.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [#66e792 102MiB/188MiB(54%) CN:5 DL:10MiB ETA:8s] 03/03 11:14:08 [NOTICE] CUID#57 - Redirecting to https://netcologne.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [#66e792 122MiB/188MiB(64%) CN:5 DL:11MiB ETA:5s] 03/03 11:14:10 [NOTICE] CUID#59 - Redirecting to https://kumisystems.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip [#66e792 185MiB/188MiB(98%) CN:1 DL:1.4MiB ETA:1s] 03/03 11:14:26 [NOTICE] Download complete: /home/ubuntu/WSA/download/MindTheGapps-x64-13.0.zip Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 6b6d6a|OK | 3.3MiB/s|/home/ubuntu/WSA/download/magisk-stable.zip 9348e0|OK | 569KiB/s|/home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx 72ada4|OK | 8.2MiB/s|/home/ubuntu/WSA/download/Microsoft.VCLibs.x64.14.00.Desktop.appx abed69|OK | 87MiB/s|/home/ubuntu/WSA/download/wsa-RP.zip 66e792|OK | 6.6MiB/s|/home/ubuntu/WSA/download/MindTheGapps-x64-13.0.zip Status Legend: (OK):download completed. Extract WSA unzipping to /tmp/wsa-build-eT6Xhc6kvo_/wsa unzipping from /tmp/wsa-build-eT6Xhc6kvo_/wsa/WsaPackage_2301.40000.7.0_x64_Release-Nightly.msix Extract done Extract Magisk Magisk version: 25.2 (25200) done Extract MindTheGapps Archive: ../download/MindTheGapps-x64-13.0.zip signed by SignApk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/app/PrebuiltExchange3Google/PrebuiltExchange3Google.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/default-permissions/default-permissions-google.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/default-permissions/default-permissions-mtg.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/permissions/com.google.android.dialer.support.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/permissions/privapp-permissions-google-product.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/security/fsverity/gms_fsverity_cert.der inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/sysconfig/d2d_cable_migration_feature.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/sysconfig/google-hiddenapi-package-allowlist.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/sysconfig/google.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/etc/sysconfig/google_build.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/framework/com.google.android.dialer.support.jar inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/lib/libjni_latinimegoogle.so inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/lib64/libjni_latinimegoogle.so inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/overlay/GmsOverlay.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/overlay/GmsSettingsProviderOverlay.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/AndroidAutoStub/AndroidAutoStub.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/GmsCore/GmsCore.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/GoogleRestore/GoogleRestore.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/Phonesky/Phonesky.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/product/priv-app/Velvet/Velvet.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/system_ext/etc/permissions/privapp-permissions-google-system-ext.xml inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/system_ext/priv-app/GoogleFeedback/GoogleFeedback.apk inflating: /tmp/wsa-build-eT6Xhc6kvo_/gapps/system/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk Extract done Expand images system_ext: 99/128 files (1.0% non-contiguous), 46211/46350 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/system_ext.img to 114561 (4k) blocks. The filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/system_ext.img is now 114561 (4k) blocks long. product: 132/144 files (0.0% non-contiguous), 75781/76009 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/product.img to 192739 (4k) blocks. The filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/product.img is now 192739 (4k) blocks long. /: 2799/2816 files (0.4% non-contiguous), 227336/242592 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/system.img to 259452 (4k) blocks. The filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/system.img is now 259452 (4k) blocks long. vendor: 1096/1120 files (0.5% non-contiguous), 61176/61364 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/vendor.img to 64964 (4k) blocks. The filesystem on /tmp/wsa-build-eT6Xhc6kvo_/wsa/x64/vendor.img is now 64964 (4k) blocks long. Expand images done Mount images mount: /dev/loop0 mounted on /tmp/wsa-build-eT6Xhc6kvo_/system. mount: /dev/loop1 mounted on /tmp/wsa-build-eT6Xhc6kvo_/system/vendor. mount: /dev/loop2 mounted on /tmp/wsa-build-eT6Xhc6kvo_/system/product. mount: /dev/loop3 mounted on /tmp/wsa-build-eT6Xhc6kvo_/system/system_ext. done Add device administration features done Integrate Magisk /dev/ratkssal(/.*)? u:object_r:magisk_file:s0 /data/adb/magisk(/.*)? u:object_r:magisk_file:s0 Integrate Magisk done Merge Language Resources 0048:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1". 0024:fixme:nls:RtlSetThreadPreferredUILanguages 256, 0000000000000000, 0000000000000000 0024:fixme:heap:RtlSetHeapInformation 0000000000D40000 0 000000000021E420 4 stub 0024:fixme:heap:RtlSetHeapInformation 0000000000D40000 0 000000000021E420 4 stub Index Pass Completed. AlternateForm Qualifiers: LIGHTUNPLATED,UNPLATED Language Qualifiers: EN-US,EN-GB,AF-ZA,AR-SA,AZ-LATN-AZ,BG-BG,BS-LATN-BA,CA-ES,CS-CZ,CY-GB,DA-DK,DE-DE,EL-GR,ES-ES,ES-MX,ET-EE,EU-ES,FA-IR,FI-FI,FR-CA,FR-FR,GL-ES,HE-IL,HI-IN,HR-HR,HU-HU,ID-ID,IS-IS,IT-IT,JA-JP,KA-GE,KK-KZ,KO-KR,LT-LT,LV-LV,MS-MY,NB-NO,NL-NL,NN-NO,PL-PL,PT-BR,PT-PT,QPS-PLOC,QPS-PLOCA,QPS-PLOCM,RO-RO,RU-RU,SK-SK,SL-SI,SQ-AL,SR-CYRL-RS,SR-LATN-RS,SV-SE,TH-TH,TR-TR,UK-UA,VI-VN,ZH-CN,ZH-TW Scale Qualifiers: 200,400,150,125,100 TargetSize Qualifiers: 256,16,20,24,30,32,36,40,48,60,64,72,80,96 Finished building Version: 1.0 Resource Map Name: MicrosoftCorporationII.WindowsSubsystemForAndroid Named Resources: 289 Resource Candidates: 12915 Successfully Completed Merge Language Resources done Add extra packages and Netpree and Netspark security certificates cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/39698488.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/3f66ddee.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/42afec87.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/482e0622.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/4a3b190e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/4eba579e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/6207c6f5.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/66bbb532.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/820d5f23.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/85c0c4be.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/a4f6f3c0.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/b0396035.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/ea335731.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/f9b4d31c.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-eT6Xhc6kvo_/system/system/etc/security/cacerts/fbb5e364.0': No space left on device Build: an error has occurred, exit Cleanup Work Directory Cleanup Mount Directory umount: /tmp/wsa-build-eT6Xhc6kvo_/system/vendor unmounted umount: /tmp/wsa-build-eT6Xhc6kvo_/system/product unmounted umount: /tmp/wsa-build-eT6Xhc6kvo_/system/system_ext unmounted umount: /tmp/wsa-build-eT6Xhc6kvo_/system unmounted Cleanup Download Directory
-
ניסיתי לפתור זאת כך
echo "Expand images" if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi # add 10 MB to SYSTEM_EXT_SIZE SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + 20480 )) resize2fs "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$SYSTEM_EXT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort PRODUCT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/product.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/product ]; then PRODUCT_SIZE=$(( PRODUCT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort SYSTEM_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps | cut -f1) - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) fi if [ -f "$MAGISK_PATH" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) )) fi if [ -d "../$ARCH/system" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort VENDOR_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/vendor.img | cut -f1) + 20000)) resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort echo -e "Expand images done\n"
אך ללא תועלת
-
@sivan22 האם יש לך רעיון לפתרון?
כמדומני שאת השינוי שעשיתי לקחת ממך בזמנו -
עדכון כרגע כל ניסיון ליצור WSA מסתיים בשגיאה
COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk --compress --compress-format 7z INFO: Architecture: x64 INFO: Release Type: retail INFO: Magisk Version: stable INFO: GApps Brand: MindTheGapps INFO: GApps Variant: pico INFO: Root Solution: magisk INFO: Compress Format: 7z Build: RELEASE_TYPE=Retail [sudo] password for ubuntu: Generate Download Links Generating WSA download link: arch=x64 release_type=Retail WSA Version=2301.40000.7.0 download link: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/f347c6de-90ec-413b-897d-20b1194934a7?P1=1677872694&P2=404&P3=2&P4=a81KLLNcJW5vCe0yr7ppDn3KOPFatWaxNZBaZ%2fX0YaQa1AYsAK9H9%2foud3sTMeuXpiGlUOqRQNI5ePtOlhq1Iw%3d%3d to /home/ubuntu/WSA/download/wsa-retail.zip download link: http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/82207876-51a4-4581-80d3-09369370aadc?P1=1677844424&P2=404&P3=2&P4=DwlSQbyHVQLqrTgsCXBcsiqP7JG5h2ZgxyO0z9rTyj0H2lssK38P5zjJ1DmMhLDXA%2fdG65SOdOsbLHVS47SC9w%3d%3d to /home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx Generating Magisk download link: release type=stable download link: https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@25.2/app-release.apk Generating MindTheGapps download link: arch=x64 variant=pico download link: https://downloads.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip Download Artifacts 03/03 11:41:55 [NOTICE] Downloading 5 item(s) 03/03 11:41:55 [NOTICE] GID#5ed1ba03b583b719 - Download has already completed: /home/ubuntu/WSA/download/magisk-stable.zip 03/03 11:41:55 [NOTICE] Download complete: /home/ubuntu/WSA/download/magisk-stable.zip 03/03 11:41:55 [NOTICE] GID#f5108eba06dff514 - Download has already completed: /home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx 03/03 11:41:55 [NOTICE] Download complete: /home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx 03/03 11:41:55 [NOTICE] GID#255d98e911099ff0 - Download has already completed: /home/ubuntu/WSA/download/wsa-retail.zip 03/03 11:41:55 [NOTICE] Download complete: /home/ubuntu/WSA/download/wsa-retail.zip 03/03 11:41:55 [NOTICE] CUID#7 - Redirecting to https://download.microsoft.com/download/4/7/c/47c6134b-d61f-4024-83bd-b9c9ea951c25/appx/Microsoft.VCLibs.x64.14.00.Desktop.appx 03/03 11:41:55 [NOTICE] GID#f8e8ef5761d7b315 - Download has already completed: /home/ubuntu/WSA/download/Microsoft.VCLibs.x64.14.00.Desktop.appx 03/03 11:41:55 [NOTICE] Download complete: /home/ubuntu/WSA/download/Microsoft.VCLibs.x64.14.00.Desktop.appx 03/03 11:41:55 [NOTICE] CUID#11 - Redirecting to https://altushost-swe.dl.sourceforge.net/project/wsa-mtg/x86_64/20230201/MindTheGapps-13.0.0-x86_64-20230201.zip 03/03 11:41:55 [NOTICE] GID#8164b0bb85c94851 - Download has already completed: /home/ubuntu/WSA/download/MindTheGapps-x64-13.0.zip 03/03 11:41:55 [NOTICE] Download complete: /home/ubuntu/WSA/download/MindTheGapps-x64-13.0.zip Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 5ed1ba|OK | 0B/s|/home/ubuntu/WSA/download/magisk-stable.zip f5108e|OK | 0B/s|/home/ubuntu/WSA/download/Microsoft.UI.Xaml_x64.appx 255d98|OK | 0B/s|/home/ubuntu/WSA/download/wsa-retail.zip f8e8ef|OK | 0B/s|/home/ubuntu/WSA/download/Microsoft.VCLibs.x64.14.00.Desktop.appx 8164b0|OK | 0B/s|/home/ubuntu/WSA/download/MindTheGapps-x64-13.0.zip Status Legend: (OK):download completed. Extract WSA unzipping to /tmp/wsa-build-Yi6tGzG6Dj_/wsa unzipping from /tmp/wsa-build-Yi6tGzG6Dj_/wsa/WsaPackage_2301.40000.7.0_x64_Release-Nightly.msix Extract done Extract Magisk Magisk version: 25.2 (25200) done Extract MindTheGapps Archive: ../download/MindTheGapps-x64-13.0.zip signed by SignApk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/app/PrebuiltExchange3Google/PrebuiltExchange3Google.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/default-permissions/default-permissions-google.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/default-permissions/default-permissions-mtg.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/permissions/com.google.android.dialer.support.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/permissions/privapp-permissions-google-product.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/security/fsverity/gms_fsverity_cert.der inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/sysconfig/d2d_cable_migration_feature.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/sysconfig/google-hiddenapi-package-allowlist.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/sysconfig/google.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/etc/sysconfig/google_build.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/framework/com.google.android.dialer.support.jar inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/lib/libjni_latinimegoogle.so inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/lib64/libjni_latinimegoogle.so inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/overlay/GmsOverlay.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/overlay/GmsSettingsProviderOverlay.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/AndroidAutoStub/AndroidAutoStub.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/GmsCore/GmsCore.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/GoogleRestore/GoogleRestore.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/Phonesky/Phonesky.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/product/priv-app/Velvet/Velvet.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/system_ext/etc/permissions/privapp-permissions-google-system-ext.xml inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/system_ext/priv-app/GoogleFeedback/GoogleFeedback.apk inflating: /tmp/wsa-build-Yi6tGzG6Dj_/gapps/system/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk Extract done Expand images system_ext: 99/128 files (1.0% non-contiguous), 46211/46350 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/system_ext.img to 114561 (4k) blocks. The filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/system_ext.img is now 114561 (4k) blocks long. product: 132/144 files (0.0% non-contiguous), 75781/76009 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/product.img to 192739 (4k) blocks. The filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/product.img is now 192739 (4k) blocks long. /: 2799/2816 files (0.4% non-contiguous), 227336/242592 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/system.img to 259452 (4k) blocks. The filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/system.img is now 259452 (4k) blocks long. vendor: 1096/1120 files (0.5% non-contiguous), 61176/61364 blocks resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/vendor.img to 64964 (4k) blocks. The filesystem on /tmp/wsa-build-Yi6tGzG6Dj_/wsa/x64/vendor.img is now 64964 (4k) blocks long. Expand images done Mount images mount: /dev/loop0 mounted on /tmp/wsa-build-Yi6tGzG6Dj_/system. mount: /dev/loop1 mounted on /tmp/wsa-build-Yi6tGzG6Dj_/system/vendor. mount: /dev/loop2 mounted on /tmp/wsa-build-Yi6tGzG6Dj_/system/product. mount: /dev/loop3 mounted on /tmp/wsa-build-Yi6tGzG6Dj_/system/system_ext. done Add device administration features done Integrate Magisk /dev/wexxlnmk(/.*)? u:object_r:magisk_file:s0 /data/adb/magisk(/.*)? u:object_r:magisk_file:s0 Integrate Magisk done Merge Language Resources 0050:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1". 0024:fixme:nls:RtlSetThreadPreferredUILanguages 256, 0000000000000000, 0000000000000000 0024:fixme:heap:RtlSetHeapInformation 0000000000D40000 0 000000000021E420 4 stub 0024:fixme:heap:RtlSetHeapInformation 0000000000D40000 0 000000000021E420 4 stub Index Pass Completed. AlternateForm Qualifiers: LIGHTUNPLATED,UNPLATED Language Qualifiers: EN-US,EN-GB,AF-ZA,AR-SA,AZ-LATN-AZ,BG-BG,BS-LATN-BA,CA-ES,CS-CZ,CY-GB,DA-DK,DE-DE,EL-GR,ES-ES,ES-MX,ET-EE,EU-ES,FA-IR,FI-FI,FR-CA,FR-FR,GL-ES,HE-IL,HI-IN,HR-HR,HU-HU,ID-ID,IS-IS,IT-IT,JA-JP,KA-GE,KK-KZ,KO-KR,LT-LT,LV-LV,MS-MY,NB-NO,NL-NL,NN-NO,PL-PL,PT-BR,PT-PT,QPS-PLOC,QPS-PLOCA,QPS-PLOCM,RO-RO,RU-RU,SK-SK,SL-SI,SQ-AL,SR-CYRL-RS,SR-LATN-RS,SV-SE,TH-TH,TR-TR,UK-UA,VI-VN,ZH-CN,ZH-TW Scale Qualifiers: 200,400,150,125,100 TargetSize Qualifiers: 256,16,20,24,30,32,36,40,48,60,64,72,80,96 Finished building Version: 1.0 Resource Map Name: MicrosoftCorporationII.WindowsSubsystemForAndroid Named Resources: 289 Resource Candidates: 12915 Successfully Completed Merge Language Resources done Add extra packages and Netpree and Netspark security certificates cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/39698488.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/3f66ddee.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/42afec87.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/482e0622.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/4a3b190e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/4eba579e.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/6207c6f5.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/66bbb532.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/820d5f23.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/85c0c4be.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/a4f6f3c0.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/b0396035.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/ea335731.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/f9b4d31c.0': No space left on device cp: cannot create regular file '/tmp/wsa-build-Yi6tGzG6Dj_/system/system/etc/security/cacerts/fbb5e364.0': No space left on device Build: an error has occurred, exit Cleanup Work Directory Cleanup Mount Directory umount: /tmp/wsa-build-Yi6tGzG6Dj_/system/vendor unmounted umount: /tmp/wsa-build-Yi6tGzG6Dj_/system/product unmounted umount: /tmp/wsa-build-Yi6tGzG6Dj_/system/system_ext unmounted umount: /tmp/wsa-build-Yi6tGzG6Dj_/system unmounted Cleanup Download Directory
עקב כך שהגרסה היא כבר הגרסה הרגילה ולא תצוגה מקדימה
-
@A0533057932
יש לך צורת ביטוי מעניינת...
אני רואה בפלט שגיאה פשוטה של חוסר מקום בדיסק.
אין שום קשר לתעודות אבטחה, במקרה שמה אתה מעתיק את קבצי הCA וזה נכשל מחוסר מקום בדיסק... -
@dovid אני יודע בדיוק מה השגיאה
אבל הבעיה היא שהקוד אמור לחשבן את הגודל ולהגדיל את המחיצה בהתאם
כמו כן ניסיתי למחוק את הקובץ
VpnDialogs
ועדין השגיאה נשארה אותו דבר בדיוק
כל ה15 לא עברו
למרות שזה היה אמור להעביר לפחות 13 מתוכם אם זה באמת היה שגיאה של מקום פשוטה -
פוסט זה נמחק!
-
נראה שהצלחתי לתקן
ע"י הגדלה שרירותית של המחיצה בצורה הבאהecho "Expand images" if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$SYSTEM_EXT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort PRODUCT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/product.img | cut -f1) + 20000)) if [ -d "$WORK_DIR"/gapps/product ]; then PRODUCT_SIZE=$(( PRODUCT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort SYSTEM_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system.img | cut -f1) + 90000)) if [ -d "$WORK_DIR"/gapps ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps | cut -f1) - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) )) if [ -d "$WORK_DIR"/gapps/system_ext ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) )) fi fi if [ -d "$WORK_DIR"/magisk ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) )) fi if [ -f "$MAGISK_PATH" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) )) fi if [ -d "../$ARCH/system" ]; then SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) )) fi resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort VENDOR_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/vendor.img | cut -f1) + 20000)) resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort echo -e "Expand images done\n"
עדין אני לא מבין מדוע הקוד לא בודק את גוגל התיקיה ומוסיף בהתאם כמו שהוא אמור לעשות
אבל עצם הבעיה נפתרה