7

1)Androidデバイスから生のSMS PDUを送信する方法はありますか?

または、

2)PDUヘッダー(TP-DCSなど)にアクセスして、好きなようにPDUを構築できるクラスはありますか?

ネットを検索して見つけました: http ://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html しかし、上記のクラスはプライベートであるため、私は利用できません(haven理由は実際にはわかりません)。

私が求めていることは、何らかの形で可能ですか?そうでなければ、なぜ私はそのような機能を持たないのですか?

ありがとう

4

2 に答える 2

6

これは、パブリックAPIに要求される機能です。

sendRawPdu開発者のコ​​メントは、内部APIからを使用することを示唆しています。これはリフレクションSMSDispatcherを介して実行できます。ただし、本番コードにプライベートAPIを使用することは強くお勧めしません。

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) {

結論:それが可能かどうかは明らかではありません。あなたと同じ質問があります。

于 2011-02-19T21:40:48.643 に答える
2

私はその方法を知っています。http://www.silentservices.de/products/android-hushsms/およびxposedフレームワークhttp://repo.xposed.info/module/de.robv.android.xposed.installer
使用するには、電話をルート化する必要がありますxposedモジュール'raw-pdu'のですが、動作します。Hush-smsは、7つの生のSMSタイプを送信するためのAPI機能/拡張性を提供します。

于 2014-06-16T06:01:38.677 に答える