https://github.com/cinit/WSAPatch Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} cinit / WSAPatch Public * Notifications * Fork 1.1k * Star 552 Make WSA(Windows Subsystem for Android) run on Windows 10. License Unlicense license 552 stars 1.1k forks Star Notifications * Code * Issues 11 * Pull requests 0 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights cinit/WSAPatch This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 3 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/c] Use Git or checkout with SVN using the web URL. [gh repo clone cinit/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @cinit cinit add action workflow ... 4b37620 Jan 21, 2023 add action workflow 4b37620 Git stats * 23 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows add action workflow January 21, 2023 22:55 original.dll.win11.22h2/x86_64 add DLLs from Windows 11 22H2 December 1, 2022 13:58 pic add screenshot December 2, 2022 14:10 .gitignore add DLLs from Windows 11 22H2 December 1, 2022 13:58 CMakeLists.txt add IAT hook December 1, 2022 13:43 ErrnoRestorer.h add IAT hook December 1, 2022 13:43 LICENSE Create LICENSE December 2, 2022 14:13 Log.cpp add IAT hook December 1, 2022 13:43 Log.h add IAT hook December 1, 2022 13:43 README.md update README January 19, 2023 20:55 README_zhs.md update README January 19, 2023 20:55 TimeUtils.cpp add IAT hook December 1, 2022 13:43 TimeUtils.h add IAT hook December 1, 2022 13:43 WsaPatch.cpp fix typo January 19, 2023 20:07 WsaPatch.h add IAT hook December 1, 2022 13:43 macros.h add IAT hook December 1, 2022 13:43 View code WSA patch for Windows 10 Instructions Notice About winhttp.dll Problems I met Screenshot README.md WSA patch for Windows 10 Zhong Wen Ban Ben This is a patch for WSA to enable WSA (Windows Subsystem for Android) to run on Windows 10. I have tested WSA 2210.40000.7.0 on Windows 10 22H2 10.0.19045.2311 and 2211.40000.10.0 on 10.0.19045.2364. Instructions 1. Make sure your Windows version is at least Windows 10 22H2 10.0.19045.2311. + You can check your Windows version with command winver. + If your Windows version is lower than 10.0.19045.2311, please update your Windows to at least 10.0.19045.2311. 2. Get WSA appx zip. You can do this by following instructions in https://github.com/LSPosed/MagiskOnWSALocal (You need to "build" this yourself with your local WSL2). 3. Get "icu.dll" from Windows 11 22H2. Note that you MUST use icu.dll from Windows 11. The icu.dll from Windows 10 will NOT work. (I have made a copy of these DLLs in the original.dll.win11.22h2 dir. They are digitally signed by Microsoft.) 4. Build WsaPatch.dll with source code in this repo. (Build with MSVC toolchain, not MinGW or something else.) 5. Patch icu.dll: add WsaPatch.dll as an import DLL as icu.dll. 6. Copy patched icu.dll and WsaPatch.dll to WsaClient dir. 7. Patch AppxManifest.xml. 1. Find TargetDeviceFamily node in AppxManifest.xml. Change the MinVersion from 10.0.22000.120 to 10.0.19045.2311. 2. Delete all nodes about "customInstall" extension (see below) in AppxManifest.xml. 8. Run "Run.bat" to register your WSA appx. 9. You should be able to run WSA now. If you don't want to build WsaPatch.dll and patch icu.dll yourself, you can download the prebuilt binaries from the release page. Notice 1. You can only install WSA on a NTFS partition, not on an exFAT partition. 2. You can NOT delete the WSA installation folder. What Add-AppxPackage -Register .\AppxManifest.xml does is to register an appx package with some existing unpackaged files, so you need to keep them as long as you want to use WSA. Check https:// learn.microsoft.com/en-us/powershell/module/appx/add-appxpackage? view=windowsserver2022-ps for more details. 3. You need to register your WSA appx package before you can run WSA (the 8th step in the instructions). For MagiskOnWSALocal users, you need to run Run.bat in the extracted dir. If the script fails, you can take the following steps for diagnosis (admin privilege required): 1. Open a PowerShell window and change working directory to your WSA directory. 2. Run Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml in PowerShell. This should fail with an ActivityID, which is a UUID required for the next step. 3. Run Get-AppPackageLog -ActivityID in PowerShell. This should print the log of the failed operation. 4. Check the log for the reason of failure and fix it. About winhttp.dll * WsaClient.exe does use GetProcAddress to get some functions from winhttp.dll. * Some functions exist in winhttp.dll of Windows 11 22H2, but not in Windows 10 22H2. * If you create a file EnableDebugConsole in WsaClient directory or set wsapatch::kDebug in WsaPatch.cpp to true, you will see the following message from log console. * If you copy a winhttp.dll from Windows 11 22H2 to WsaClient directory, WsaClient.exe will be able to find these functions. * WSA will still run even if you don't copy a winhttp.dll with these symbols. 12-10 16:16:29.474 W WsaPatch: -GetProcAddress: hModule=C:\WINDOWS\SYSTEM32\WINHTTP.dll(00007FFC64780000), lpProcName=WinHttpRegisterProxyChangeNotification, result=NULL 12-10 16:16:29.474 W WsaPatch: -GetProcAddress: hModule=C:\WINDOWS\SYSTEM32\WINHTTP.dll(00007FFC64780000), lpProcName=WinHttpUnregisterProxyChangeNotification, result=NULL 12-10 16:16:29.474 W WsaPatch: -GetProcAddress: hModule=C:\WINDOWS\SYSTEM32\WINHTTP.dll(00007FFC64780000), lpProcName=WinHttpGetProxySettingsEx, result=NULL 12-10 16:16:29.474 W WsaPatch: -GetProcAddress: hModule=C:\WINDOWS\SYSTEM32\WINHTTP.dll(00007FFC64780000), lpProcName=WinHttpGetProxySettingsResultEx, result=NULL 12-10 16:16:29.474 W WsaPatch: -GetProcAddress: hModule=C:\WINDOWS\SYSTEM32\WINHTTP.dll(00007FFC64780000), lpProcName=WinHttpFreeProxySettingsEx, result=NULL Problems I met 1. When using WSA 2209.40000.26.0, I was able to run applications in WSA, but I was not able to connect to WSA ADB after enabling Developer Mode, since netstat shows that no process is listening on port 58526. After I upgraded to WSA 2210.40000.7.0, I was able to connect to WSA ADB. 2. The WSA settings window does not hava a draggable title, but you can move the WSA window if you hold the cursor left near the "minimize" button, or press Alt+Space, then click "Move" in the context menu. #1 #2 3. If your WSA crashes(or suddenly disappears) when starting up, try to upgrade your Windows to Windows 10 22H2 10.0.19045.2311. (Someone has reported that WSA failed to start on 22H2 19045.2251, but worked after upgrading to 19045.2311.) If you encounter any problems or have any suggestions, please open an issue or pull request. Screenshot screenshot About Make WSA(Windows Subsystem for Android) run on Windows 10. Topics windows-10 win10 wsa windows-subsystem-for-android windows-subsystem-android Resources Readme License Unlicense license Stars 552 stars Watchers 8 watching Forks 1.1k forks Releases 3 20221210 Latest Dec 10, 2022 + 2 releases Languages * C++ 92.0% * C 7.0% * CMake 1.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.