End-to-end automation pipeline that orchestrates Android emulators / devices, Appium, ADB, SMS providers, a custom email service, VPN, and Telethon to register and warm up Telegram accounts.
🧩 Important note
This project is a technical portfolio piece. It is intended for educational purposes and for demonstrating automation skills (Python, Telethon, Appium, UI automation, ADB, external APIs).
You are solely responsible for respecting Telegram’s Terms of Service, the SMS provider’s rules, and local laws. Do not use this project for spam, abuse, or any form of malicious activity.
- Overview
- Core features
- Architecture
- Project structure
- Installation
- Configuration
- Usage
- Notes & limitations
- Roadmap / ideas
- License
This repository implements a full automation pipeline for Telegram registration:
- Controls Android emulators or physical devices via ADB + Appium.
- Uses a third-party SMS provider (e.g. sms-activate / GrizzlySMS) to rent numbers and fetch SMS codes.
- Optionally registers a mailbox on Onion Mail (through Windows UI automation) when Telegram requires an email step.
- Uses ExpressVPN GUI automation to rotate IPs or switch locations.
- Builds both Telethon sessions and Telegram Desktop TData for each registered account.
The main script is telegram_regger.py. It ties together all subsystems and can serve as a real-world example of complex automation/orchestration in Python.
- ✅ Automation of Telegram registration flow (number → SMS → login)
- ✅ Android device / emulator control via ADB and Appium
- ✅ Windows UI automation:
- Onion Mail (Chrome) – register/login mailbox, fetch email codes
- ExpressVPN – reconnect or change country
- Telegram Desktop – input phone number and login code
- ✅ SMS provider integration via smsactivate compatible API
- ✅ Session & credentials management:
- Telethon
.sessionfiles - Telegram Desktop
tdatafolders - Optional conversion between TData / auth keys / Telethon sessions
- Telethon
- ✅ Device “fingerprint” randomisation (IMEI, Android ID, user-agent, timezone, etc.)
- ✅ Simple local stats tracking via JSON (success/fail reasons, costs, etc.)
For each account, the pipeline roughly looks like this:
-
Prepare device
- Connect to Android device/emulator via ADB.
- Reset Telegram data and various device identifiers (
auto_reger.adb.reset_data). - Optionally change VPN location or reconnect.
-
Buy number & send to Telegram
- Use
SmsApi(smsactivate-compatible) to rent a phone number. - Validate country code, send the number to Telegram on the Android device via Appium (
Telegram.input_phone_number).
- Use
-
Email (optional)
- If Telegram demands an email, automate Onion Mail in Chrome:
- Register mailbox.
- Login and wait for confirmation mail.
- Provide email back to Telegram if required by flow.
- If Telegram demands an email, automate Onion Mail in Chrome:
-
Receive SMS and complete registration
- Poll SMS provider for the verification code (
SmsApi.check_verif_status). - Enter SMS code in Telegram (Android UI).
- Handle possible 2FA (two-step verification) UI screens.
- Poll SMS provider for the verification code (
-
Create sessions / TData
- Launch Telegram Desktop on Windows with a clean profile.
- Input phone number, read SMS from Android Telegram if needed, log in.
- Save resulting TData folder (
auto_reger.tdesktop,auto_reger.sessions). - Build Telethon
.sessionfile for programmatic access.
-
Store metadata
- Persist account info (phone number, device info, SMS cost, session paths) into JSON under
sessions/converted/….
- Persist account info (phone number, device info, SMS cost, session paths) into JSON under
All of this is orchestrated from telegram_regger.py.
Key modules inside auto_reger/:
-
adb.py
Low-level helpers for ADB:- Connect to device (
connect_adb) - Query device info (model, Android version, Telegram version)
- Randomise identifiers (Android ID, IMEI, MAC, timezone, etc.)
reset_data(...)– high-level reset of Telegram and related settings.
- Connect to device (
-
emulator.py
Appium-based Android automation:Emulator– base class (emulator/device, Appium service, WebDriver)Telegram– Telegram Android UI automation (enter phone number, read SMS, navigate settings, set avatar, etc.)Instagram(optional) – similar pattern for Instagram Lite.
-
windows_automation.py
Windows desktop automation via pywinauto + pyautogui:App– base class (start/attach to app, close, kill background processes)Onion– work with Onion Mail in Chrome (register, login, extract codes)VPN– control ExpressVPN (reconnect, change location)TelegramDesktop– drive Telegram Desktop login (enter phone, code).
-
sms_api.py
Wrapper aroundsmsactivate.api.SMSActivateAPI:- Supports sms-activate / GrizzlySMS handler API.
- Country resolution, price checks, renting numbers (
verification_number). - Polling for codes (
check_verif_status). - Local tracking of activations in
activations.json.
-
tdesktop.py
Tools around Telegram Desktop TData:- Decrypt and parse TData via
tdesktop_decrypter. - Extract
auth_key,dc_id,user_idfor accounts. - Batch process a folder of accounts and generate a JSON summary.
- Decrypt and parse TData via
-
sessions.py
Session management & converters:- Convert TData ↔ Telethon sessions.
- Work with raw
auth_key+dc_idto define Telethon clients. - Android
tgnet.dat+userconfig.xml→ Telethon session or TData. - Helper
set_2fa_safe(...)to set/reset cloud password via Telethon.
-
utils.py
Shared utilities:PROJECT_ROOT,load_config(),CONFIG- JSON read/write, reading text lists, name lists
- Device config loader (
get_device_config) - Emulator process kill helper (
kill_emulator) - Random string generation, avatar download, etc.
Top-level script:
telegram_regger.py
The main orchestration script:- CLI inputs (country, max price, number of accounts).
- Loads
config.yaml. - Picks device config (emulator / physical).
- Repeatedly calls
register_telegram_account(...).
Example repository layout:
Telegrm-Auto-Regger/
├─ auto_reger/
│ ├─ __init__.py
│ ├─ adb.py
│ ├─ emulator.py
│ ├─ sessions.py
│ ├─ sms_api.py
│ ├─ tdesktop.py
│ ├─ utils.py
│ └─ windows_automation.py
├─ sessions/
│ ├─ converted/
│ ├─ tg_desk/
│ └─ telethon/
├─ telegram_regger.py
├─ requirements.txt
├─ config.yaml # not committed; use config.yaml.example instead
├─ config.yaml.example # template config for users
├─ activations.json # created at runtime
├─ cech.json # simple stats storage
└─ README.md
Download the latest TelegramAutoReg.exe from Releases.
No Python installation required! Just:
- Download
TelegramAutoReg.exe - Copy
config.yaml.exampletoconfig.yamland configure - Run the executable
Requirements:
- Python 3.10+
- Windows 10/11 (for desktop automation)
- ADB installed and available (or path configured in
config.yaml) - Android emulator or physical device with USB debugging enabled
Create a virtual environment and install Python deps:
git clone https://github.com/ltrix07/Telegrm-Auto-Regger.git
cd Telegrm-Auto-Regger
python -m venv .venv
.venv\Scripts\activate # on Windows
pip install --upgrade pip
pip install -r requirements.txtTypical requirements.txt (simplified):
telethon
requests
PyYAML
psutil
pyautogui
pywinauto
pywin32
Pillow
pytesseract
Appium-Python-Client
selenium
schedule
cryptography
smsactivate
Some modules used in this project are not on PyPI and should be installed from GitHub (or included as submodules):
tdesktop_decrypter– Telegram Desktop TData decrypterAndroidTelePorter– Android Telegram session converterTGConvertor– TData → Telethon converter
Example (adapt to your actual repos/URLs):
pip install git+https://github.com/ntqbit/tdesktop-decrypter.git
# pip install git+https://github.com/<user>/AndroidTelePorter.git
# pip install git+https://github.com/<user>/TGConvertor.gitIf you plan to only use parts of the project (e.g. just Android automation + SMS), you can omit some of these extras.
The project reads configuration from config.yaml located in the repository root.
Minimal example:
adb:
# E = emulator, P = physical device
device_type: "E"
device_udid: "127.0.0.1:5555" # from `adb devices`
appium_port: 4723
adb_path: "C:\Android\platform-tools\adb.exe"
sms_api:
# "sms-activate" or "grizzly-sms"
service_name: "sms-activate"
# file with API key (single line)
api_key_path: "sms_activate_api.txt"
profiles:
# text files with one name per line (optional)
first_names_file: "data/first_names.txt"
last_names_file: "data/last_names.txt"
server:
# optional: remote server for syncing sessions via scp/docker
user: "user"
host: "example.com"
temp_path: "/tmp/telegram-sessions"
docker_image: "my/docker-image:latest"
telethon:
api_id: 123456
api_hash: "YOUR_API_HASH"
telegram_device_model: "Android"
telegram_system_version: "9"
telegram_app_version: "10.0"You can commit a config.yaml.example file to the repo and keep your real config.yaml out of version control.
⚠️ Warning
Running the script will contact real external services:
- SMS provider (credits will be spent),
- Telegram servers,
- optionally a VPN service and email provider.
Use on test accounts and at your own risk. Always respect the terms of the services you use.
-
Make sure:
config.yamlis properly filled.- ADB sees your device/emulator:
adb devices
- Appium Server is available (or the
Emulatorclass starts it automatically on the configured port).
-
Run the application:
.venv\Scripts\activate # Modern TUI interface (recommended) py -m cli # Or classic script python telegram_regger.py
-
Follow the CLI prompts:
- Country for registration (
USA,United Kingdom, …). - Maximum price per number.
- Number of accounts to register.
- Country for registration (
-
The script will:
- Prepare device / emulator.
- Rotate VPN if configured.
- Rent a number, send it to Telegram.
- Handle email step via Onion Mail (when required).
- Wait for SMS and complete registration.
- Create Telethon session and/or TData.
- Save all metadata into
sessions/…andcech.json.
If something goes wrong, check:
telegram_regger.log– detailed runtime logs.cech.json– simple aggregated stats.activations.json– currently tracked SMS activations.
To create a standalone .exe file that doesn't require Python:
pip install pyinstaller# Simple build
python build.py
# Or manually
pyinstaller TelegramAutoReg.specThe executable will be created in dist/TelegramAutoReg.exe (~50-100 MB).
Place your icon file at assets/icon.ico before building. Recommended size: 256x256.
To distribute the application:
- Build the
.exe - Include
config.yaml.examplealongside the executable - Users just need to:
- Rename
config.yaml.exampletoconfig.yaml - Fill in their API keys
- Run
TelegramAutoReg.exe
- Rename
- The code is tightly coupled to Windows UI (Telegram Desktop, ExpressVPN, Chrome) and coordinates / titles in a specific language (often Russian). For a different OS or locale you’ll need to adjust locators and selectors.
- Device “fingerprint” logic uses ADB + root commands. It assumes:
- Rooted emulator/device,
- Correct ADB path,
- Proper permissions.
- SMS provider integration assumes sms-activate handler API compatibility.
- Some parts (e.g. TData decryption, Android
tgnet.datconversion) rely on external libraries that must be installed separately from GitHub. - This project is not a polished library yet; it’s a working automation lab. The code is intentionally kept verbose and explicit to show how the pieces fit together.
Potential future improvements:
- Refactor
telegram_regger.pyinto smaller CLI commands (scripts/):register_account.pyconvert_sessions.pycollect_stats.py
- Add Dockerfile for server-side processing and CI examples.
- Add tests (unit/integration) for individual modules (
auto_reger/…). - Add a “dry-run” mode (no real SMS/VPN/email calls).
- Make Windows automation more robust by relying less on coordinates and more on accessibility names.
If you’re reading this on GitHub and want to dive deeper, start from:
auto_reger/emulator.py(Android + Telegram automation)auto_reger/windows_automation.py(Onion Mail / VPN / Telegram Desktop)auto_reger/sessions.py(TData / Telethon session logic)telegram_regger.py(orchestration script)