JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
9.13k stars 494 forks source link

The existing 'scan for games' utility can be modified to find WSA apps easily. These should not be considered a separate library. #3061

Closed BurntVoxel closed 6 months ago

BurntVoxel commented 2 years ago

Feature description

All apps for WSA are given a Start shortcut that points to WsaClient.exe, and specify the app with a path using the WSA:// protocol. This knowledge can be used to let the automatic scan find apps for WSA, which are not detected as of now.

Background

For the unfamiliar, Windows 11 includes two standard features that are basically™️ reverse WINE: Windows Subsystem for Linux or WS for Android. I will focus on WSA because [A] I actually know how to install Android games on it but not Linux and [B] I have a feeling that there are more Android games that have no Windows port than Linux games in total.

Furthermore, I strongly recommend against moving this idea to a library addon, because WSA is much more similar to an emulator like RetroArch than to DRM considered libraries like Steam for one reason: While you can download trusted apps from the Amazon Appstore partnership, you can also install APKs from the wild, or even other markets like F-Droid. (It is a little tricky for now, but I have a feeling it'll get easier; you can already find tools from the MS Store that let you install APK files as apps with a single click.)

// It might be good to think about addons to integrate the Amazon Appstore or Google Play for WSA (when that eventually comes out), but this isn't about that: this is about finding installed WSA apps regardless of whether or not they're from the wild.

Problem

The tool for automatically scanning for locally installed apps does not find WSA apps at all. Same bug may affect WSL, I'm unprepared to test.

Solution

Try searching for shortcuts in the Start Menu that point at WsaClient.exe, regardless of filename, but probably in the root of the user's one instead of the one for all users. Also keep an eye out for any URLs using the protocol WSA://. Also, the install process extracts icons to %LocalAppData%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState and names them App.ID.here.png and App.ID.here.ico. They're not as high-res as you'd expect, I'd automate looking up metadata online, use the link file's name as the query.

Example:

The behavior from testing how shortcuts from Amazon are created seems to be baked into Windows; APKs from the wild (tested on fDroid from file) and apps from other markets (tested on HyperRogue from fDroid) show the exact same behavior.

Notice the launch arguments: /launch wsa://com.rovio.baba. That's not just a URL, and not a file path, it's a link that opens WSA and names the requested app package. I tested this, it works. Just like steam:// links, except that I doubt it interprets a missing package ID as a search query. wsa://intentionally.invalid.ID does nothing.

Screenshots

No response

rcmaehl commented 6 months ago

Considering WSA being discontinued, this issue can likely be closed.

BurntVoxel commented 6 months ago

sad but true...