hmlendea / gfn-electron

Linux Desktop client for Nvidia's GeForce NOW game streaming service
GNU General Public License v3.0
488 stars 61 forks source link

[BUG] --spoof-windows doesn't seem to work any more (Genshin Impact not visible) #201

Closed NettoHikari closed 8 months ago

NettoHikari commented 10 months ago

Describe the bug

Hey, guys.

Geforce NOW seems to have updated their checks for what platform a user is using. My wife likes to play Genshin Impact on her Linux Notebook and it worked fine until yesterday using Google Chrome with a Safari user agent or using Geforce NOW Electron by utilizing the --spoof-windows command line switch.

This workaround stopped working today.

Side note: Genshin Impact is definitely still available on GFN.

Does anyone have an idea how to fix this? Thank you very much and have a nice day!

- NH

To Reproduce

  1. Run GFN Electron with --spoof-windows flag
  2. Expect Genshin Impact (and perhaps other games that are limited to GFN on Windows) to appear
  3. Game doesn't appear

Screenshots

image

Operating System

Arch Linux

Desktop Environment

GNOME 44.3

Display Server

Wayland

Installation method

Flatpak

Version

1.13.0

Is this a fresh install of the app or an update from a past version?

Fresh Install (Tested on my own System)

Did this issue appear right away upon installation/updating, or spontaneously?

For me, right after Installation, for my Wife, right after updating

Additional context

No response

orion715 commented 10 months ago

I am seeing this too, i no longer have the higher resolution options I had yesterday.

OishiMula commented 10 months ago

Same here! Literally two days ago and no longer showing.

Doc-4 commented 10 months ago

Here to say the same, spoof option seems to fail.

kvakl-brodakl commented 10 months ago

Same. Used appimage. I suspect that the problem may be with navigator.userAgentData (which allows to get real userAgent platform, even if you spoof it with Windows one). I encountered this problem few month ago when trying to play on gfn through Chrome. I used --disable-features=UserAgentClientHint flag when running Chrome which seemed to solve the problem (it just disables userAgentData which in turn forces geforce to check spoofed user agent, believing that you are on windows). Maybe you can add support to such flag for gfn-electron and it may solve the problem. Would be great if you do )

NettoHikari commented 10 months ago

Good hint, thank you.

I used --disable-features=UserAgentClientHint flag when running Chrome which seemed to solve the problem (it just disables userAgentData which in turn forces geforce to check spoofed user agent, believing that you are on windows).

Does this still work, though? I just ran the Chrome flatpak (flatpak run com.google.Chrome --disable-features=UserAgentClientHint) and GFN still seems to know that I'm not on Windows.

Doc-4 commented 10 months ago

I believe that argument is something for chrome, not necessarily GFN. Unless GFN has all these flags built in it will probably require a fix in a new release. I don't know much about UA hints or I'd try to troubleshoot it myself

kvakl-brodakl commented 10 months ago

Does this still work, though? I just ran the Chrome flatpak (flatpak run com.google.Chrome --disable-features=UserAgentClientHint) and GFN still seems to know that I'm not on Windows.

Did you install user agent switcher extension with windows user agent? I use this one: https://chrome.google.com/webstore/detail/user-agent-switcher/kchfmpdcejfkipopnolndinkeoipnoia Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

kvakl-brodakl commented 10 months ago

I believe that argument is something for chrome, not necessarily GFN. Unless GFN has all these flags built in it will probably require a fix in a new release. I don't know much about UA hints or I'd try to troubleshoot it myself

I'm not sure on which logic gfn-electron works. I noticed in logs that it uses UserAgent, so I thought that maybe it can also pass this flag. (It doesn't work now, I tried passing this flag to gfn-electron and it just ignores it I think)

Galcian79 commented 10 months ago

Does this still work, though? I just ran the Chrome flatpak (flatpak run com.google.Chrome --disable-features=UserAgentClientHint) and GFN still seems to know that I'm not on Windows.

Did you install user agent switcher extension with windows user agent? I use this one: https://chrome.google.com/webstore/detail/user-agent-switcher/kchfmpdcejfkipopnolndinkeoipnoia Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

I just did that on Chrome. It still detects it as non Windows.

Galcian79 commented 10 months ago

BTW, just out of curiosity, this is a very interesting discussion on the subject: https://security.stackexchange.com/questions/47467/can-a-website-determine-what-os-or-webbrowser-a-visitor-is-using-if-the-useragen

kvakl-brodakl commented 10 months ago

I just did that on Chrome. It still detects it as non Windows.

Strange, it works for me... Also I turned off cache for geforce now in developer tools > network (there is a checkbox)... Maybe you can try this... Also what I want to note - even if it works fine in chrome, if I open incognito mode (still with user agent, with flag and turn off the cache) - geforce still is able to detect me as non windows and block some games...

Galcian79 commented 10 months ago

I just did that on Chrome. It still detects it as non Windows.

Strange, it works for me... Also I turned off cache for geforce now in developer tools > network (there is a checkbox)... Maybe you can try this... Also what I want to note - even if it works fine in chrome, if I open incognito mode (still with user agent, with flag and turn off the cache) - geforce still is able to detect me as non windows and block some games...

It doesn't change anything. It is strange indeed, because whatismybrowser.com detects WINDOWS NT 10.0

Galcian79 commented 10 months ago

Supposing the issue is not on my side alone, i wonder if they could write a Java exploit to blindly parse uname -r on every accessing client.

Flameish commented 9 months ago

You can install the windows version of chrome via wine which seems to be working (my mouse input is really laggy through but playing via a controller works fine). The option to pick 1440p is showing at least, which is more than the Linux Chrome version is showing.

Screenshot from 2023-09-23 12-33-29

Doc-4 commented 9 months ago

Respectfully, the point of raising the issue is to get it fixed, most of us know there are workarounds. The point of this client is to not have that overhead. I hope the dev comments soon, I use this to play genshin on steam deck currently, and it's been broken for a few weeks now

Flameish commented 9 months ago

I mentioned it here for others because it's a place you'll find if you're looking for a workaround, as I haven't found one yet.

Mageti commented 9 months ago

I do not know if that can help, but when I opened the devtools, I saw that the header "Sec-Ch-Ua-Platform" changed after a particular request. It starts with requests having the spoofed header with "Windows", as intended. Then 1 or 2 requests are made to https://www.nvidia.com/auth/hints/, without the spoofed header. And after that every other requests are made with the value "Linux" in this header. Capture before hints Capture of the hints Capture after hints

ATM, I am not sure what this hints script does, but it succeed in finding it runs on a linux, and then it totally bypass the parameters done in electron, overriding them with its own finding.

EDIT : just to add the precision that I had it run after rm -rf ~/.config/GeForce\ NOW/, and I get the same thing everytime

Galcian79 commented 9 months ago

I do not know if that can help, but when I opened the devtools, I saw that the header "Sec-Ch-Ua-Platform" changed after a particular request. It starts with requests having the spoofed header with "Windows", as intended. Then 1 or 2 requests are made to https://www.nvidia.com/auth/hints/, without the spoofed header. And after that every other requests are made with the value "Linux" in this header. Capture before hints Capture of the hints Capture after hints

ATM, I am not sure what this hints script does, but it succeed in finding it runs on a linux, and then it totally bypass the parameters done in electron, overriding them with its own finding.

EDIT : just to add the precision that I had it run after rm -rf ~/.config/GeForce\ NOW/, and I get the same thing everytime

Are you sure you disabled User Agent Client Hints before taking the test?

Mageti commented 9 months ago

Here is the command line I used : geforcenow --spoof-windows --disable-rpc. It's here : https://github.com/hmlendea/gfn-electron/blob/35a386a2ad843f8e46ce6d11d7236a9648b25e39/scripts/main.js#L20 And in the file /opt/geforcenow-electron/resources/app/scripts/main.js, I added these lines at line 28, to be sure :

app.commandLine.appendSwitch(                                                                                                                                                                                                                 
  'disable-features',                                                                                                                                                                                                                         
  'UserAgentClientHint'                                                                                                                                                                                                                       
);                                                                                                                                                                                                                                            

As well as I added the second details.requestHeaders here between lines 71 and 85, even if I am pretty sure it does nothing :

  if (process.argv.includes('--spoof-windows')) {                                                                                                                                                                                             
    session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {                                                                                                                                                            
      details.requestHeaders['sec-ch-ua-platform'] = 'Windows';                                                                                                                                                                               
      details.requestHeaders['Sec-Ch-Ua-Platform'] = 'Windows';                                                                                                                                                                               
      callback({ cancel: false, requestHeaders: details.requestHeaders });                                                                                                                                                                    
    })                                                                                                                                                                                                                                        
  }
Mageti commented 9 months ago

Could it be related to this bug ? https://github.com/electron/electron/issues/30201#issuecomment-1712777066

hmlendea commented 8 months ago

Closing this as OS spoofing is getting removed (See #209), and also Genshin Impact is only available on GFN on Windows.

Doc-4 commented 8 months ago

It is a website after all, and the web is open and platform agnostic. Until they say it goes against their terms to get a decent settings menu and access to all games by obfuscating your OS, I see no reason to accept their odd preferential treatment of windows. I respect your decision even if I don't agree, thank you for your work up until this point.

MarcBittner commented 4 months ago

Closing this as OS spoofing is getting removed (See #209), and also Genshin Impact is only available on GFN on Windows.

This is a useful feature that exposes existing functionality. Removing it is lame and I find the reasoning unconvincing.