# johnkil/spysms architecture

> Architecture diagram of the GitHub repository johnkil/spysms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johnkil/spysms
- Repository: https://github.com/johnkil/spysms

## Overview

SpySMS is an Android app for intercepting and diverting SMS messages. Its main path is incoming SMS → rule checks → forwarding; separately, the activity generates and persists an ID, and an install receiver records an initialization state. The code also contains a reusable SMS sender with sent/delivery feedback. Source excerpts show these behaviors, but do not establish how the receivers are registered or whether the install SMS is actually sent (that call is commented out).

Main entry points: [`src/com/devspark/securityotp/SmsReceiver.java`](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsReceiver.java) (SMS rule checks), [`src/com/devspark/securityotp/SmsSender.java`](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsSender.java) (SMS sender), [`src/com/devspark/securityotp/MainActivity.java`](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/MainActivity.java) (ID activity), [`src/com/devspark/securityotp/PreferenceHelper.java`](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/PreferenceHelper.java) (Preferences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["ID management"]
  node_main["ID activity<br/>[MainActivity.java]"]
  node_prefs[("Preferences")]
  node_install["Install receiver"]
end

subgraph group_interception["SMS interception"]
  node_filter["SMS rule checks<br/>[SmsReceiver.java]"]
  node_forward["SMS forwarding<br/>[SmsReceiver.java]"]
  node_config["SMS settings<br/>[strings.xml]"]
end

subgraph group_messaging["SMS messaging"]
  node_sender["SMS sender<br/>[SmsSender.java]"]
  node_status["Send and delivery callbacks<br/>[SmsSender.java]"]
end

node_user(("User"))
node_incoming["Incoming SMS"]
node_telephony["Android SMS service"]

node_user -->|"uses"| node_main
node_main -->|"reads and saves"| node_prefs
node_install -->|"checks and saves"| node_prefs
node_incoming -->|"delivers SMS"| node_filter
node_filter -->|"reads rules"| node_config
node_filter -->|"forwards matches"| node_forward
node_forward -->|"sends multipart SMS"| node_telephony
node_sender -->|"sends SMS"| node_telephony
node_sender -->|"registers callbacks"| node_status

click node_main "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/MainActivity.java"
click node_prefs "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/PreferenceHelper.java"
click node_install "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/InstallReceiver.java"
click node_filter "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsReceiver.java"
click node_forward "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsReceiver.java"
click node_config "https://github.com/johnkil/spysms/blob/master/res/values/strings.xml"
click node_sender "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsSender.java"
click node_status "https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsSender.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_prefs,node_install,node_user toneBlue
class node_filter,node_forward,node_config toneAmber
class node_sender,node_status toneMint
class node_incoming,node_telephony toneIndigo
```

## Components

### ID management

- [ID activity](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/MainActivity.java): `src/com/devspark/securityotp/MainActivity.java`
- [Preferences](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/PreferenceHelper.java): `src/com/devspark/securityotp/PreferenceHelper.java`
- [Install receiver](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/InstallReceiver.java): `src/com/devspark/securityotp/InstallReceiver.java`

### SMS interception

- [SMS rule checks](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsReceiver.java): `src/com/devspark/securityotp/SmsReceiver.java`
- [SMS forwarding](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsReceiver.java): `src/com/devspark/securityotp/SmsReceiver.java`
- [SMS settings](https://github.com/johnkil/spysms/blob/master/res/values/strings.xml): `res/values/strings.xml`

### SMS messaging

- [SMS sender](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsSender.java): `src/com/devspark/securityotp/SmsSender.java`
- [Send and delivery callbacks](https://github.com/johnkil/spysms/blob/master/src/com/devspark/securityotp/SmsSender.java): `src/com/devspark/securityotp/SmsSender.java`

### Other components

- **User**
- **Incoming SMS**
- **Android SMS service**

## Connections

- User → ID activity: uses (evidence: `src/com/devspark/securityotp/MainActivity.java`)
- ID activity → Preferences: reads and saves (evidence: `src/com/devspark/securityotp/MainActivity.java`)
- Install receiver → Preferences: checks and saves (evidence: `src/com/devspark/securityotp/InstallReceiver.java`)
- Incoming SMS → SMS rule checks: delivers SMS (evidence: `README.md`)
- SMS rule checks → SMS settings: reads rules (evidence: `src/com/devspark/securityotp/SmsReceiver.java`)
- SMS rule checks → SMS forwarding: forwards matches (evidence: `src/com/devspark/securityotp/SmsReceiver.java`)
- SMS forwarding → Android SMS service: sends multipart SMS (evidence: `src/com/devspark/securityotp/SmsReceiver.java`)
- SMS sender → Android SMS service: sends SMS (evidence: `src/com/devspark/securityotp/SmsSender.java`)
- SMS sender → Send and delivery callbacks: registers callbacks (evidence: `src/com/devspark/securityotp/SmsSender.java`)
