How mustardchef/wsabuilds works
Based on our review, WSABuilds is an engineering project that “repackages” the official Windows Subsystem for Android (WSA) – integrating custom elements like Magisk, KernelSU, and (optionally) Google Play Services (GMS) – so that users can get a modified, “rooted” and feature‐enhanced version of WSA. The repository includes a very detailed documentation branch, multiple subfolders for installer scripts, update check scripts, DLLs, previous versions (MagiskOnWSAOld), and even separate utilities for uninstallation and updates. The GitHub workflows in the .github folder automate the build process using different architecture targets (arm64, x64, etc.) while several Python, Bash, and PowerShell scripts are used to “patch” the original WSA package, inject custom libraries, and finally produce proper installation packages.
• Main “layers” or components
– Build Automation & CI/CD: Represented by the .github/workflows folder. This component coordinates multiple build pipelines and scheduling of update procedures to generate the customized WSA packages.
– Core Build/Integration Scripts: Several directories (MagiskOnWSA, MagiskOnWSAOld, and the many “scripts” folders) contain the core logic. For example, they include:
• Installer scripts (“Run.bat”, PowerShell “Install.ps1”, MakePri.ps1, etc.)
• Update Check scripts (in the “Update Check” folders)
• Extraction and modification scripts (extractMagisk.py, extractWSA.py, fixGappsProp.py, generate*Link.py, etc.)
– Binary & Resource Components: DLLs (in the DLL folder), CACerts, and XML configuration files are used to supply libraries and certificates.
– Documentation & Troubleshooting: The Documentation folder holds all usage guides, fix guides, and detailed instructions. Although not a “runtime” component in the deployed system, it is critical for maintenance.
– Utilities & Additional Tools: There are utilities (Uninstall Script, Update Script in the “WSABuilds Utilities” folder) that support maintenance tasks.
• Interactions and Data Flow
– Start with the official WSA base image (or build) which serves as the input.
– The Build Automation/CI/CD triggers execution of the Build & Integration Scripts. These scripts (often written in Python, PowerShell, Bash) first extract or modify the WSA files.
– Then, custom components (for root management like Magisk, KernelSU, and optionally GApps integration) are integrated into the official build.
– There is a patching stage provided by projects such as WSAPatch and MagiskOnWSALocal (whose code is integrated or referenced) that injects modification hooks.
– The updated files, binaries, installers, and required configurations (both DLLs and XML, certificates) are then repackaged into a final WSA package.
– Utilities such as update-check routines and uninstall scripts are maintained separately.
– Finally, the release artifacts are generated and made available (as shown in the Downloads section of the README).
• Architectural Patterns and Technologies
– A modular script-based “builder” design is used where each module (installer, patcher, update-checker) is a self-contained script or set of scripts.
– The system leverages continuous integration via GitHub Actions, so the “build” (or “CI”) layer is decoupled from the integration logic in scripts.
– The installer uses both batch (.bat) and PowerShell files to work on Windows while the scripts (in Python and Bash) handle multi-platform build concerns (such as compiling DLLs or XML configurations).
– There’s a clear separation between “core” code (in the MagiskOnWSA and related directories) and “support” documentation that explains fixes, usage, and troubleshooting.