Giter VIP home page Giter VIP logo

Comments (3)

warthog618 avatar warthog618 commented on July 20, 2024

How do you perform the decode? Using smsdecode? That strictly decodes SMSs, not USSD.

The check that is tripping is sm[sml] != 0, which checks that any pad character at the end of user data is 0, which is correct for SMS encoding, but is incorrect for USSD where the trailing pad character is a CR.
But even a strict USSD decoder would fail this message as it pads the user data with a space (0x20), not a CR (0x0d).

Making the decoder less strict by removing that check gives:

$ ./smsdecode -p 07912180958739F144038102F100001211304113338A2F0608041E9602026177F85C06E5DF7539283C1EBFEB6E3A284C0785E974D7F8DD7EB5F37079191E4E9341
SMSC: +12085978931
TPDU: SMS-DELIVER
TP-MTI: 0x00 Deliver
TP-MMS: true
TP-LP: false
TP-RP: false
TP-UDHI: true
TP-SRI: false
TP-OA: 201
TP-PID: 0x00
TP-DCS: 0x00 7bit
TP-SCTS: 2021-11-03 14:31:33 -0700
TP-UDH: ID: 8  Data: [30 150 2 2]
TP-UD: 00000000  61 6e 61 67 65 20 79 6f  75 72 20 61 63 63 6f 75  |anage your accou|
       00000010  6e 74 20 61 74 20 61 74  74 2e 63 6f 6d 2f 6d 79  |nt at att.com/my|
       00000020  70 72 65 70 61 69 64                              |prepaid|

so that might be a simple option for you.

from sms.

frifox avatar frifox commented on July 20, 2024

My decode is process more or less same as smsdecode. I did make a fork of this repo and ignored the check. So far it has worked well for me.

Another example is TikTok's verification sms:

PDU:
07912160130380F0040B916113888998F800001201825172218A771B1E35BDA6BED7A02079BEF18170315C0D949E83F2EFBA1C642FCBD3E6F4384C4FBFDDA0F19B5C6681EC61769A0C32BFE5A01AA89D76D7E9E5B90B447D83D6E5321C947FD7E5A0F078FCAEBBE9A079D85C6681DC657B590E32BFE5F7B09C0CA2A3D373D0F84D2EBB1A

Decoded with the check ignored:

"[TikTok Ads] 8185 is your verification code, valid for 5 minutes. To keep your account safe, never forward this code.\r",

Should something be added to support less strict decoding, such as UnmarshalOption? That would be nice :) But for now, for people running into this problem, adding this to go.mod file will work:

replace github.com/warthog618/sms => github.com/frifox/sms master

from sms.

warthog618 avatar warthog618 commented on July 20, 2024

Yeah, it might be nice to allow the decoder to be less strict, and for it to support USSD for that matter, but so far no one has asked or offered a pull request, and my interest was primarily SMS so I haven't bothered.
If you already have your own fork and are happy with that then why are you bothering me?

from sms.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.