Class TextSend

java.lang.Object
com.aurelienpierre.sioul.TextSend

final class TextSend extends Object
A text written on a computer, sent by this phone (docs/texts.md, "Never twice"; Rust's side: crates/sioul-app/src/texts.rs). Rust has decided it and written its key in the phone's private ledger, flushed to the disk, before it asks here: a key is handed to Android once. Android splits it (`divideMessage`), sends it from the SIM named, files it in the phone's sent box with Sioul as its creator, so that the SMS app shows it in the conversation, and retries by itself three times ("reject duplicates"); Sioul never retries. Each part's sent and delivered results come to `Result`, which writes them in Java's own file (`results.jsonl`), flushed, that Rust copies into the phone's outcomes. Java never writes a shared file.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Android's word on a part, sent or delivered, or on a multimedia message (in the background service's process): written, then a step soon.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
     
    (package private) static final String
    The provider's root for Sioul's private files (res/xml/qtprovider_paths.xml): the whole of getFilesDir().
    (package private) static final String
     
    (package private) static final String
    Java's results, in Sioul's texts folder.
    (package private) static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    append(File folder, String line)
    A line added to Java's results file, flushed to the disk.
    (package private) static String
    hex(byte[] bytes)
    Bytes in hex, two digits each; "" for none.
    (package private) static JSONObject
    line(String key, String kind, int part, int parts, int code, String uri, int status, long at)
    A part's result as Rust reads it (crates/sioul-app/src/texts.rs, `Result`): its key, "sent" or "delivered", which part of how many, Android's code (-1: done), the row it filed, the carrier's status for a delivery (TP-Status: under 0x20, received), when (ms).
    (package private) static SmsManager
    manager(Context context, int sub)
    The SIM's own manager (`sub` ≥ 0), else the phone's default one.
    (package private) static JSONObject
    mmsLine(String key, int code, String uri, int http, byte[] conf, long at)
    A multimedia message's word as Rust reads it (crates/sioul-app/src/texts.rs, mms_outcomes): its key, "mms", Android's code (-1: done), the row it filed, the HTTP status, the carrier's answer (M-Send.conf) in hex, when (ms).
    private static PendingIntent
    pending(Context context, String action, String key, int part, int parts)
    A part's result, to `Result`: one of its own (its address names the key, the part, sent or delivered), mutable so that Android may add the row it filed ("uri") and the carrier's report ("pdu").
    private static PendingIntent
    pendingMms(Context context, String key)
    A multimedia message's word, to Result: an explicit intent of its own (its address names the key), mutable, so that Android may add the carrier's answer (SmsManager.EXTRA_MMS_DATA), the HTTP status and the row it filed ("uri"); from Android 14 a mutable intent must be explicit.
    (package private) static JSONObject
    send(Context context, String key, String to, String body, int sub)
    The text handed to Android: {handed, parts} or {handed: false, reason}.
    (package private) static JSONObject
    sendMms(Context context, String key, int sub, String path)
    A multimedia message written on a computer, which Rust built on this phone (crates/sioul-core/src/mms.rs), measured against the SIM's carrier, and claimed in its ledger before it asks here: handed to Android by its address in Sioul's file provider, through which Android reads it (sendMultimediaMessage: SEND_SMS alone, no SMS role), from the SIM named, never with values of Sioul's over the carrier's.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • send

      static JSONObject send(Context context, String key, String to, String body, int sub) throws JSONException
      The text handed to Android: {handed, parts} or {handed: false, reason}. The parts' intents name the key, so that each result finds its text.
      Throws:
      JSONException
    • sendMms

      static JSONObject sendMms(Context context, String key, int sub, String path) throws JSONException
      A multimedia message written on a computer, which Rust built on this phone (crates/sioul-core/src/mms.rs), measured against the SIM's carrier, and claimed in its ledger before it asks here: handed to Android by its address in Sioul's file provider, through which Android reads it (sendMultimediaMessage: SEND_SMS alone, no SMS role), from the SIM named, never with values of Sioul's over the carrier's. Android files it in the sent box with Sioul as its creator and its key as tr_id; its word, with the carrier's answer, comes to Result by an explicit, mutable intent (Android adds its extras to it). {handed} or {handed: false, reason}.
      Throws:
      JSONException
    • pendingMms

      private static PendingIntent pendingMms(Context context, String key)
      A multimedia message's word, to Result: an explicit intent of its own (its address names the key), mutable, so that Android may add the carrier's answer (SmsManager.EXTRA_MMS_DATA), the HTTP status and the row it filed ("uri"); from Android 14 a mutable intent must be explicit.
    • mmsLine

      static JSONObject mmsLine(String key, int code, String uri, int http, byte[] conf, long at) throws JSONException
      A multimedia message's word as Rust reads it (crates/sioul-app/src/texts.rs, mms_outcomes): its key, "mms", Android's code (-1: done), the row it filed, the HTTP status, the carrier's answer (M-Send.conf) in hex, when (ms). Pure: android/jvm-checks/TextsCheck.java.
      Throws:
      JSONException
    • hex

      static String hex(byte[] bytes)
      Bytes in hex, two digits each; "" for none.
    • manager

      static SmsManager manager(Context context, int sub)
      The SIM's own manager (`sub` ≥ 0), else the phone's default one.
    • pending

      private static PendingIntent pending(Context context, String action, String key, int part, int parts)
      A part's result, to `Result`: one of its own (its address names the key, the part, sent or delivered), mutable so that Android may add the row it filed ("uri") and the carrier's report ("pdu").
    • line

      static JSONObject line(String key, String kind, int part, int parts, int code, String uri, int status, long at) throws JSONException
      A part's result as Rust reads it (crates/sioul-app/src/texts.rs, `Result`): its key, "sent" or "delivered", which part of how many, Android's code (-1: done), the row it filed, the carrier's status for a delivery (TP-Status: under 0x20, received), when (ms).
      Throws:
      JSONException
    • append

      static void append(File folder, String line)
      A line added to Java's results file, flushed to the disk.