Skip to content

Iceloof/SMS2Telegram

Repository files navigation

SMS2Telegram

⚠️ This project was fully generated by AI.

SMS2Telegram is a lightweight Android utility app that automatically forwards SMS messages, incoming call alerts, and low‑battery warnings to a Telegram Bot.
It is designed for users who keep a SIM card in a spare phone, travel internationally, or need remote access to verification codes and device status.

The app runs reliably in the background and does not require the UI to stay open.


✨ Features

📩 SMS Forwarding

  • Automatically forwards incoming SMS to Telegram.
  • Includes sender number, message body, and timestamp.
  • Full dual‑SIM support:
    • Detects SIM1 / SIM2
    • Reads carrier name
    • Reads SIM phone number (if provided by carrier)

📞 Incoming Call Alerts (Android 12+)

  • Sends a Telegram alert when the phone receives a call.
  • Includes:
    • SIM card used
    • Caller number
    • Call end time
    • Call duration
    • Call type (answered / missed)
  • Uses TelephonyCallback, compatible with Android 12+.

🔋 Low Battery Warning

  • Runs as a foreground service for reliability.
  • Sends a Telegram alert when battery drops to 5%.
  • Sends the alert only once until battery rises above 10%.
  • Works even if the app UI is closed.

⚙️ Settings Page

  • Configure:
    • Telegram Bot Token
    • Telegram Chat ID
  • Enable/disable:
    • SMS forwarding
    • Call alerts
    • Battery alerts
  • Includes a Test Send button to verify configuration.

📱 Screenshots

Replace the image paths below with your actual files in the screenshot/ folder.

App Home Settings Page
screenshot screenshot

📦 Installation & Permissions

The app requires the following permissions:

  • READ_PHONE_STATE — detect call state
  • READ_CALL_LOG — retrieve caller number after call ends
  • READ_SMS — required for SMS forwarding (if enabled)
  • FOREGROUND_SERVICE — run call monitor reliably
  • FOREGROUND_SERVICE_DATA_SYNC — required on Android 14+

How It Works

  1. The app starts a foreground service (CallMonitorService).
  2. During ringing and during the call:
  • The app only prints logs.
  • It does not attempt to read the caller number.
  1. When the call ends (state becomes IDLE):
  • The app reads the most recent incoming/missed call from Call Log.
  • It extracts:
    • Number
    • SIM card
    • End time
    • Duration
    • Call type
  • Sends the formatted message to Telegram.

This approach is fully compliant with Android 10–16 privacy restrictions.


Dual SIM Support

The app listens to each active subscription ID.
SIM identification is based on:

  • PHONE_ACCOUNT_ID from Call Log (preferred)
  • Fallback to the subscription ID of the listener

This ensures correct SIM detection even on devices with two active SIM cards.


Privacy

  • No data is stored locally.
  • No data is uploaded except to your own Telegram bot.
  • The app does not collect analytics or share data with third parties.

Known Limitations

  • Caller number cannot be retrieved during ringing or during the call
    (Android privacy restriction)
  • Call Log entry is only available after the call ends
  • Some OEMs may delay Call Log updates by 1–2 seconds

License

This project is provided as‑is for personal use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages