OrangeDrangon / android-messages-desktop

Android Messages as a Cross-platform Desktop App
Other
312 stars 27 forks source link

Easily copy verification codes from messages or notifications #385

Open jonasmellquist opened 2 years ago

jonasmellquist commented 2 years ago

Is your feature request related to a problem? Please describe. I mostly use AndroidMessages for receiving verification codes. It's a very manual procedure to copy-paste these into other applications.

Describe the solution you'd like Make it possible to easily copy (put into clipboard) verification numbers such as putting the numbers of the following messages into the clipboard: SMS passcodes: 1256422 Use verification code 795658 for Microsoft authentication.

Describe alternatives you've considered Perhaps allow to copy the numbers via the notification if at all possible

Using 5.3.1 on macOS Monterey 12.4

myspivey commented 2 years ago

This is just a website in a desktop wrapper. You should be able to double-click and copy. On Mac I get that option as I use this for the same thing. image

OrangeDrangon commented 2 years ago

It may be possible to make something like this but it would be far from perfect. If I am ever bored and motivated I might make a pr with a build to test.

jonasmellquist commented 2 years ago

This is just a website in a desktop wrapper. You should be able to double-click and copy. On Mac I get that option as I use this for the same thing. image

Yeah I use that multiple times per day, still wish is required less clicks :)

OrangeDrangon commented 1 year ago

I have an in progress regex that matches all of the verification code messages I have laying around.

play around with it and let me know if you have instances where it doesn't work. Note it is English specific.

https://regex101.com/r/Ay1OQw/1

innesst commented 1 year ago

I tried maybe 30 different ones I received, and these are the only ones that didn't find a match - all others found the proper code (all characters, no extra digits or duplicates).

Citi ID Code: ###### Only enter online to complete your account sign on request. Please DON'T share it. We'll NEVER call or text for this code.

Use ###### for two-factor authentication on Facebook.

jonasmellquist commented 1 year ago

Here are a few from my recently received list that don't work with the current RegEx

PIN code: 686289
Username: j0016 Password: 7360
SMS passcodes: 1780575
OrangeDrangon commented 1 year ago

Here is the updated regex. The code will lowercase the string before matching to avoid special casing upper and lower case handling. https://regex101.com/r/VKFWu1/1

innesst commented 1 year ago

The ones below still don't work - but will work if I change "Code" to "code" / "Use" to "use"

Citi ID Code: 123456 Only enter online to complete your account sign on request. Please DON'T share it. We'll NEVER call or text for this code.

Use 12345 for two-factor authentication on Facebook.

OrangeDrangon commented 1 year ago

Sounds good. I will be calling toLowercase on the strings.

I need some feedback on the expected ergonomics. I cannot figure out how to make a button be part of the notification. I am thinking about providing an option to put the code on clipboard on notification click, if detected. Should that also prevent the opening of the window in that case. Should that be another option?

innesst commented 1 year ago

I think your plan is good: If you click on notification the code should go to the clipboard and the window should not open. I think it should be off by default in case there's a potential privacy issue. I think everything is handled locally so there isn't. But some people might think that there is.

Would the code be highlighted in the notification? If so, you can have options as: Detect OPT Codes --Copy OPT to clipboard when clicking notification (Default) [greyed until above is selected] ----Don't open window when (Default) [greyed until above is selected]

If the code wouldn't be highlighted, there is no need to separate the first two options, because the user wouldn't be able to tell if a code was detected to know what would happen if clicked. So then the options would be: Detect OPT Codes and Copy to Clipboard when Clicking Notification [greyed until above is selected] ----Don't open window when copying code (Default) [greyed until above is selected]

When a code is copied, it would be a great addition If you can have a popup saying "Code Copied" / "Code ##### Copied to Clipboard". It would help confirm that it happened and help someone figure out why the window didn't open if they expected it to.

OrangeDrangon commented 1 year ago

All of those are great thoughts. I am still said I can't have a button as part of the notification. I'll give this a pass sometime soon.

Thanks Kyle

On Fri Oct 28, 2022, 02:05 PM GMT, innesst @.***> wrote:

I think your plan is good: If you click on notification the code should go to the clipboard and the window should not open. I think it should be off by default in case there's a potential privacy issue. I think everything is handled locally so there isn't. But some people might think that there is. Would the code be highlighted in the notification? If so, you can have options as: Detect OPT Codes --Copy OPT to clipboard when clicking notification (Default) [greyed until above is selected] ----Don't open window when (Default) [greyed until above is selected] If the code wouldn't be highlighted, there is no need to separate the first two options, because the user wouldn't be able to tell if a code was detected to know what would happen if clicked. So then the options would be: Detect OPT Codes and Copy to Clipboard when Clicking Notification [greyed until above is selected] ----Don't open window when copying code (Default) [greyed until above is selected] When a code is copied, it would be a great addition If you can have a popup saying "Code Copied" / "Code ##### Copied to Clipboard". It would help confirm that it happened and help someone figure out why the window didn't open if they expected it to. — Reply to this email directly, view it on GitHub https://github.com/OrangeDrangon/android-messages-desktop/issues/385#issuecomment-1295043273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGB2A7MT6SDIHTH6VCDZB73WFPMTZANCNFSM5WWSDXGA. You are receiving this because you commented.Message ID: @.***>