PolySRV – Multiserver Messenger for Android
One familiar app. Any MTProto server you trust.
PolySRV is a fork of the official Telegram for Android source code, based on the Telegram API and the MTProto secure protocol.
On top of the regular Telegram cloud, the client can connect to any number of independent MTProto servers: pick one on the login screen, or add your own by address and public key. The server list is not hardcoded — it is loaded from a remote JSON file, so servers can be added, removed or re-pinged without shipping a new APK.
🔗 Built on MTProto API layer 233.
- 🌐 Multiservers — the official network, your own server, or any community node.
- 🧩 Server list from the CDN — edit
servers.jsonand the app picks it up, no rebuild. - 🏠 Your own infrastructure — self-hosted MTProto servers are first-class citizens.
- 👥 Clean isolation — accounts, sessions and caches are separated per server.
- 🆓 Open source — read it, audit it, build it yourself.
- Server picker at login — dot (online/offline), name,
ip:port, DC count; ping is measured with a real TCP connect. - Add your own server from the app: address, port, RSA public key; the fingerprint is computed from the key and verified during the handshake.
srv://links — server addresses are a linkable scheme, liketg://for Telegram.- Remote server list —
servers.jsonis served from GitHub Pages / CDN and cached locally; the app refreshes it in the background, so the list can be edited without rebuilding. - Per-server isolation — accounts, sessions, caches and DC tables are separate for every server.
- Live ping — measured by CI with a TCP connect every 30 minutes and published to the site.
Android 6.0 (API 23) and above.
The universal APK contains all four ABIs:
arm64-v8aarmeabi-v7ax86x86_64
Single-ABI builds are also supported for smaller APKs (see below).
This repository tracks DrKLO/Telegram. A GitHub Actions workflow (.github/workflows/sync-upstream.yml)
runs every 6 hours, fetches the upstream tip, re-applies our changes and, when the resulting tree
differs, pushes it to the upstream-sync branch.
Our changes are stored as string replacements in scripts/polysrv_edits.json
and applied by scripts/patch_polysrv.py — no fragile git apply of patches.
If an upstream refactor breaks a replacement, the patcher reports exactly which ones no longer match
instead of silently dropping them. Regenerate the JSON after changing our sources:
python3 scripts/generate_polysrv_edits.pyThe same workflow builds the APKs (one job per ABI in parallel, then a job that merges them
into a universal APK) with Gradle build cache and ccache for the native code, so warm builds
take minutes instead of an hour.
You will require Android Studio 2025.1.4, Android NDK 27.2.12479018, Android SDK 36 and JDK 21.
- Clone the source code with its submodules:
In case you forgot the
git clone --recursive --shallow-submodules https://github.com/roon9e/polysrv-android.git PolySRV
--recursiveflag, run inside the directory:git submodule init && git submodule update --init --recursive --depth=1 - Copy your
release.keystoreintoTMessagesProj/config. - Fill out
RELEASE_KEY_PASSWORD,RELEASE_KEY_ALIAS,RELEASE_STORE_PASSWORDingradle.properties. - Create Firestore/FCM apps with the package name from
APP_PACKAGEingradle.propertiesand putgoogle-services.jsonnext toTMessagesProj. - Open the project in Android Studio (open it, do not import it).
- Fill out
TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java—APP_IDandAPP_HASHfrom my.telegram.org. - Build from the command line:
The APK is at
./gradlew :TMessagesProj_App:assembleAfatRelease
TMessagesProj_App/build/outputs/apk/afat/release/app.apk.
Single ABI:
./gradlew :TMessagesProj_App:assembleAfatRelease -PabiFilters=arm64-v8aservers.json— the servers shown in the app (official Telegram + your own).servers.env— where the app fetchesservers.jsonandupdate.jsonfrom (primary URL + fallback). Values end up inBuildConfig.SERVERS_CONFIG_URL/SERVERS_CONFIG_URL_FALLBACK.
The public site is published from the gh-pages branch:
https://roon9e.github.io/polysrv-android/.
- OpenSSL (Apache License 2.0)
- FFmpeg (LGPL)
- WebRTC (New BSD License)
- BoringSSL (OpenSSL License)
- libvpx (BSD License)
- dav1d (BSD License)
- libyuv (BSD License)
- OpenH264 (BSD License)
- WAMR (Apache License 2.0)
- SQLite (public domain)
- TDLib / MTProto libraries (Boost Software License)
- zlib (zlib License)
- Open Sans font (Apache License 2.0)
- Vazirmatn font (SIL Open Font License 1.1)
The source code is published under the GNU General Public License v2, the license is available here. The original client is developed by Telegram FZ-LLC and the Telegram Android team; this fork keeps their copyright notices intact.
- DrKLO/Telegram — the official Telegram for Android sources this project is based on.
- OwpenGram Android — for the idea of a multiservers Android client on top of the open Telegram sources.
- The Telegram Desktop and TDLib teams — for the protocol documentation and reference implementations.
- GitHub Actions — for the runners that sync, ping and build everything.
⭐ If PolySRV is useful to you, a star on GitHub helps a lot.