Skip to content

Instantly share code, notes, and snippets.

@vhanla
Last active July 10, 2024 21:57
Show Gist options
  • Save vhanla/247ee77dd0cdd5449e02e2d517a13019 to your computer and use it in GitHub Desktop.
Save vhanla/247ee77dd0cdd5449e02e2d517a13019 to your computer and use it in GitHub Desktop.
Windows Subsystem for Android - WSA Client interesting params and stuff

WSA Client (wsaclient.exe) is the manager UI application for Windows 11's Windows Subsystem for Android platform and here I collect interesting stuff that I found in wsaclient.exe

  1. One instance application.

wsaclient.exe is the only application that runs, and handles params for different actions, like uninstall, launch APKs, restart, etc.

To check and block other instances, it uses MUTEX strings and it is this one (it might change in future versions)

Mutex = CreateMutexExW(0, L"{42CEB0DF-325A-4FBE-BBB6-C259A6C3F0BB}", 0, 0x1F0001u);

Just check for "{42CEB0DF-325A-4FBE-BBB6-C259A6C3F0BB}" to see if WSA is running, at least its client. WSAService is better, but mostly this one serves.

  1. WSA path Original path: %PROGRAMFILES%\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_1.7.32815.0_x64__8wekyb3d8bbwe\WsaClient\WsaClient.exe Shortcut accessible path: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\WsaClient.exe or %LOCALAPPDATA%\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\WsaClient.exe

NOTICE: version in original path changes accordingly, but shortcut path updates to it 3. Parameters

  • /deeplink wsa-client://developer-settings (starts debugging app settings)
  • /uninstall {package name} e.g /uninstall com.amazon.venezia
  • /restart (restarts WSA, not tested)
  • /launch wsa://{package name} (launches an app) e.g /launch wsa://com.amazon.venezia
  1. Registry entries

HKEY_CURRENT_USER \Software\Microsoft\WSA \VMLifeCycleMode HKEY_LOCAL_MACHINE,L"Software\Microsoft\WSA",L"VMLifeCycleMode",0x18u,0i64,&pvData,&pcbData); \OptionalDiagnosticDataEnabled, 0 // when you opt to send diagnostic data

  1. Interesting window creation

WndClass.lpfnWndProc = (WNDPROC)sub_1400389F0; WndClass.hInstance = (HINSTANCE)*((_QWORD *)::lpParam + 2); WndClass.lpszClassName = L"{1D0BDE36-7849-4135-AD13-8C75D8472111}"; WndClass.hCursor = LoadCursorW(0i64, (LPCWSTR)0x7F00); RegisterClassW(&WndClass); Window = CreateWindowExW( 0, L"{1D0BDE36-7849-4135-AD13-8C75D8472111}", &NameToResolve, 0, 0, 0, 0, 0, 0i64, 0i64, *((HINSTANCE *)lpParam + 2), lpParam);

  1. App Details (in Windows Registry) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall{package name} e.g HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\com.amazon.venezia \AndroidPackageName string (package name) \AndroidVersionCode string \DisplayIcon string (path to icon file) \DisplayName string \DisplayVersion string (version of the app) \EstimatedSize dword \InstallDate string e.g(YYYYmmdd) \ModifyPath string "C:\Users\vhanla\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\WsaClient.exe" /modify com.amazon.venezia \NoRepair dword default 1 \Publisher string \QuietUninstallString string "C:\Users\vhanla\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\WsaClient.exe" /uninstall com.amazon.venezia \UninstallString string "C:\Users\vhanla\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\WsaClient.exe" /uninstall com.amazon.venezia

SubKeys (optional) \Capabilities \URLAssociations \someuriname string e.g. wsa.hexvalues then use it to launch that app passing a param, e.g. feedly://params

@infinitepower18
Copy link

@quantumfrost WSAClient.exe /shutdown

@quantumfrost
Copy link

@quantumfrost WSAClient.exe /shutdown

Thank you!

@Aphexus
Copy link

Aphexus commented Jul 9, 2024

Is it possible to load a file using an android app?

I want to setup a .bat file to run an android ebook reader from sumatrapdf so I can read it in the android book reader rather than sumatrapdf(this is for TTS mainly even though I could probably find a windows app that does the same). In windows we obviously can run a command line and add the filename to load and it does it but this is not the case with android. I can copy over the file to the android drive but I would like to avoid having to hunt it in android to load it(wasted time).

E.g., I'd like to do something like:
WsaClient.exe /launch wsa://com.reader /loadFile:/Windows/Books/mypdf.pdf

or whatever.

@anonhostpi
Copy link

Not without ADB

AFAIK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment