Android 中的短信原始 pdu

发布于 2024-09-19 11:57:37 字数 438 浏览 10 评论 0原文

1) 有什么方法可以从 Android 设备发送原始 SMS PDU?

或者,

2) 是否有任何可用的类可以让我访问 PDU 标头(例如 TP-DCS),以便我可以按照自己的喜好构造 PDU?

我在网上搜索了一下,发现: http://www.androidjavadoc.com/1.0 _r1_src/com/android/internal/telephony/gsm/ISms.html 但上述课程是私有的,因此我无法使用(实际上还没有理解为什么)。

我所问的是否可能?如果没有的话为什么我不能拥有这种功能呢?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小嗲 2024-09-26 11:58:12

我知道怎么做。 http://www.silentservices.de/products/android-hushsms/ 和 <代码>xpose框架 http://repo.xposed.info /module/de.robv.android.xposed.installer
您需要 root 手机才能使用 xposed 模块“raw-pdu”,但它可以工作。 Hush-sms 提供 API 功能/可扩展性来发送 7 种原始短信类型。

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.

浊酒尽余欢 2024-09-26 11:58:03

这是公共 API 的请求的功能。

开发人员评论暗示使用内部 SMSDispatcher API 中的 sendRawPdu,这可以通过

尚不清楚是否可以使用公共 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) {

综上所述:
目前尚不清楚是否可能。我和你有同样的问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文