This is the complete source code and the build instructions for the official alternative Android client for the Telegram messenger, based on the Telegram API and the MTProto secure protocol via TDLib.
Other sources
- At least 5,34GB of free disk space: 487,10MB for source codes and around 4,85GB for files generated after building all variants
- 4GB of RAM
- macOS or Linux-based operating system. Windows platform is supported by using MSYS (e.g., Git Bash).
- Homebrew
- git with LFS, wget and sed:
$ brew install git git-lfs wget gsed && git lfs install
- git with LFS:
# apt install git git-lfs
- Run
$ git lfs install
for the current user, if you didn't havegit-lfs
previously installed
- Shell with
git
,wget
, andmake
utilities: - Run
$ git lfs install
for the current user, if you didn't havegit lfs
previously initialized
$ git clone --recursive --depth=1 --shallow-submodules https://github.com/chrhsnv/awesome-tgx awesome-tgx
— clone Telegram X with submodules- In case you forgot the
--recursive
flag,cd
intotgx
directory and:$ git submodule init && git submodule update --init --recursive --depth=1
- Create
keystore.properties
file outside of source tree with the following properties:keystore.file
: absolute path to the keystore filekeystore.password
: password for the keystorekey.alias
: key alias that will be used to sign the appkey.password
: key password.
Warning: keep this file safe and make sure nobody, except you, has access to it. For production builds one could use a separate user with home folder encryption to avoid harm from physical theft $ cd tgx
- Run
$ scripts/./setup.sh
and follow up the instructions - If you specified package name that's different from the one Telegram X uses, setup Firebase and replace
google-services.json
with the one that's suitable for theapp.id
you need - Now you can open the project using Android Studio or build manually from the command line:
./gradlew assembleUniversalRelease
.
arm64
: arm64-v8a build withminSdkVersion
set to21
(Lollipop)arm32
: armeabi-v7a buildx64
: x86_64 build withminSdkVersion
set to21
(Lollipop)x86
: x86 builduniversal
: universal build that includes native bundles for all platforms.
If you are developing a contribution to the project, you may follow the simpler building steps:
$ git clone --recursive https://github.com/chrshnv/awesome-tgx awesome-tgx
$ cd tgx
- Obtain Telegram API credentials
- Create
local.properties
file in the root project folder using any text editor:# Location where you have Android SDK installed sdk.dir=YOUR_ANDROID_SDK_FOLDER # Telegram API credentials obtained at previous step telegram.api_id=YOUR_TELEGRAM_API_ID telegram.api_hash=YOUR_TELEGRAM_API_HASH
- Run
$ scripts/./setup.sh
— this will download required Android SDK packages and build native dependencies that aren't part of project's CMakeLists.txt - Open and build project via Android Studio or by using one of
./gradlew assemble
commands in terminal
After submitting a pull request and its initial review, special build including your contribution will be published in @tgx_prs channel, where it can be tested by the community. In case any issues or bugs found, you may push more commits to an existing PR that address them and request to publish a newer build by using comments section of pull request or in @tgx_dev chat.
Here's a list of related PR-welcome TODOs:
- Project path must not affect the resulting
.so
files, so user & project location requirement could be removed - When building native binaries on macOS,
.comment
ELF section differs from the one built with Linux version of NDK. It must be removed or made deterministic without any side-effects like breakingnative-debug-symbols.zip
(or should be reported to NDK team?) - Checksums of cold APK builds always differ, even though the same keystore applied and generated inner APK contents do not differ. Real cause must be investigated and fixed, if possible.
To generate cold build, invoke$ scripts/./reset.sh
and$ scripts/./setup.sh --skip-sdk-setup
.
Warning: this will also reset changes inside some of the submodules (ffmpeg, libvpx, webp, opus and ExoPlayer)
PS: Docker is not considered an option, as it just hides away these tasks, and requires that all published APKs must be built using it.
awesome-tgx
is licensed under the terms of the GNU General Public License v3.0.
For more information, see LICENSE file.
License of components and third-party dependencies it relies on might differ, check LICENSE
file in the corresponding folder.
List of third-party components used in awesome-tgx can be found here. Additionally you can check the specific commit of the third-party component used, for example, here and here.
awesome-tgx welcomes contributions. Check out pull request template and guide for contributors to learn more about awesome-tgx internals before creating the first pull request.
Please do not use this repository to ask questions: if you have general issue with Telegram, refer to FAQ or contact Telegram Support.