Introducing a new way to review your PRs.

Read the announcement

mustardchef / wsabuilds

Run Windows Subsystem For Android on your Windows 10 and Windows 11 PC using prebuilt binaries with Google Play Store (MindTheGapps) and/or Magisk or KernelSU (root solutions) built in.

View on GitHub

12 documents · Updated Nov 16, 2026

docs / magiskonwsaold-build-pipeline

Legacy MagiskOnWSAOld build pipeline

Overview

MagiskOnWSAOld/scripts/** is the retained legacy build pipeline for old WSA builds. Its entry point is MagiskOnWSAOld/…/build.sh, which runs from the scripts directory, creates a temporary build workspace, writes cross-step state to WSA_WORK_ENV, downloads artifacts into MagiskOnWSAOld/download, modifies unpacked WSA system images, and emits the final folder or archive under MagiskOnWSAOld/output. Treat this as separate from the active MagiskOnWSA pipeline: these scripts carry their own option matrix, download sources, image layout assumptions, root/GApps integration logic, and installer patching paths, so changes here should be reviewed as legacy-build behavior rather than assumed to mirror active scripts with similar names.

Covered scripts map to these responsibilities:

  • MagiskOnWSAOld/…/build.sh orchestrates the end-to-end build. It validates options (--arch, --release-type, --magisk-ver, --gapps-brand, --custom-model, --root-sol, --compress-format, --after-compress, --remove-amazon), activates MagiskOnWSAOld/python3-env when present, generates download lists, invokes aria2c, extracts WSA/Magisk/KernelSU/MindTheGapps payloads, converts WSA VHDX images to raw images, mounts either EROFS via MagiskOnWSAOld/bin/EROFS/* plus overlayfs or EXT4 via loop mounts, injects root/GApps/extra packages, patches properties, repacks images back to VHDX, updates installer resources, and records GitHub Actions outputs through $GITHUB_OUTPUT.
  • MagiskOnWSAOld/…/generateWSALinks.py talks to Microsoft FE3 delivery SOAP endpoints using XML templates from MagiskOnWSAOld/…/GetCookie.xml, MagiskOnWSAOld/…/WUIDRequest.xml, and MagiskOnWSAOld/…/FE3FileUrl.xml. It appends aria2 entries for the selected WSA bundle, Microsoft.UI.Xaml, VCLibs, and UWPDesktop VCLibs to download.list, and writes WSA_VER/WSA_MAJOR_VER into WSA_WORK_ENV. For --release-type latest, build.sh bypasses this script and pulls from bubbles-wow/WSA-Archive plus hard-coded Xaml/VCLibs URLs.
  • MagiskOnWSAOld/…/generateMagiskLink.py resolves the Magisk ZIP URL for stable, beta, canary, debug, delta, or alpha, then appends an aria2 entry named magisk-<version>.zip. It uses Android-like request headers and falls back to jsdelivr for the topjohnwu and HuskyDG JSON manifests.
  • MagiskOnWSAOld/…/generateKernelSULink.py resolves a fixed KernelSU release tag (v2.1.2) for a WSA kernel version chosen in build.sh, appends both the kernel ZIP and KernelSU.apk to the aria2 list, and writes KERNELSU_VER into WSA_WORK_ENV for later artifact naming.
  • MagiskOnWSAOld/…/generateGappsLink.py resolves the latest YT-Advanced/MindTheGappsBuilder asset matching Android 13 and the requested architecture, then appends it under the build-selected MindTheGapps-<arch>-13.0.zip name.
  • MagiskOnWSAOld/…/extractWSA.py unpacks the architecture-specific WSA package from the downloaded MSIX bundle into the temporary wsa/<arch> tree, extracts language/scale resource packages into pri and xml, and writes WSA_VER/WSA_REL into the env file.
  • MagiskOnWSAOld/…/extractMagisk.py unpacks architecture-specific Magisk shared libraries from the Magisk APK/ZIP into WORK_DIR/magisk, normalizes them into executable names expected by build.sh (magisk64, magisk32, magiskinit, magiskpolicy, busybox, etc.), extracts host-side magiskpolicy, and records MAGISK_VERSION_NAME/MAGISK_VERSION_CODE in WSA_WORK_ENV.
  • MagiskOnWSAOld/…/fixGappsProp.py rewrites build properties after GApps integration when --custom-model is not none. It edits build.prop files under the mounted WSA root (system, vendor, vendor/odm/etc, and vendor/vendor_dlkm/etc) to set Google brand/manufacturer/device/model values and recompute build descriptions and fingerprints.
  • MagiskOnWSAOld/…/requirements.txt declares only the Python packages used by the helper scripts: requests and packaging.

The legacy pipeline’s main data flow is file based. Link generators append aria2-compatible triplets to MagiskOnWSAOld/download/download.list; extraction helpers and link generators communicate discovered versions by mutating the shell-sourced WSA_WORK_ENV; build.sh moves the unpacked WSA tree through temporary raw images and mounted partitions; the final artifact name is derived from WSA_VER, WSA_REL, selected root solution, GApps state, custom model, and Amazon removal state. The build also reaches outside scripts for fixed assets: XML request/resource files under MagiskOnWSAOld/xml, installer scripts under MagiskOnWSAOld/installer, EROFS tools under MagiskOnWSAOld/bin/EROFS, and architecture-specific extra system packages under MagiskOnWSAOld/<arch>/system.

Root and GApps handling is embedded in build.sh rather than delegated to separate modules. Magisk integration copies the normalized files from extractMagisk.py into debug_ramdisk, appends loadpolicy.sh, modifies vendor_file_contexts, uses host-side magiskpolicy to patch precompiled_sepolicy, and appends Magisk lifecycle hooks to init rc files. KernelSU integration instead replaces Tools/kernel with the kernel unpacked from the KernelSU ZIP. MindTheGapps integration copies system_ext and product payloads, repairs ownership/modes/xattrs, and applies a fixed set of SELinux allow rules with Magisk policy tooling even when Magisk is used only as a policy helper for GApps.

Image handling differs by detected filesystem type in build.sh. EROFS images are mounted read-only with fuse.erofs, overlaid with writable upperdirs, then rebuilt with mkfs.erofs after modifications. EXT4 images are converted to writable form, resized for expected additions, mounted directly, shrunk after unmount, then all partitions are converted back to fixed VHDX with qemu-img. This means changes to injected files, partition paths, or SELinux labels can affect both filesystem branches and must be checked in both paths.

Coupling

  • If MagiskOnWSAOld/…/build.sh changes any generated filename, also update the corresponding helper call and output name: generateWSALinks.py, generateMagiskLink.py, generateKernelSULink.py, and generateGappsLink.py append exact out= names that build.sh later tests in MagiskOnWSAOld/download.
  • If the contents or syntax of WSA_WORK_ENV changes, update every local Prop implementation in generateWSALinks.py, generateKernelSULink.py, extractWSA.py, and extractMagisk.py; build.sh sources the file as shell assignments, while the Python helpers rewrite it as simple key=value lines.
  • If WSA bundle filenames or Microsoft FE3 response formats change, review generateWSALinks.py and extractWSA.py together: the former detects the latest WSA package and writes WSA version state from FE3 metadata, while the latter parses extracted package filenames to set WSA_VER and WSA_REL used by artifact naming.
  • If KernelSU support is extended to a new WSA release, update both build.sh and generateKernelSULink.py: build.sh maps WSA_MAJOR_VER to a kernel version and output filename before the generator searches the fixed KernelSU release assets for that exact kernel string.
  • If Magisk APK packaging changes, update extractMagisk.py and the Magisk integration block in build.sh together. The extractor normalizes library names from APK paths, and build.sh assumes those normalized names exist when patching interpreters, copying to debug_ramdisk, and applying SELinux policy.
  • If fixGappsProp.py changes property keys or fingerprint construction, verify the custom-model map and invocation in build.sh; the shell passes product codename/model strings and expects the mounted WSA root layout used by the helper.
  • If installer files or launch URIs change, review the installer patching section in build.sh. It mutates MagiskOnWSAOld/installer/Install.ps1 and copies MagiskOnWSAOld/installer/<arch>/Install.ps1, MakePri.ps1, and Run.bat into the output package, so path or URI drift can silently produce stale installers.

Risks

  • MagiskOnWSAOld/…/build.sh edits files outside the temporary workspace, including MagiskOnWSAOld/installer/Install.ps1, with sed -i. If this legacy script is run repeatedly or concurrently, installer comments/URI substitutions can accumulate in the source tree and affect later old builds.
  • MagiskOnWSAOld/…/build.sh has separate EROFS and EXT4 mount/repack branches. If a change is tested only against one filesystem type, the other branch can still fail to mount, label, resize, or repack WSA images.
  • MagiskOnWSAOld/…/generateGappsLink.py assumes a matching MindTheGapps asset exists and prints link after the loop. If GitHub returns a successful release without a matching Android 13 architecture ZIP, the script can fail at runtime before writing the aria2 entry.
  • MagiskOnWSAOld/…/generateKernelSULink.py hard-codes KernelSU release tag v2.1.2, while build.sh hard-codes supported WSA major versions and kernel versions. New WSA builds can be rejected or receive no kernel asset until both mappings are updated.
  • MagiskOnWSAOld/…/extractWSA.py only assigns zip_path when it sees a bundle entry whose filename contains the requested architecture. If Microsoft package naming changes or the wrong architecture is downloaded, the final extraction step can reference an unset path instead of failing early with a clear missing-package error.