A fork of the Telegram for Android client with a built-in
VPN / proxy module (vpn-core) powered by the Xray core
(via AndroidLibXrayLite).
This is a fresh, standalone snapshot — it does not carry the upstream Telegram git history.
Unlike running a separate VPN app alongside Telegram, Tejar embeds the tunnel directly into the
messenger: the vpn-core module parses subscription links (VLESS / Trojan / Shadowsocks),
generates the Xray config, and runs the proxy as a foreground service from inside the Telegram
client itself. To our knowledge no other public Telegram fork ships an integrated Xray-based
VPN core like this.
| Path | Description |
|---|---|
telegram-android/ |
The Telegram Android client (fork of DrKLO/Telegram) with the VPN integration applied. |
vpn-core/ |
Standalone Android library module (com.telegram.vpncore) implementing the VPN logic. |
TMessagesProj-patches/ |
Patches applied to the Telegram project sources. |
INTEGRATION.md |
Step-by-step guide (RU) for wiring vpn-core into a clean Telegram checkout. |
find-integration-points.sh |
Helper script to locate integration points in the Telegram sources. |
The vpn-core module parses subscription links and runs them through Xray:
- Protocols: VLESS, Trojan, Shadowsocks (see
LinkParser.kt). - Config generation:
XrayConfigGenerator.ktbuilds the Xray JSON config. - Runtime:
VpnProxyManager.kt/ProxyForegroundService.ktmanage the tunnel as a foreground service. - Persistence:
VpnConfigRepository.ktstores configurations.
See INTEGRATION.md for how the module is attached to the Telegram build.
This is a standard Gradle Android project. Open telegram-android/ in Android Studio or build from the CLI.
The following are intentionally git-ignored and must be provided locally:
-
Telegram API credentials — obtain an
api_id/api_hashfrom my.telegram.org and add them totelegram-android/local.properties:sdk.dir=/path/to/Android/Sdk APP_ID=your_app_id APP_HASH=your_app_hash
The build injects these into
BuildConfig, andBuildVars.javareads them from there. -
Firebase config — place your own
google-services.jsoninto the relevant app modules (telegram-android/TMessagesProj_App/, etc.). Get it from the Firebase console. -
Signing keystore —
*.keystorefiles are git-ignored; configure your own for release builds.
cd telegram-android
./gradlew assembleAfatStandalone # example flavor; see build.gradle for all variants- Telegram for Android — GPL v2+, the base client this fork builds on.
- Xray-core / AndroidLibXrayLite — the proxy core.
This project inherits the GNU GPL v2 (or later) license of the upstream Telegram client — see telegram-android/LICENSE