jd1378 / otphelper

open-source application that can copy OTP and codes from notifications automatically for you
GNU Affero General Public License v3.0
400 stars 31 forks source link

detects card nr instead of otp #30

Closed grimpy closed 9 months ago

grimpy commented 9 months ago

Sample message:

Your OTP for your card nb 123456**6789 is : '287633' and expires in 3 Minutes. Use it to complete trnx at 'Shop' for EGP 306.27.

Instead of 287633 the beginning of the card gets copied 123456

jd1378 commented 9 months ago

hmm, this one is a hard one I don't think it's possible to make it handle it with the current way of doing things

grimpy commented 9 months ago

I was thinking to allow certain space chars around the OTP like space ' and " and ignore it if left and right space char don'tatch

jd1378 commented 9 months ago

the thing is it already takes into account stuff around code like ' and " and is there's other non standard quoting with special Unicode characters as well, and I have taken them into account as well,

but, the most important thing that I cannot change about the code capture is that the code must be the closest capture to the sensitive keyword, so having the card number appearing before the code is a deal breaker for the code capturing

and this is the first time I have seen this happening, it's not common

there's already two way of capturing, and second one only runs if there's some condition happening in the first capture, I don't know if I want to introduce a third case for the rare cases (I will reconsider if I get report of more cases like this one). because I don't want the app to take too long processing the notifications and consume battery too much.

grimpy commented 9 months ago

To be fair Google messages which has a built-in feature like this also captures the wrong number hence I was looking for alternative approaches like this app

jd1378 commented 9 months ago

Sorry to disappoint you

But maybe it's not a bad idea also to report this issue to the service you are using and ask them to rearrange the sms so that other apps like google messages also work correctly

grimpy commented 9 months ago

I understand thanks for the quick response, it's an OTP of a bank I doubt they would takey sugesstion into consideration

jd1378 commented 9 months ago

Probably, but you'll never know until you try