from flask import Flask, jsonify, render_template_string import subprocess import json app = Flask(__name__) @app.route('/') def index(): return render_template_string(''' SMS Campaign Manager - Termux

🚀 SMS Campaign Manager

Running on Termux!

✅ Flask Server Status: Active

Server IP: 10.0.0.193:5000

Environment: Termux on Android

🔋 Termux API Tests

📱 Battery Status

🔔 Send Test Notification

''') @app.route('/battery') def battery(): try: result = subprocess.run(['termux-battery-status'], capture_output=True, text=True) battery_data = json.loads(result.stdout) return f"""

🔋 Battery Status

{json.dumps(battery_data, indent=2)}

← Back

""" except Exception as e: return f"

Error

{str(e)}

← Back

" @app.route('/notification') def notification(): try: subprocess.run(['termux-notification', '--title', 'Flask Test', '--content', 'Hello from SMS Campaign Manager!'], capture_output=True, text=True) return f"""

🔔 Notification Sent!

Check your Android notifications.

← Back

""" except Exception as e: return f"

Error

{str(e)}

← Back

" if __name__ == '__main__': print("🚀 Starting SMS Campaign Manager on Termux...") print("📱 Device IP: 10.0.0.193") print("🌐 Access from Ubuntu: http://10.0.0.193:5000") app.run(host='0.0.0.0', port=5000, debug=True)