Messages is a modern, high-performance Android Default SMS & MMS Messaging Application featuring an embedded HTTP REST API Server and Real-Time Webhook Engine. Transform any Android phone into an automated, self-hosted SMS/MMS Gateway without third-party cloud service fees!
- π¬ Full Messaging Suite: Default SMS & MMS application with real-time updates, contact auto-sync, OTP copying, notification actions, and media previews.
- π Embedded Local REST API Gateway: Native
ServerSocketHTTP server running as an Android Foreground Service on port8080. - π API Key Security: Endpoints protected with configurable
X-API-Keyauthentication. - β‘ Real-Time Webhooks: Automatically dispatches incoming SMS notifications as HTTP
POSTJSON payloads to your custom webhook endpoints. - πΌοΈ MMS Image Sending: API endpoints to send images and media attachments directly via cellular network.
- π Real-Time Terminal Console: Built-in visual request logger displaying HTTP status codes and live network activity.
- β‘ Butter-Smooth Performance: Thread-safe in-memory contact caching ensuring zero Main-UI thread lag while scrolling.
- Android Device or AVD Emulator running Android 8.0+ (API Level 26 or higher).
- Active SIM card with an SMS/MMS mobile plan.
# Clone the repository
git clone https://github.com/your-username/Messages.git
cd Messages
# Build Debug APK
./gradlew assembleDebug
# Build Production Release APK (Optimized & Signed)
./gradlew assembleReleaseThe compiled APK will be located at:
app/build/outputs/apk/release/app-release.apk
All API requests require the X-API-Key HTTP header:
X-API-Key: your_generated_api_keyYou can view or regenerate your API Key inside the app under 3-Dots Menu β SMS Gateway.
Endpoint: POST /api/v1/sms/send
curl -X POST http://<PHONE_IP>:8080/api/v1/sms/send \
-H "Content-Type: application/json" \
-H "X-API-Key: gw_c1b21bef24864bb1" \
-d '{
"phone": "+919876543210",
"message": "Hello! Your OTP verification code is 482910."
}'{
"status": "success",
"id": 1614,
"phone": "+919876543210",
"message": "Hello! Your OTP verification code is 482910."
}Endpoint: POST /api/v1/mms/send
curl -X POST http://<PHONE_IP>:8080/api/v1/mms/send \
-H "Content-Type: application/json" \
-H "X-API-Key: gw_c1b21bef24864bb1" \
-d '{
"phone": "+919876543210",
"imageUrl": "https://picsum.photos/300/300",
"caption": "Check out this image!"
}'{
"status": "success",
"phone": "+919876543210"
}Endpoint: GET /api/v1/sms/inbox
curl -H "X-API-Key: gw_c1b21bef24864bb1" http://<PHONE_IP>:8080/api/v1/sms/inbox{
"status": "success",
"count": 2,
"messages": [
{
"id": 1597,
"sender": "AX-CANBNK-S",
"message": "Dear Customer, Acct XXX972 credited with INR 50.00",
"date": 1785722998962,
"type": "received"
},
{
"id": 1596,
"sender": "+919876543210",
"message": "Hello from Gateway API!",
"date": 1785719332439,
"type": "sent"
}
]
}Endpoint: GET /api/v1/status
curl -H "X-API-Key: gw_c1b21bef24864bb1" http://<PHONE_IP>:8080/api/v1/status{
"status": "online",
"version": "1.0",
"ip": "192.168.1.4",
"port": 8080,
"batteryLevel": 100,
"isDefaultSmsApp": true,
"timestamp": 1785764142174
}When an incoming SMS is received on the device, the app dispatches an HTTP POST JSON payload to your configured Webhook URL.
{
"event": "sms_received",
"sender": "+919876543210",
"message": "Your verification code is 834750",
"timestamp": 1785764000000,
"threadId": 5
}- Open the app β SMS Gateway.
- Paste your endpoint URL under Incoming SMS Webhook (e.g.
https://sms.autonomousone.in/api/v1/webhooks/sms-receivedorhttps://webhook.site/xxx). - Tap Save Webhook.
adb forward tcp:8080 tcp:8080
curl -H "X-API-Key: gw_c1b21bef24864bb1" http://localhost:8080/api/v1/status# Forward local port 8080 to a secure HTTPS URL or custom domain
cloudflared tunnel --url http://localhost:8080Connect your Android Gateway device via WebSockets or Nginx Reverse Proxy to route external traffic securely from your custom domain (https://sms.autonomousone.in).
Starting with Android 13/14, side-loaded APKs with SMS permissions require granting Restricted Settings:
- Open phone Settings β Apps β Messages.
- Tap the 3-dots menu (top right) β Allow restricted settings.
- Grant SMS, Contacts, and Phone permissions.
import requests
url = "http://192.168.1.4:8080/api/v1/sms/send"
headers = {"X-API-Key": "gw_c1b21bef24864bb1", "Content-Type": "application/json"}
payload = {
"phone": "+919876543210",
"message": "Hello from Python Script!"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const axios = require('axios');
async function sendSms() {
const response = await axios.post('http://192.168.1.4:8080/api/v1/sms/send', {
phone: '+919876543210',
message: 'Hello from Node.js!'
}, {
headers: {
'X-API-Key': 'gw_c1b21bef24864bb1',
'Content-Type': 'application/json'
}
});
console.log(response.data);
}
sendSms();Distributed under the MIT License. See LICENSE for more details.