2fast-team / 2fast

Two-Factor Authenticator Supporting TOTP (Windows 10 & Android, iOS, Linux and macOS App)
https://2fast-app.de
GNU General Public License v3.0
393 stars 42 forks source link

QR Code scanning broken in Beta/Dev/Canary #88

Closed dongle-the-gadget closed 11 months ago

dongle-the-gadget commented 11 months ago

Describe the bug

Microsoft has recently published a change to screen clipping in the Beta, Dev and Canary builds of Windows. In particular, the Screen Snipping app has been replaced by Snipping Tool, which doesn't support the edit action 2fast is using. This causes the Snipping Tool main window to show up instead.

Steps to Reproduce

  1. Install the latest Beta, Dev or Canary build.
  2. Update Snipping Tool to version 11.2307.44.0 or higher.
  3. Change the ms-screenclip handler to "Snipping Tool" in Settings.
  4. Open and unlock 2fast, select "Add account" and choose "Scan key - QR Code".
  5. Notice that the main Snipping Tool window opens up instead of screen clipping.

Related code: https://github.com/2fast-team/2fast/blob/aa77936944ad75d8c4211ae788929e88cc669e19/Project2FA.Shared/ViewModels/Base/AddAccountViewModelBase.cs#L271

Expected behavior

Screen snipping launches instead of the main Snipping Tool window.

Screenshots

N/A since 2fast hides its windows.

Environment

App Version(s): 1.2.6.0

Windows 10/11 Build Number:

Additional context

Could be fixed by removing the edit verb. Would also work with the legacy Screen Snipping app, from my test on that build.

jp-weber commented 11 months ago

I have installed the version 11.2307.48.0 in my Win11 VM and it works as aspected. I think this was a bug in the dev versions. The program call without edit would not work at least with windows 10.

https://learn.microsoft.com/en-us/windows/uwp/launch-resume/launch-screen-snipping

dongle-the-gadget commented 11 months ago

I can still replicate this. Are you sure you have set the protocol as mentioned? The bug will not reproduce if you don't do that.

jp-weber commented 11 months ago

Ah sorry right, but the change of the handler has to happen manually? What is the intention to change the handler here? grafik

dongle-the-gadget commented 11 months ago

I'd assume that Microsoft would change it to Snipping Tool by default in a future update (after all, they have done this - or attempted to - in Beta builds). This bug only reproduces when Snipping Tool is being used to trigger snipping, and not Screen Snipping.