diff --git a/.gitattributes b/.gitattributes index 273764a214..7c59266ea4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,8 @@ +*.py text eol=lf *.sh text eol=lf *.exe binary *.apk binary *.so binary *.xml text eol=crlf +*.bat text eol=crlf +*.ps1 text eol=crlf diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..fad1cf6576 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,91 @@ +name: Bug report/反馈 Bug +description: Report errors or unexpected behavior./反馈错误或异常行为。 +labels: [bug] +title: "[Bug] Short description." +body: + - type: markdown + attributes: + value: | + Thanks for reporting issues of MagiskOnWSALocal! + + To make it easier for us to help you please enter detailed information below. + + 感谢给 MagiskOnWSALocal 汇报问题! + 为了使我们更好地帮助你,请提供以下信息。 + 为了防止重复汇报,标题请务必使用英文。 + - type: textarea + attributes: + label: Steps to reproduce/复现步骤 + value: | + 1. + 2. + 3. + validations: + required: true + - type: textarea + attributes: + label: Expected behaviour/预期行为 + placeholder: Tell us what should happen/正常情况下应该发生什么 + validations: + required: true + - type: textarea + attributes: + label: Actual behaviour/实际行为 + placeholder: Tell us what happens instead/实际上发生了什么 + validations: + required: true + - type: input + attributes: + label: MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希 + description: Don't use 'latest'. Copy and paste full commit SHA, otherwise your issue will be closed./不要填用“最新”。复制并粘贴完整 commit SHA,不然 issue 会被关闭。 + validations: + required: true + - type: textarea + attributes: + label: Linux distribution info/Linux 发行版信息 + validations: + required: true + - type: input + attributes: + label: Windows version/Windows 版本 + placeholder: 10.0.22000.978 + validations: + required: true + - type: textarea + attributes: + label: Build Parameters/构建参数 + description: The script prints the build information each time you start a build. It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息,它看起来是这样的,请复制并粘贴上来。 + placeholder: | + COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk + INFO: Architecture: x64 + INFO: Release Type: retail + INFO: Magisk Version: stable + INFO: GApps Brand: MindTheGapps + INFO: GApps Variant: pico + INFO: Root Solution: magisk + Build: RELEASE_TYPE=Retail + validations: + required: true + - type: checkboxes + id: latest + attributes: + label: Version requirement/版本要求 + options: + - label: I am using latest commit of MagiskOnWSALocal/我正在使用最新 commit 的版本 + required: true + - type: textarea + attributes: + label: Logs/日志 + description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图。无日志提交会被关闭。 + value: | +
+ + [//]: <> (Don't modify above) + + ``` + # Replace this line with the log / 将此行用日志替换 + ``` + [//]: <> (Don't modify below) +
+ validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3e0476632d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question/提问 + url: https://github.com/LSPosed/MagiskOnWSALocal/discussions/new?category=Q-A + about: Please ask and answer questions here./如果有任何疑问请在这里提问 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..9f826830d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +--- +name: Feature request/新特性请求 +description: Suggest an idea./提出建议 +labels: [enhancement] +title: "[Feature Request] Short description." +body: + - type: textarea + attributes: + label: Is your feature request related to a problem?/你的请求是否与某个问题相关? + placeholder: A clear and concise description of what the problem is./请清晰准确表述该问题。 + validations: + required: true + - type: textarea + attributes: + label: Describe the solution you'd like/描述你想要的解决方案 + placeholder: A clear and concise description of what you want to happen./请清晰准确描述新特性的预期行为 + validations: + required: true + - type: textarea + attributes: + label: Additional context/其他信息 + placeholder: Add any other context or screenshots about the feature request here./其他关于新特性的信息或者截图 + validations: + required: false \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..6eda463153 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ + + +Checklist + +- [ ] Referenced all related issues in the PR body (e.g. "Closes #xyz") +- [ ] Have tested the modifications diff --git a/.github/workflows/issue_moderator.yml b/.github/workflows/issue_moderator.yml new file mode 100644 index 0000000000..6af31e2a84 --- /dev/null +++ b/.github/workflows/issue_moderator.yml @@ -0,0 +1,27 @@ +name: Issue moderator + +on: + issues: + types: [opened] + pull_request: + types: [opened, edited] + +jobs: + autoclose: + runs-on: ubuntu-latest + steps: + - name: Check issue + uses: tachiyomiorg/issue-moderator-action@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + auto-close-rules: | + [ + { + "type": "title", + "regex": ".*Short description.*", + "message": "You did not fill out the description in the title" + } + ] + auto-close-ignore-label: do-not-autoclose + - name: Check PR + uses: sumally/github-check-tasklist-action@v1 diff --git a/.github/workflows/lock-closed-issues.yml b/.github/workflows/lock-closed-issues.yml new file mode 100644 index 0000000000..6b28295e82 --- /dev/null +++ b/.github/workflows/lock-closed-issues.yml @@ -0,0 +1,13 @@ +name: Lock closed issue + +on: + issues: + types: [closed] + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: OSDKDev/lock-issues@v1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000000..d2c2ef42c6 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,25 @@ +name: 'Lock Threads' + +on: + issues: + types: [closed] + pull_request: + types: [closed] + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v4 + with: + exclude-any-issue-labels: 'do-not-autoclose' + exclude-any-pr-labels: 'do-not-autoclose' + include-any-pr-labels: 'spam' diff --git a/.github/workflows/ps2check.yml b/.github/workflows/ps2check.yml new file mode 100644 index 0000000000..628648806f --- /dev/null +++ b/.github/workflows/ps2check.yml @@ -0,0 +1,27 @@ +name: PSScript checker + +on: + push: + paths: + - '**.ps1' + - '.github/workflows/ps2check.yml' + pull_request: + paths: + - '**.ps1' + - '.github/workflows/ps2check.yml' + workflow_dispatch: + +jobs: + shellcheck: + runs-on: windows-latest + steps: + - name : Checkout + uses: actions/checkout@v3 + + - name: Run PSScriptAnalyzer + uses: microsoft/psscriptanalyzer-action@v1.0 + with: + path: .\installer + recurse: true + includeDefaultRules: true + enableExit: true diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000000..77a79af8f8 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,25 @@ +name: Shell checker + +on: + push: + paths: + - '**.sh' + - '.github/workflows/shellcheck.yml' + pull_request: + paths: + - '**.sh' + - '.github/workflows/shellcheck.yml' + workflow_dispatch: + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - name : Checkout + uses: actions/checkout@v3 + + - name: Run ShellCheck + id: check + uses: ludeeus/action-shellcheck@master + with: + scandir: './scripts' diff --git a/.gitignore b/.gitignore index f72e5d1ea5..af3808793f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ download output +python3-env +token diff --git a/Custom-OpenGApps.md b/Custom-OpenGApps.md deleted file mode 100644 index 8a42afe303..0000000000 --- a/Custom-OpenGApps.md +++ /dev/null @@ -1,9 +0,0 @@ -# How to install custom OpenGApps - -1. Build WSA without gapps to let the script download needed files - - `./build.sh --gapps-brand none` -1. Place custom OpenGApps to `download` folder and rename to `OpenGApps-{arch}-{variant}.zip` (e.g. `OpenGApps-x64-pico.zip`) -1. Build WSA offline - - `./build.sh --offline --gapps-variant {variant}` diff --git a/README.md b/README.md deleted file mode 100644 index b7f50cb191..0000000000 --- a/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Magisk on WSA (with Google Apps) - -## Pre-request - -- Ubuntu (you can use WSL2) - - [Search page](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited) - -## Features - -- Integrate Magisk and OpenGApps in a few clicks within minutes -- Keep each build up to date -- Support both ARM64 and x64 -- Support all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead) -- Remove Amazon Appstore -- Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs)) -- Add device management feature -- Unattended installation -- Automatically activates developers mode in Windows 11 -- Update to the new version while preserving data with a one-click script -- Merged all language packs -- Support managing start menu icons (manually installing [WSAHelper](https://github.com/LSPosed/WSAHelper/releases/latest) to use this feature) - -## Text Guide - -1. Star (if you like) -1. Clone the repo to local -1. Run `scripts/run.sh` -1. Select the version of Magisk and select the [OpenGApps variant](https://github.com/opengapps/opengapps/wiki#variants) you like, select the root solution (none means no root), select the WSA version and its architecture (mostly x64) -1. Wait for the script to complete and the artifact will be in the `output` folder - -1. Move the artifact to a place you like -1. Right-click `Install.ps1` and select `Run with PowerShell` - - If you previously have a MagiskOnWSA installation, it will automatically uninstall the previous one while **preserving all user data** and install the new one, so don't worry about your data. - - If you have an official WSA installation, you should uninstall it first. (In case you want to preserve your data, you can backup `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx` before uninstallation and restore it after installation.) (If you want to restore the icons to the start menu, please install and use [WSAHelper](https://github.com/LSPosed/WSAHelper/releases/latest).) - - If the popup windows disappear **without asking administrative permission** and WSA is not installed successfully, you should manually run `Install.ps1` as administrator: - 1. Press `Win+x` and select `Windows Terminal (Admin)` - 2. Input `cd "{X:\path\to\your\extracted\folder}"` and press `enter`, and remember to replace `{X:\path\to\your\extracted\folder}` including the `{}`, for example `cd "D:\wsa"` - 3. Input `PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1` and press `enter` - 4. The script will run and WSA will be installed - 5. If this workaround does not work, your PC is not supported for WSA -1. Magisk/Play store will be launched. Enjoy by installing LSPosed-zygisk with zygisk enabled or Riru and LSPosed-riru - -## FAQ - -- Can I delete the installed folder? - - No. -- How can I update WSA to a new version? - - Delete the `download` folder - Rerun the script, replace the content of your previous installation and rerun `Install.ps1`. Don't worry, your data will be preserved. -- How can I get the logcat from WSA? - - `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat` -- How can I update Magisk to a new version? - - Do the same as updating WSA -- How to pass safetynet? - - Like all the other emulators, no way. -- Virtualization is not enabled? - - `Install.ps1` helps you enable it if not enabled. After rebooting, rerun `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in BIOS. That's a long story so ask Google for help. -- How to remount the system as read-write? - - No way in WSA since it's mounted as read-only by Hyper-V. You can modify the system by making a Magisk module. Or directly modify the system.img. Ask Google for help. -- I cannot `adb connect localhost:58526` - - Make sure developer mode is enabled. If the issue persists, check the IP address of WSA on the setting page and try `adb connect ip:5555`. -- Magisk online module list is empty? - - Magisk actively removes the online module repository. You can install the module locally or by `adb push module.zip /data/local/tmp` and `adb shell su -c magisk --install-module /data/local/tmp/module.zip`. -- Can I use Magisk 23.0 stable or a lower version? - - No. Magisk has bugs preventing itself from running on WSA. Magisk 24+ has fixed them. So you must use Magisk 24 or higher version. -- How can I get rid of Magisk? - - Choose `none` as the root solution. -- How to install custom OpenGApps? - - [Tutorial](./Custom-OpenGApps.md) - -## Credits - -- [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA -- [Magisk](https://github.com/topjohnwu/Magisk): The most famous root solution on Android -- [The Open GApps Project](https://opengapps.org): One of the most famous Google Apps packages solution -- [WSA-Kernel-SU](https://github.com/LSPosed/WSA-Kernel-SU) and [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/): The kernel `su` for debugging Magisk Integration -- [WSAGAScript](https://github.com/ADeltaX/WSAGAScript): The first GApps integration script for WSA diff --git a/arm64/gapps/priv-app/SetupWizard/SetupWizard.apk b/arm64/gapps/priv-app/SetupWizard/SetupWizard.apk deleted file mode 100644 index 6fae55f663..0000000000 Binary files a/arm64/gapps/priv-app/SetupWizard/SetupWizard.apk and /dev/null differ diff --git a/arm64/gapps/product/overlay/GoogleWebViewOverlay.apk b/arm64/gapps/product/overlay/GoogleWebViewOverlay.apk deleted file mode 100644 index 44ac318b26..0000000000 Binary files a/arm64/gapps/product/overlay/GoogleWebViewOverlay.apk and /dev/null differ diff --git a/arm64/system/system/etc/permissions/android.software.device_admin.xml b/arm64/system/system/etc/permissions/android.software.device_admin.xml deleted file mode 100644 index 7d14dc661c..0000000000 --- a/arm64/system/system/etc/permissions/android.software.device_admin.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/arm64/system/system/priv-app/VpnDialogs/VpnDialogs.apk b/arm64/system/system/priv-app/VpnDialogs/VpnDialogs.apk deleted file mode 100644 index 4179a48238..0000000000 Binary files a/arm64/system/system/priv-app/VpnDialogs/VpnDialogs.apk and /dev/null differ diff --git a/arm64/system/system/priv-app/WSAHelper/WSAHelper.apk b/arm64/system/system/priv-app/WSAHelper/WSAHelper.apk deleted file mode 100755 index 9817e059ca..0000000000 Binary files a/arm64/system/system/priv-app/WSAHelper/WSAHelper.apk and /dev/null differ diff --git a/bin/arm64/lspinit b/bin/arm64/lspinit new file mode 100644 index 0000000000..89d1a22bc2 Binary files /dev/null and b/bin/arm64/lspinit differ diff --git a/bin/arm64/makepri.exe b/bin/arm64/makepri.exe new file mode 100644 index 0000000000..7e9e1a1173 Binary files /dev/null and b/bin/arm64/makepri.exe differ diff --git a/bin/x64/lspinit b/bin/x64/lspinit new file mode 100644 index 0000000000..cd9483e180 Binary files /dev/null and b/bin/x64/lspinit differ diff --git a/bin/x64/makepri.exe b/bin/x64/makepri.exe new file mode 100644 index 0000000000..47377664a0 Binary files /dev/null and b/bin/x64/makepri.exe differ diff --git a/docs/Custom-GApps.md b/docs/Custom-GApps.md new file mode 100644 index 0000000000..ea19f54f2e --- /dev/null +++ b/docs/Custom-GApps.md @@ -0,0 +1,15 @@ +# How to install custom GApps + +1. Build WSA without gapps to let the script download needed files + + `./build.sh --gapps-brand none` +1. + - For OpenGApps + + Place custom OpenGApps to `download` folder and rename to `OpenGApps-{arch}-{variant}.zip` (e.g. `OpenGApps-x64-pico.zip`) + - For MindTheGapps + + Place custom MindTheGapps to `download` folder and rename to `MindTheGapps-{arch}.zip` (e.g. `MindTheGapps-x64.zip`) +1. Build WSA offline + + `./build.sh --offline --gapps-brand {brand} --gapps-variant {variant}` diff --git a/docs/KernelSU.md b/docs/KernelSU.md new file mode 100644 index 0000000000..d52e80ec21 --- /dev/null +++ b/docs/KernelSU.md @@ -0,0 +1,19 @@ +# Install KernelSU + +## Install Manager + +1. Download KernelSU Manager from [![Build Manager](https://github.com/tiann/KernelSU/actions/workflows/build-manager.yml/badge.svg?event=push)](https://github.com/tiann/KernelSU/actions/workflows/build-manager.yml?query=event%3Apush+is%3Acompleted+branch%3Amain) (Download the artifact named `manager`). + +1. Unzip the downloaded zip package and get the manager apk named `KernelSU_vx.x.x-xx-.....apk`. + +1. Use the command `adb install .apk` to install the manager. + +## Install Kernel + +1. Download pre-build kernel from [![Build Kernel - WSA](https://github.com/tiann/KernelSU/actions/workflows/build-kernel-wsa.yml/badge.svg?event=push)](https://github.com/tiann/KernelSU/actions/workflows/build-kernel-wsa.yml?query=branch%3Amain+event%3Apush+is%3Acompleted) (Remember to download the same architecture). + +1. Unzip the downloaded zip package and get the kernel file named `bzImage`. + +1. Replace the kernel in the folder named `Tools` in the WSA directory with `bzImage`. + +1. Restart WSA and then enjoy. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..a30f026e23 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,181 @@ +# Magisk on WSA (with Google Apps) + +:warning: Magisk on WSA will no longer be available after March 5, 2025. [Learn more](https://learn.microsoft.com/en-us/windows/android/wsa/). + +:warning: For fork developers: Please don't build using GitHub Actions, as GitHub will count your forked GitHub Actions usage against this upstream repository, which may cause this upstream repository gets disabled by GitHub staff like [MagiskOnWSA](https://github.com/LSPosed/MagiskOnWSA) because of numerous forks building GitHub Actions, and counting the forks' Action usage against this upstream repository. + +## Support for generating from these systems + +- Linux (x86_64 or arm64) + + The following dependencies are required: + + | DistrOS | | | | | | + |:-------------------:|----------------------------|------------|--------------------|---------------|---------------| + | Debian | `python3 aria2 unzip sudo` | `whiptail` | `python3-venv` | `python3-pip` | `p7zip-full` | + | openSUSE Tumbleweed | Same as above | `dialog` | `python3-venvctrl` | Same as above | Same as above | + | Arch | Same as Debian | `libnewt` | Same as Debian | `python-pip` | `p7zip` | + + The python3 library `requests` is used. + + Python version ≥ **3.7.2**. + + - Recommended use + + - Ubuntu (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited)) + + Ready to use right out of the box. + + - Debian (You can use [WSL2](https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6)) + + Ready to use right out of the box. + + - openSUSE Tumbleweed (You can use [WSL2](https://apps.microsoft.com/store/detail/opensuse-tumbleweed/9MSSK2ZXXN11)) + + Ready to use right out of the box. + + `run.sh` will handle all dependencies automatically. + + No need to type any commands. + +## Features + +- Integrate Magisk and GApps in a few clicks within minutes +- Keep each build up to date +- Support both ARM64 and x64 +- Support MindTheGapps +- Remove Amazon Appstore +- Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs)) +- Add device administration feature +- Unattended installation +- Automatically activates developers mode in Windows 11 +- Update to the new version while preserving data with a one-click script +- Merged all language packs + +## Text Guide + +1. Star (if you like). +2. Clone the repo to local: + + ```bash + git clone https://github.com/LSPosed/MagiskOnWSALocal.git --depth 1 + ``` + +3. Run `cd MagiskOnWSALocal`. +4. Run `./scripts/run.sh`. +5. Select the WSA version and its architecture (mostly x64). +6. Select the version of Magisk. +7. Choose which brand of GApps you want to install: + - MindTheGapps + + There is no other variant we can choose. +8. Select the root solution (none means no root). +9. If you are running the script for the first time, it will take some time to complete. After the script completes, two new folders named `output` and `download` will be generated in the `MagiskOnWSALocal` folder. Go to the `output` folder. While running the `./run.sh` script in the step 3, if you selected `Yes` for `Do you want to compress the output?` then in `output` folder you will see a compressed file called `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`or else there will be folder with the `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`. If there is a folder open it and skip to step 10. NOTE: The name of compressed file or the folder generated in the `output` folder may be different for you. It will be dependent on the choices made when executing `./run.sh`. +10. Extract the compressed file and open the folder created after the extraction of the file. +11. Here look for file `Run.bat` and run it. + - If you previously have a MagiskOnWSA installation, it will automatically uninstall the previous one while **preserving all user data** and install the new one, so don't worry about your data. + - If you have an official WSA installation, you should uninstall it first. (In case you want to preserve your data, you can backup `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx` before uninstallation and restore it after installation.) + - If the popup windows disappear **without asking administrative permission** and WSA is not installed successfully, you should manually run `Install.ps1` as Administrator: + 1. Press `Win+x` and select `Windows Terminal (Admin)`. + 2. Input `cd "{X:\path\to\your\extracted\folder}"` and press `enter`, and remember to replace `{X:\path\to\your\extracted\folder}` including the `{}`, for example `cd "D:\wsa"` + 3. Input `PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1` and press `Enter`. + 4. The script will run and WSA will be installed. + 5. If this workaround does not work, your PC is not supported for WSA. +12. Magisk/Play Store will be launched. Enjoy by installing LSPosed-Zygisk with Zygisk enabled or Riru and LSPosed-Riru. + +--- + +## FAQ + +
+ +- Can I delete the installed folder? + + No. + +- How can I update WSA to a newer version? + + 1. Update build scripts: + + ```bash + git pull + ``` + + For more usage of git, referred to + + 2. Rerun the script, replace the content of your previous installation and rerun `Install.ps1`. Don't worry, your data will be preserved. + +- How can I get the logcat from WSA? + + `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat` + +- How can I update Magisk to a newer version? + + Do the same as updating WSA. + +- How to pass Play Integrity (formerly known as SafetyNet)? + + Like all the other emulators, no way. + +- Virtualization is not enabled? + + `Install.ps1` helps you enable it if not enabled. After rebooting, rerun `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in BIOS. That's a long story so ask Google for help. + +- How to remount the system as read-write? + + No way in WSA since it's mounted as read-only by Hyper-V. You can modify the system by making a Magisk module. Or directly modify the system.img. Ask Google for help. + +- I cannot `adb connect localhost:58526`, what to do? + + Make sure developer mode is enabled. If the issue persists, check the IP address of WSA on the setting page and try `adb connect ip:5555`. + +- Why the Magisk online module is empty? + + Magisk actively removes the online module repository. You can install the module locally or by `adb push module.zip /data/local/tmp` and `adb shell su -c magisk --install-module /data/local/tmp/module.zip`. + +- Can I use Magisk v23.0 stable or a lower version? + + No. Magisk has bugs preventing itself from running on WSA. Magisk v24+ has fixed them. So you must use Magisk v24 or later. + +- How can I get rid of Magisk? + + Choose `none` as the root solution. + +- How to install custom GApps? + + [Tutorial](Custom-GApps.md) + +- Where can I download MindTheGapps? + + You can download from here [MindTheGapps](https://androidfilehost.com/?w=files&flid=322935) ([mirror](http://downloads.codefi.re/jdcteam/javelinanddart/gapps)). + + Note that there is no x86_64 pre-build, so you need to build it by yourself ([Repository](https://gitlab.com/MindTheGapps/vendor_gapps)). + + Or you can download the built package for 12.1 and 13 for x86_64 from [this page](https://sourceforge.net/projects/wsa-mtg/files/x86_64/). + +- Is it possible to migrate data from a lower version like 2305 to a newer version? + + This is certainly available, Microsoft's change of read-only partition from 2305's EROFS to read-only EXT4 only affects the read-only system partition. + + It has no effect on the user data partition. Check the logs if there is a failure to boot. + +- How to install KernelSU? + + [Tutorial](KernelSU.md) + +
+ +--- + +## Credits + +- [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA +- [Magisk](https://github.com/topjohnwu/Magisk): The most famous root solution on Android +- ~~[The Open GApps Project](https://opengapps.org): One of the most famous Google Apps packages solution~~ +- [WSA-Kernel-SU](https://github.com/LSPosed/WSA-Kernel-SU) and [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/): The kernel `su` for debugging Magisk Integration +- ~~[WSAGAScript](https://github.com/ADeltaX/WSAGAScript): The first GApps integration script for WSA~~ +- ~~[erofs-utils](https://github.com/sekaiacg/erofs-utils): Pre-build `erofs-utils` with erofsfuse enabled~~ + +_The repository is provided as a utility._ + +_Android is a trademark of Google LLC. Windows is a trademark of Microsoft Corporation._ diff --git a/installer/Install.ps1 b/installer/Install.ps1 new file mode 100644 index 0000000000..afb8626078 --- /dev/null +++ b/installer/Install.ps1 @@ -0,0 +1,177 @@ +# 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 . +# +# Copyright (C) 2024 LSPosed Contributors +# + +$Host.UI.RawUI.WindowTitle = "Installing MagiskOnWSA...." +function Test-Administrator { + [OutputType([bool])] + param() + process { + [Security.Principal.WindowsPrincipal]$user = [Security.Principal.WindowsIdentity]::GetCurrent(); + return $user.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator); + } +} + +function Get-InstalledDependencyVersion { + param ( + [string]$Name, + [string]$ProcessorArchitecture + ) + PROCESS { + If ($null -Ne $ProcessorArchitecture) { + return Get-AppxPackage -Name $Name | ForEach-Object { if ($_.Architecture -Eq $ProcessorArchitecture) { $_ } } | Sort-Object -Property Version | Select-Object -ExpandProperty Version -Last 1; + } + } +} + +Function Test-CommandExist { + Param ($Command) + $OldPreference = $ErrorActionPreference + $ErrorActionPreference = 'stop' + try { if (Get-Command $Command) { RETURN $true } } + Catch { RETURN $false } + Finally { $ErrorActionPreference = $OldPreference } +} #end function Test-CommandExist + +Function Finish { + Clear-Host + Start-Process "wsa://com.topjohnwu.magisk" + Start-Process "wsa://com.android.vending" +} + +If (Test-CommandExist pwsh.exe) { + $pwsh = "pwsh.exe" +} +Else { + $pwsh = "powershell.exe" +} + +If (-Not (Test-Administrator)) { + Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force + $Proc = Start-Process -PassThru -Verb RunAs $pwsh -Args "-ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath' EVAL" + If ($null -Ne $Proc) { + $Proc.WaitForExit() + } + If ($null -Eq $Proc -Or $Proc.ExitCode -Ne 0) { + Write-Warning "Failed to launch start as Administrator`r`nPress any key to exit" + $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown'); + } + exit +} +ElseIf (($args.Count -Eq 1) -And ($args[0] -Eq "EVAL")) { + Start-Process $pwsh -NoNewWindow -Args "-ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath'" + exit +} + +$FileList = Get-Content -Path .\filelist.txt +If (((Test-Path -Path $FileList) -Eq $false).Count) { + Write-Error "Some files are missing in the folder. Please try to build again. Press any key to exit" + $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + exit 1 +} + +If (((Test-Path -Path "MakePri.ps1") -And (Test-Path -Path "makepri.exe")) -Eq $true) { + $ProcMakePri = Start-Process $pwsh -PassThru -NoNewWindow -Args "-ExecutionPolicy Bypass -File MakePri.ps1" -WorkingDirectory $PSScriptRoot + $null = $ProcMakePri.Handle + $ProcMakePri.WaitForExit() + If ($ProcMakePri.ExitCode -Ne 0) { + Write-Warning "Failed to merge resources, WSA Seetings will always be in English`r`nPress any key to continue" + $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + } + $Host.UI.RawUI.WindowTitle = "Installing MagiskOnWSA...." +} + +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" + +# When using PowerShell which is installed with MSIX +# Get-WindowsOptionalFeature and Enable-WindowsOptionalFeature will fail +# See https://github.com/PowerShell/PowerShell/issues/13866 +if ($PSHOME.contains("8wekyb3d8bbwe")) { + Import-Module DISM -UseWindowsPowerShell +} + +If ($(Get-WindowsOptionalFeature -Online -FeatureName 'VirtualMachinePlatform').State -Ne "Enabled") { + Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName 'VirtualMachinePlatform' + Write-Warning "Need restart to enable virtual machine platform`r`nPress y to restart or press any key to exit" + $Key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + If ("y" -Eq $Key.Character) { + Restart-Computer -Confirm + } + Else { + exit 1 + } +} + +[xml]$Xml = Get-Content ".\AppxManifest.xml"; +$Name = $Xml.Package.Identity.Name; +Write-Output "Installing $Name version: $($Xml.Package.Identity.Version)" +$ProcessorArchitecture = $Xml.Package.Identity.ProcessorArchitecture; +$Dependencies = $Xml.Package.Dependencies.PackageDependency; +$Dependencies | ForEach-Object { + $InstalledVersion = Get-InstalledDependencyVersion -Name $_.Name -ProcessorArchitecture $ProcessorArchitecture; + If ( $InstalledVersion -Lt $_.MinVersion ) { + If ($env:WT_SESSION) { + $env:WT_SESSION = $null + Write-Output "Dependency should be installed but Windows Terminal is in use. Restarting to conhost.exe" + Start-Process conhost.exe -Args "powershell.exe -ExecutionPolicy Bypass -Command Set-Location '$PSScriptRoot'; &'$PSCommandPath'" + exit 1 + } + Write-Output "Dependency package $($_.Name) $ProcessorArchitecture required minimum version: $($_.MinVersion). Installing...." + Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path "$($_.Name)_$ProcessorArchitecture.appx" + } + Else { + Write-Output "Dependency package $($_.Name) $ProcessorArchitecture current version: $InstalledVersion. Nothing to do." + } +} + +$Installed = $null +$Installed = Get-AppxPackage -Name $Name + +If (($null -Ne $Installed) -And (-Not ($Installed.IsDevelopmentMode))) { + Write-Warning "There is already one installed WSA. Please uninstall it first.`r`nPress y to uninstall existing WSA or press any key to exit" + $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + If ("y" -Eq $key.Character) { + Clear-Host + Remove-AppxPackage -Package $Installed.PackageFullName + } + Else { + exit 1 + } +} + +If (Test-CommandExist WsaClient) { + Write-Output "Shutting down WSA...." + Start-Process WsaClient -Wait -Args "/shutdown" +} +Stop-Process -Name "WsaClient" -ErrorAction SilentlyContinue +Write-Output "Installing MagiskOnWSA...." +Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml +If ($?) { + Finish +} +ElseIf ($null -Ne $Installed) { + Write-Error "Failed to update.`r`nPress any key to uninstall existing installation while preserving user data.`r`nTake in mind that this will remove the Android apps' icon from the start menu.`r`nIf you want to cancel, close this window now." + $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') + Clear-Host + Remove-AppxPackage -PreserveApplicationData -Package $Installed.PackageFullName + Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml + If ($?) { + Finish + } +} +Write-Output "All Done!`r`nPress any key to exit" +$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') diff --git a/installer/MakePri.ps1 b/installer/MakePri.ps1 new file mode 100644 index 0000000000..0103a6d959 --- /dev/null +++ b/installer/MakePri.ps1 @@ -0,0 +1,70 @@ +# 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 . +# +# Copyright (C) 2023 LSPosed Contributors +# + +$Host.UI.RawUI.WindowTitle = "Merging resources...." +If ((Test-Path -Path "pri") -Eq $true -And (Test-Path -Path "xml") -Eq $true) { + $AppxManifestFile = ".\AppxManifest.xml" + Copy-Item .\resources.pri -Destination ".\pri\resources.pri" | Out-Null + $ProcNew = Start-Process -PassThru makepri.exe -NoNewWindow -Args "new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o" + $null = $ProcNew.Handle + $ProcNew.WaitForExit() + If ($ProcNew.ExitCode -Ne 0) { + Write-Warning "Failed to merge resources from pris`r`nTrying to dump pris to priinfo...." + New-Item -Path "." -Name "priinfo" -ItemType "directory" + Clear-Host + $i = 0 + $PriItem = Get-Item ".\pri\*" -Include "*.pri" + Write-Output "Dumping resources...." + $Processes = ForEach ($Item in $PriItem) { + Start-Process -PassThru -WindowStyle Hidden makepri.exe -Args "dump /if $($Item | Resolve-Path -Relative) /o /es .\pri\resources.pri /of .\priinfo\$($Item.Name).xml /dt detailed" + $i = $i + 1 + $Completed = ($i / $PriItem.count) * 100 + Write-Progress -Activity "Dumping resources" -Status "Dumping $($Item.Name):" -PercentComplete $Completed + } + $Processes | Wait-Process + Write-Progress -Activity "Dumping resources" -Status "Ready" -Completed + Clear-Host + Write-Output "Creating pri from dumps...." + $ProcNewFromDump = Start-Process -PassThru -NoNewWindow makepri.exe -Args "new /pr .\priinfo /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o" + $null = $ProcNewFromDump.Handle + $ProcNewFromDump.WaitForExit() + Remove-Item 'priinfo' -Recurse + If ($ProcNewFromDump.ExitCode -Ne 0) { + Write-Error "Failed to create resources from priinfos" + exit 1 + } + } + + $ProjectXml = [xml](Get-Content $AppxManifestFile) + $ProjectResources = $ProjectXml.Package.Resources; + $(Get-Item .\xml\* -Exclude "priconfig.xml" -Include "*.xml") | ForEach-Object { + $($([xml](Get-Content $_)).Package.Resources.Resource) | ForEach-Object { + $ProjectResources.AppendChild($($ProjectXml.ImportNode($_, $true))) + } + } + $ProjectXml.Save($AppxManifestFile) + Remove-Item 'pri' -Recurse + Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^pri$' -NotMatch) + Remove-Item 'xml' -Recurse + Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^xml$' -NotMatch) + Remove-Item 'makepri.exe' + Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'makepri.exe' -NotMatch) + Remove-Item $PSCommandPath -Force + Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'MakePri.ps1' -NotMatch) + exit 0 +} diff --git a/installer/Run.bat b/installer/Run.bat new file mode 100644 index 0000000000..f04fee8fab --- /dev/null +++ b/installer/Run.bat @@ -0,0 +1,30 @@ +:: 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 . +:: +:: Copyright (C) 2023 LSPosed Contributors +:: + +@echo off +%~d0 +cd "%~dp0" +if not exist Install.ps1 ( + echo "Install.ps1" is not found. + echo Press any key to exit + pause>nul + exit 1 +) else ( + start powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1 + exit +) diff --git a/linker/aarch64/libc.so b/linker/aarch64/libc.so deleted file mode 100644 index 6f4ec47e24..0000000000 Binary files a/linker/aarch64/libc.so and /dev/null differ diff --git a/linker/aarch64/libdl.so b/linker/aarch64/libdl.so deleted file mode 100644 index 15cfd68f0b..0000000000 Binary files a/linker/aarch64/libdl.so and /dev/null differ diff --git a/linker/aarch64/libm.so b/linker/aarch64/libm.so deleted file mode 100644 index c129e26384..0000000000 Binary files a/linker/aarch64/libm.so and /dev/null differ diff --git a/linker/aarch64/linker64 b/linker/aarch64/linker64 deleted file mode 100755 index eeca0b8bc1..0000000000 Binary files a/linker/aarch64/linker64 and /dev/null differ diff --git a/linker/x86_64/libc.so b/linker/x86_64/libc.so deleted file mode 100644 index 748c48ca07..0000000000 Binary files a/linker/x86_64/libc.so and /dev/null differ diff --git a/linker/x86_64/libdl.so b/linker/x86_64/libdl.so deleted file mode 100644 index 8b24897c51..0000000000 Binary files a/linker/x86_64/libdl.so and /dev/null differ diff --git a/linker/x86_64/libm.so b/linker/x86_64/libm.so deleted file mode 100644 index 7bf99e88d0..0000000000 Binary files a/linker/x86_64/libm.so and /dev/null differ diff --git a/linker/x86_64/linker64 b/linker/x86_64/linker64 deleted file mode 100755 index 894beae3d6..0000000000 Binary files a/linker/x86_64/linker64 and /dev/null differ diff --git a/scripts/build.sh b/scripts/build.sh index 58dbf4dca4..4ff2c29085 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with MagiskOnWSALocal. If not, see . # -# Copyright (C) 2022 LSPosed Contributors +# Copyright (C) 2024 LSPosed Contributors # if [ ! "$BASH_VERSION" ]; then @@ -28,30 +28,35 @@ if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then exit 1 fi cd "$(dirname "$0")" || exit 1 -trap umount_clean EXIT +# export TMPDIR=$HOME/.cache/wsa +if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then + mkdir -p "$TMPDIR" +fi WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1 + DOWNLOAD_DIR=../download DOWNLOAD_CONF_NAME=download.list -OUTPUT_DIR=../output -MOUNT_DIR="$WORK_DIR"/system -umount_clean() { - if [ -d "$MOUNT_DIR" ]; then - echo "Cleanup Work Directory" - if [ -d "$MOUNT_DIR/vendor" ]; then - sudo umount "$MOUNT_DIR"/vendor - fi - if [ -d "$MOUNT_DIR/product" ]; then - sudo umount "$MOUNT_DIR"/product - fi - if [ -d "$MOUNT_DIR/system_ext" ]; then - sudo umount "$MOUNT_DIR"/system_ext - fi - sudo umount "$MOUNT_DIR" - sudo rm -rf "${WORK_DIR:?}" - else - rm -rf "${WORK_DIR:?}" +PYTHON_VENV_DIR="$(dirname "$PWD")/python3-env" + +dir_clean() { + rm -rf "${WORK_DIR:?}" + if [ "$TMPDIR" ] && [ -d "$TMPDIR" ]; then + echo "Cleanup Temp Directory" + rm -rf "${TMPDIR:?}" + unset TMPDIR + fi + rm -f "${DOWNLOAD_DIR:?}/$DOWNLOAD_CONF_NAME" + if [ "$(python3 -c 'import sys ; print( 1 if sys.prefix != sys.base_prefix else 0 )')" = "1" ]; then + echo "deactivate python3 venv" + deactivate fi } +trap dir_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" @@ -62,31 +67,33 @@ clean_download() { rm -f "${MAGISK_PATH:?}" fi if [ "$CLEAN_DOWNLOAD_GAPPS" ]; then - rm -f "${GAPPS_PATH:?}" + rm -f "${GAPPS_IMAGE_PATH:?}" + rm -f "${GAPPS_RC_PATH:?}" + fi + if [ "$CLEAN_DOWNLOAD_KERNELSU" ]; then + rm -f "${KERNELSU_PATH:?}" + rm -f "${KERNELSU_INFO:?}" fi fi } abort() { + [ "$1" ] && echo -e "ERROR: $1" echo "Build: an error has occurred, exit" if [ -d "$WORK_DIR" ]; then - umount_clean + echo -e "\nCleanup Work Directory" + dir_clean fi clean_download exit 1 } trap abort INT TERM -function Gen_Rand_Str { - tr -dc 'a-zA-Z0-9' "$KERNELSU_INFO" + fi + if [ "$HAS_GAPPS" ]; then + update_gapps_files_name + python3 generateGappsLink.py "$ARCH" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" "$ANDROID_API" "$GAPPS_IMAGE_NAME" || abort + fi + if [ -f "$DOWNLOAD_DIR/$DOWNLOAD_CONF_NAME" ]; then + echo "Downloading 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 + abort "We have encountered an error while downloading files." fi - else - echo "The $GAPPS_BRAND zip package does not exist." - abort fi - echo -e "Extract done\n" fi - -echo "Expand images" - -e2fsck -yf "$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 -yf "$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) )) +declare -A FILES_CHECK_LIST=([xaml_PATH]="$xaml_PATH" [vclibs_PATH]="$vclibs_PATH" [UWPVCLibs_PATH]="$UWPVCLibs_PATH") +if [ "$ROOT_SOL" = "magisk" ]; then + FILES_CHECK_LIST+=(["MAGISK_PATH"]="$MAGISK_PATH" ["CUST_PATH"]="$CUST_PATH") fi -resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort - -e2fsck -yf "$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) )) +if [ "$ROOT_SOL" = "kernelsu" ]; then + update_ksu_zip_name + FILES_CHECK_LIST+=(["KERNELSU_PATH"]="$KERNELSU_PATH") fi -if [ -f "$MAGISK_PATH" ]; then - SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) )) +if [ "$HAS_GAPPS" ]; then + update_gapps_files_name + FILES_CHECK_LIST+=(["GAPPS_IMAGE_PATH"]="$GAPPS_IMAGE_PATH" ["GAPPS_RC_PATH"]="$GAPPS_RC_PATH") fi -if [ -d "../$ARCH/system" ]; then - SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) )) +for i in "${FILES_CHECK_LIST[@]}"; do + if [ ! -f "$i" ]; then + echo "Offline mode: missing [$i]" + FILE_MISSING="1" + fi +done +if [ "$FILE_MISSING" ]; then + abort "Some files are missing" fi -resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort - -e2fsck -yf "$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 -o loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort -sudo mount -o loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort -sudo mount -o 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} | grep -e amazon -e venezia | sudo xargs rm -rf +if [ "$ROOT_SOL" = "magisk" ]; then + echo "Extracting Magisk" + if [ -f "$MAGISK_PATH" ]; then + MAGISK_VERSION_NAME="" + MAGISK_VERSION_CODE=0 + if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then + CLEAN_DOWNLOAD_MAGISK=1 + abort "Unzip Magisk failed, is the download incomplete?" + fi + # shellcheck disable=SC1090 + source "$WSA_WORK_ENV" || abort + if [ "$MAGISK_VERSION_CODE" -lt 26000 ] && [ "$MAGISK_VER" != "stable" ] && [ -z ${CUSTOM_MAGISK+x} ]; then + abort "Please install Magisk 26.0+" + fi + chmod +x "$WORK_DIR/magisk/magiskboot" || abort + elif [ -z "${CUSTOM_MAGISK+x}" ]; then + abort "The Magisk zip package does not exist, is the download incomplete?" + else + abort "The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder." + fi echo -e "done\n" fi -if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then - echo "Integrate Magisk" - sudo mkdir "$MOUNT_DIR"/sbin - sudo chcon --reference "$MOUNT_DIR"/init.environ.rc "$MOUNT_DIR"/sbin - 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 -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 -sed -i -zE "s//\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po ']*/>' | 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" - -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 dir sudo find "$MOUNT_DIR"/system/priv-app/dir -type d -exec chmod 0755 {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/priv-app/dir -type f -exec chmod 0644 {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/priv-app/dir -exec chown root:root {} \; -find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/priv-app/dir -exec chcon --reference="$MOUNT_DIR"/system/priv-app {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -type f -exec chmod 0644 {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -exec chown root:root {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/etc/permissions/file -type f -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions/platform.xml {} \; -echo -e "Add extra packages done\n" - -if [ "$GAPPS_BRAND" != 'none' ]; then - echo "Integrate GApps" - - find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo chmod 0755 {} \; - find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec sudo 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 + if [ -f "$WORK_DIR/magisk/init-ld" ]; then + "$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/init-ld" "$WORK_DIR/magisk/init-ld.xz" + unset SKIPINITLD 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 file sudo find "$MOUNT_DIR"/product/overlay/file -type f -exec chcon --reference="$MOUNT_DIR"/product/overlay/FontNotoSerifSource/FontNotoSerifSourceOverlay.apk {} \; - - if [ "$GAPPS_BRAND" = "OpenGApps" ]; then - find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/app/dir -type d -exec chcon --reference="$MOUNT_DIR"/system/app {} \; - find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/framework/dir -type d -exec chcon --reference="$MOUNT_DIR"/system/framework {} \; - find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/priv-app/dir -type d -exec chcon --reference="$MOUNT_DIR"/system/priv-app {} \; - find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/app/file -type f -exec chcon --reference="$MOUNT_DIR"/system/app/KeyChain/KeyChain.apk {} \; - find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/framework/file -type f -exec chcon --reference="$MOUNT_DIR"/system/framework/ext.jar {} \; - find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system/priv-app/file -type f -exec chcon --reference="$MOUNT_DIR"/system/priv-app/Shell/Shell.apk {} \; - find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/etc/dir -type d -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions {} \; - find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system/etc/dir -type f -exec chcon --reference="$MOUNT_DIR"/system/etc/permissions {} \; + "$WORK_DIR/magisk/magiskboot" compress=xz "$MAGISK_PATH" "$WORK_DIR/magisk/stub.xz" + "$WORK_DIR/magisk/magiskboot" cpio "$WORK_DIR/wsa/$ARCH/Tools/initrd.img" \ + "mv /init /wsainit" \ + "add 0750 /lspinit ../bin/$ARCH/lspinit" \ + "ln /lspinit /init" \ + "add 0750 /magiskinit $WORK_DIR/magisk/magiskinit" \ + "mkdir 0750 overlay.d" \ + "mkdir 0750 overlay.d/sbin" \ + "$SINGLEABI add 0644 overlay.d/sbin/magisk64.xz $WORK_DIR/magisk/magisk64.xz" \ + "$SINGLEABI add 0644 overlay.d/sbin/magisk32.xz $WORK_DIR/magisk/magisk32.xz" \ + "$SKIP add 0644 overlay.d/sbin/magisk.xz $WORK_DIR/magisk/magisk.xz" \ + "$SKIPINITLD add 0644 overlay.d/sbin/init-ld.xz $WORK_DIR/magisk/init-ld.xz" \ + "add 0644 overlay.d/sbin/stub.xz $WORK_DIR/magisk/stub.xz" \ + "mkdir 000 .backup" \ + "add 000 overlay.d/init.lsp.magisk.rc init.lsp.magisk.rc" \ + "add 000 overlay.d/sbin/post-fs-data.sh post-fs-data.sh" \ + "add 000 overlay.d/sbin/lsp_cust.img $CUST_PATH" \ + || abort "Unable to patch initrd" +elif [ "$ROOT_SOL" = "kernelsu" ]; then + echo "Extracting KernelSU" + # shellcheck disable=SC1090 + source "${KERNELSU_INFO:?}" || abort + echo "WSA Kernel Version: $KERNEL_VER" + echo "KernelSU Version: $KERNELSU_VER" + if ! unzip "$KERNELSU_PATH" -d "$WORK_DIR/kernelsu"; then + CLEAN_DOWNLOAD_KERNELSU=1 + abort "Unzip KernelSU failed, package is corrupted?" + fi + if [ "$ARCH" = "x64" ]; then + mv "$WORK_DIR/kernelsu/bzImage" "$WORK_DIR/kernelsu/kernel" + elif [ "$ARCH" = "arm64" ]; then + mv "$WORK_DIR/kernelsu/Image" "$WORK_DIR/kernelsu/kernel" + fi + echo "Integrate KernelSU" + mv "$WORK_DIR/wsa/$ARCH/Tools/kernel" "$WORK_DIR/wsa/$ARCH/Tools/kernel_origin" + cp "$WORK_DIR/kernelsu/kernel" "$WORK_DIR/wsa/$ARCH/Tools/kernel" +fi +echo -e "done\n" +if [ "$HAS_GAPPS" ]; then + update_gapps_files_name + if [ -f "$GAPPS_IMAGE_PATH" ] && [ -f "$GAPPS_RC_PATH" ]; then + echo "Integrating GApps" + "$WORK_DIR/magisk/magiskboot" cpio "$WORK_DIR/wsa/$ARCH/Tools/initrd.img" \ + "add 000 overlay.d/gapps.rc $GAPPS_RC_PATH" \ + "add 000 overlay.d/sbin/lsp_gapps.img $GAPPS_IMAGE_PATH" \ + || abort "Unable to patch initrd" + echo -e "done\n" else - find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/app/item -type d -exec chcon --reference="$MOUNT_DIR"/product/app {} \; - find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/etc/item -type d -exec chcon --reference="$MOUNT_DIR"/product/etc {} \; - find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/priv-app/item -type d -exec chcon --reference="$MOUNT_DIR"/product/priv-app {} \; - find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/framework/item -type d -exec chcon --reference="$MOUNT_DIR"/product/framework {} \; - - find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/app/item -type f -exec chcon --reference="$MOUNT_DIR"/product/app/HomeApp/HomeApp.apk {} \; - find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/etc/item -type f -exec chcon --reference="$MOUNT_DIR"/product/etc/permissions/com.android.settings.intelligence.xml {} \; - find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/priv-app/item -type f -exec chcon --reference="$MOUNT_DIR"/product/priv-app/SettingsIntelligence/SettingsIntelligence.apk {} \; - find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I item sudo find "$MOUNT_DIR"/product/framework/item -type f -exec chcon --reference="$MOUNT_DIR"/product/etc/permissions/com.android.settings.intelligence.xml {} \; - find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/system_ext/etc/permissions/file -type f -exec chcon --reference="$MOUNT_DIR"/system_ext/etc/permissions/com.android.systemui.xml {} \; - - sudo chcon --reference="$MOUNT_DIR"/product/lib64/libjni_eglfence.so "$MOUNT_DIR"/product/lib - find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/product/lib/file -exec chcon --reference="$MOUNT_DIR"/product/lib64/libjni_eglfence.so {} \; - find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I file sudo find "$MOUNT_DIR"/product/lib64/file -type f -exec chcon --reference="$MOUNT_DIR"/product/lib64/libjni_eglfence.so {} \; - find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system_ext/priv-app/dir -type d -exec chcon --reference="$MOUNT_DIR"/system_ext/priv-app {} \; - find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system_ext/etc/dir -type d -exec chcon --reference="$MOUNT_DIR"/system_ext/etc {} \; - find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I dir sudo find "$MOUNT_DIR"/system_ext/priv-app/dir -type f -exec chcon --reference="$MOUNT_DIR"/system_ext/priv-app/Settings/Settings.apk {} \; + abort "The GApps package does not exist." fi - - 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 patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort - chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort - 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" || abort - echo -e "Integrate GApps done\n" fi -if [ "$GAPPS_BRAND" != 'none' ]; then - echo "Fix GApps prop" - sudo python3 fixGappsProp.py "$MOUNT_DIR" || abort - echo -e "done\n" +if [ "$REMOVE_AMAZON" ]; then + rm -f "$WORK_DIR/wsa/$ARCH/apex/"mado*.apex || abort fi -echo "Umount images" -sudo find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \; -sudo umount "$MOUNT_DIR"/vendor -sudo umount "$MOUNT_DIR"/product -sudo umount "$MOUNT_DIR"/system_ext -sudo umount "$MOUNT_DIR" +echo "Removing signature and add scripts" +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 "$UWPVCLibs_PATH" "$xaml_PATH" "$WORK_DIR/wsa/$ARCH" || abort +cp "../bin/$ARCH/makepri.exe" "$WORK_DIR/wsa/$ARCH" || abort +cp "../xml/priconfig.xml" "$WORK_DIR/wsa/$ARCH/xml/" || abort +cp ../installer/MakePri.ps1 "$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 "done\n" -echo "Shrink images" -e2fsck -yf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort -resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system.img || abort -e2fsck -yf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort -resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort -e2fsck -yf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort -resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/product.img || abort -e2fsck -yf "$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 -tee "$WORK_DIR"/wsa/"$ARCH"/Install.ps1 <