SMS raw pdu in Android
Asked Answered
C

2

8

1) Is there any way that I can send a raw SMS PDU from an Android device?

Or,

2) are there any classes available that can give me access to the PDU headers (for example TP-DCS) so that I can construct the PDU as I like?

I have searched the net and found: http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html but the above classes are private and as such are not available to me(haven't actually understood why).

Is what I'm asking possible in any way or not? If not then why can't I have that kind of functionallity?

Thanx

Coontie answered 14/9, 2010 at 21:36 Comment(0)
H
6

This is a requested feature for the public API.

The developer comments hint at using the sendRawPdu from the internal SMSDispatcher API, which can be done via reflection. However, the use of private APIs for production code is highly discouraged

It is not clear if it's possible to send using the public TelephonyManager API.

/*
 * TODO(cleanup): It looks like there is now no useful reason why
 * apps should generate pdus themselves using these routines,
 * instead of handing the raw data to SMSDispatcher (and thereby
 * have the phone process do the encoding).  Moreover, CDMA now
 * has shared state (in the form of the msgId system property)
 * which can only be modified by the phone process, and hence
 * makes the output of these routines incorrect.  Since they now
 * serve no purpose, they should probably just return null
 * directly, and be deprecated.  Going further in that direction,
 * the above parsers of serialized pdu data should probably also
 * be gotten rid of, hiding all but the necessarily visible
 * structured data from client apps.  A possible concern with
 * doing this is that apps may be using these routines to generate
 * pdus that are then sent elsewhere, some network server, for
 * example, and that always returning null would thereby break
 * otherwise useful apps.
 */

/**
 * Get an SMS-SUBMIT PDU for a destination address and a message
 *
 * @param scAddress Service Centre address.  Null means use default.
 * @return a <code>SubmitPdu</code> containing the encoded SC
 *         address, if applicable, and the encoded message.
 *         Returns null on encode error.
 * @hide
 */
public static SubmitPdu getSubmitPdu(String scAddress,
        String destinationAddress, String message,
        boolean statusReportRequested, byte[] header) {

In conclusion: It's not clear if it's possible. I have the same question as you.

Holograph answered 19/2, 2011 at 21:40 Comment(1)
After so much time and after being able to log in to my account again. Thanks very much for the answer!Coontie
J
2

I know how. http://www.silentservices.de/products/android-hushsms/ and xposed framework http://repo.xposed.info/module/de.robv.android.xposed.installer
You'll need to root your phone to make use of the the xposed module 'raw-pdu', but it works. Hush-sms provides the api functionality / extensibility to send the 7 raw sms types.

Jerold answered 16/6, 2014 at 6:1 Comment(1)
When I posted this question I was hopping for a solution that doesn't involve rooting so that the app you develop can work/be installed seamlessly in almost every phone. As it seems, there is no such solution available. Eventhough I don't have the time to check right now I will upvote your answer as it looks like a nice alternative/workaround for people that are still interested.Coontie

© 2022 - 2024 — McMap. All rights reserved.