Skip to main content

AndroidTelePorter

pypi package

Serializer and deserializer for mobile telegram session

Table of Contents

Description

This tool can be used to serialize and deserialize session on original Telegram client for Android phones.

It can extract any information stored in files/tgnet.dat and all needed information from shared_prefs/userconfing.xml

It also can deserialize existing session into object and convert it into other session formats (currently supported tdata, telethon and tgnet)

And you can serialize session manually into mobile tgnet format, all you need is just auth key, datacenter id and user id, it is minimum information needed for almost any session format

Installation

You can easily set up this package as it is available on pypi by running the following command

pip install AndroidTelePorter

Usage

Converting existing mobile session into other format

from AndroidTelePorter import AndroidSession

# both tgnet.dat and userconfing.xml are stored in /data/data/org.telegram.messenger directory
# if you have more than 1 account you would need to use tgnet.dat from /files/account(account_number)/tgnet.dat
# and corresponding userconfig.xml file from /shared_prefs/userconfig(account_number).xml
session = AndroidSession.from_tgnet(
    tgnet_path=r'files\tgnet.dat',  # contains auth key and dc id
    userconfig_path=r'shared_prefs\userconfing.xml'  # contains user id
)

session.to_tgnet('converted/tgnet')  # will create all needed files right in directory that you specified
# or
session.to_tdata('converted/pc')  # will create another folder "tdata" inside directory that you specified
# or
session.to_telethon('converted/telethon.session')  # must end with .session

Creating mobile session from auth key, dc id and user id

from AndroidTelePorter import AndroidSession

session = AndroidSession.from_manual(
    auth_key=bytes.fromhex('hex auth key'),
    dc_id=0,  # datacenter id (from 1 to 5)
    user_id=12345678  # telegram user id
)  # can be used to create any session (tgnet / tdata / telethon) from auth key, dc id and user id

session.to_tgnet('converted/tgnet')  # will create all needed files right in directory that you specified

Release files for AndroidTelePorter 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AndroidTelePorter 1.2.1
File Size Uploaded
androidteleporter-1.2.1.tar.gz 43.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for AndroidTelePorter 1.2.1
File Interpreter ABI Platform
androidteleporter-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size:91.6 kB

Release files / androidteleporter-1.2.1.tar.gz

Download URL androidteleporter-1.2.1.tar.gz
Size 43.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2ef8394aeb187ecdbd40bae8cbbe766ac2046ed02694c540380df4a8c64baf54
BLAKE2b-256 checksum
How to use checksums
9404804ad80243baab983520d00aeaa2bde92a79f61eadd3e1c20295a76ff6f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / androidteleporter-1.2.1-py3-none-any.whl

Download URL androidteleporter-1.2.1-py3-none-any.whl
Size 48.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b0b46fcdb1eea7b2b007f8a310dde4afd726f44c484df16064995daf1ec5d19
BLAKE2b-256 checksum
How to use checksums
cb68cc712550d4953a37d790c9c377a0f1e73e4d20bcd1623569d68bb0e12331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page