02. Core Concepts - Theliel/SMSForge GitHub Wiki

Core Concepts

SMS Forge is a highly specialized application that interacts directly with your device’s hardware, bypassing standard Android communication layers. This section explains the key technical terms and concepts you need to understand to unlock the full potential of its advanced features.


Fundamental Application Concepts

SMS Forge

The application itself! SMS Forge acts as a low-level bridge between you and your phone’s modem. Think of it as a specialized translator: you provide the intent (the message and its options), and SMS Forge translates that intent into the exact, raw PDU commands that the modem understands, bypassing Android’s built-in SMS services entirely. We aim for technical excellence, with a slight touch of mischief.

PDU (Protocol Data Unit)

The PDU is the raw, structured, hexadecimal packet that represents an SMS message. When you type a message in a standard app, the system converts it into a PDU before transmission. SMS Forge allows you to directly construct and modify the PDU parameters, giving you fine-grained control over features like validity period, message class, and flags that are normally hidden from the user.

Modem / Baseband

The modem is the dedicated hardware and firmware component inside your phone responsible for all cellular communication (calls, 2G/3G/4G/5G data, and SMS). It operates independently from the main Android OS. Baseband refers to the firmware running on the modem. SMS Forge communicates directly with this.

Device (/dev/*)

In Linux/Android systems, hardware devices communicate through special files in the /dev/ directory. For the modem, this usually means files like /dev/smd* (Snapdragon devices) or /dev/at* or /dev/radio/at* (MediaTek devices). SMS Forge requires Root access to read and write AT commands to these specific device files.


Message Flags and Types

SMS Class (Class 0 to 3)

This parameter, set within the PDU, dictates how the receiving device should handle the message:

  • Class 0 (Flash SMS): The message appears immediately on the recipient’s screen and is typically not stored locally and don’t show the sender. Some devices can store it.
  • Class 1 (ME – Mobile Equipment): Standard SMS. Stored by default in the phone’s internal memory.
  • Class 2 (SIM): Stored on the SIM card.
  • Class 3 (TE – Terminal Equipment): The terminal equipment (e.g., the devices himself) should handle the message.

Replacement Messages (Replace)

Allows a sender to specify a Type (an index from 1 to 7) in the message header. If the recipient has a previously received message with the exact same Replace Type, the new message will overwrite (replace) the old one in their inbox. This is commonly used for updating status messages.

MWI Messages (Message Waiting Indicator)

These specialized messages are used to set or clear indicators for Voice Mail, Fax, E-Mail, or other waiting services. SMS Forge supports setting these through two methods: DCS (Data Coding Scheme) or UDH (User Data Header).

  • MWI messages can be configured to be Shown (displaying a brief text/notification) or completely Invisible (Silent MWI), simply triggering the waiting indicator without a visible text message.

DCS (Data Coding Scheme)

A PDU field that dictates how the User Data (the text) is compressed or formatted. It can also be used to indicate the presence of an MWI flag. Using DCS for MWI is generally a simpler method but offers less control than UDH.

UDH (User Data Header)

An optional segment placed at the beginning of the message text. The UDH contains special instructions or information about the message content, such as message concatenation, ports, or, in this case, the detailed MWI information. Using UDH for MWI gives more granular control over the indicator status.


Advanced PDU Settings (Settings Tab)

Silent SMS

A broad term for any SMS that the recipient doesn’t receive as a standard notification in their message inbox. This usually refers to:

  • SMS PING: A specific type of SMS (often a Type 0 with special flags) designed to elicit a delivery report (TP-SRR) without notifying the user, used for network presence checking.
  • Invisible MWI Messages: MWI messages configured not to display any text.
In essence, any message configured via SMS Forge to not notify the user or appear in the inbox falls under this category.

Auto-Deleted (Ephemeral) Messages

This flag, when set in the PDU, instructs the receiving device or network (if supported) to automatically delete the message from the recipient’s device memory shortly after it is read or displayed. This is the Ephemeral flag in the Advanced settings.

Reply Path Flag (TP-RP)

This is a single bit (flag) set in the PDU that serves two primary purposes:

  1. It informs the Message Centre that the sender has included a Reply Address field in the PDU, allowing for an alternate destination number for the reply.
  2. Even without the Reply Address field being explicitly inserted, setting this flag is also used to indicate that the Message Centre should utilize the same SMSC that sent the original message to route the eventual response.
This flag must be enabled in the Advanced tab if you wish to use a custom Reply Address configured in the Settings menu.

MMS Notification

What is it?

The Multimedia Messaging Service (MMS) uses a unique two-stage process for delivery, unlike standard SMS.

  1. The multimedia content (photos, videos, long text) is first uploaded and stored on the mobile carrier’s server (MMSC).
  2. The server then sends the recipient a specialized SMS known as an MMS Notification (a type of WAP Push messange). This SMS acts as a pointer, containing the URL that the recipient’s phone must access to download the actual message content.

This special SMS effectively emulates the carrier notification that tells a user they have a pending MMS.

Applications and Limitations

  • Sender Spoofing: It is straightforward to manipulate the internal sender header of the notification, allowing the message to appear as if it originated from any arbitrary phone number or text.
  • Silent SMS/Presence Check: By crafting the notification packet specifically, we can send a message that is received and processed by the recipient’s phone (confirming the device is powered on and connected to the network) without the phone generating any visible notification or alert for the user.
  • Reduced Payload Size: Because this SMS must carry significant protocol data (transaction ID, download URL, headers, etc.), the available space for custom text or visible information is heavily constrained. The usable data is substantially less than the typical 160 characters of a standard SMS.

RAW PDU

As explained previously in the PDU section, this contains the raw content not only of the message itself, but also all the settings, header, recipient, etc.

Although SMS Forge strives to be versatile, it is virtually impossible to accurately describe everything that can be done with SMS. RAW PDU mode allows you to send virtually any SMS you want, simply by knowing the PDU, without any restrictions.

This is essential for research, testing, learning, and more.



Advanced PDU Settings (Settings Tab)

Service Centre Address (SMSC)

The phone number of the Message Centre responsible for routing your SMS. This is usually managed by the carrier, but SMS Forge allows you to specify a different one. It accepts both international prefix and national numbering formats.

Time of Validity (TP-VP)

Defines how long the Message Centre should attempt to deliver the SMS before giving up. SMS Forge supports three modes:

  • Relative Mode: A numerical value (0-255) where each range corresponds to a specific duration (e.g., increments of 5 min, 30 min, days, or weeks).
  • Absolute Mode: Allows you to specify the exact date and time (year, month, day, hour, minute, second) up to which the message is valid. Time Zone is specified as a value between -48 and +48 (each step is 15 minutes).
  • Enhanced Mode: Provides more flexibility, including relative modes in seconds or hours, or the “Single Shot” option where the SMSC attempts delivery only once.

Reply Address

A field in the PDU that specifies an alternative phone number that the recipient should use to reply. This requires the Reply Path (TP-RP) flag to be enabled in the Advanced tab.

Protocol Identifier (TP-PID)

A parameter that indicates the protocol used by the message (e.g., for specialized services like Telex, Fax, ERMES, or Paging/Beeper services). Modifying this is essential when communicating with non-GSM mobile devices.

Message Reference (TP-MR)

A number (usually calculated randomly or sequentially by the terminal) that uniquely identifies the sent SMS. This is crucial for matching the original message with its corresponding Status Report (if requested via TP-SRR).

Status Report Request (TP-SRR)

A flag that, when set, requests the receiving terminal (and/or the network) to send back a Status Report (Delivery Confirmation) once the SMS has been successfully delivered.

Reject Duplicates (TP-RD)

A flag that, when set, instructs the Message Centre to reject the current message if it receives another message with the same TP-MR from the same sender within a short time frame. This prevents accidental duplicate deliveries.

⚠️ **GitHub.com Fallback** ⚠️