td icon indicating copy to clipboard operation
td copied to clipboard

Problems with TDLib building its own telegram

Open fendo8888 opened this issue 3 years ago • 6 comments

I want to develop a dedicated h5 version of the program based on telegram+vue.js. After browsing some information, I found that telegram provides api support for this. I encountered the following problems:

  1. I found that TDLib can create its own telegram. I read the api's instructions for login/registration. SMS is required for verification. How to log in/register directly by using username and password? Without SMS verification Register; Login.

fendo8888 avatar Sep 16 '22 02:09 fendo8888

You can't use Telegram without an owned phone number.

levlam avatar Sep 16 '22 18:09 levlam

You can't use Telegram without an owned phone number.

If I create my own client, do I also need a mobile phone number to obtain a verification code for registration/login? I found that there are other telegram-based APPs that only use username and password to register and log in. What is the situation?

image

image

The following source code is the content after decompilation, you can see the tg related code

image

20220917092858

fendo8888 avatar Sep 17 '22 01:09 fendo8888

These apps aren't related to Telegram.

levlam avatar Sep 17 '22 10:09 levlam

These apps aren't related to Telegram.

Does it matter? After I traced it, I found that he inherited TLObject and implemented two of his own (protocol or interface?) I want to understand, I don't know where to start, or is it a custom telegral protocol?

login

TL_auth_SignInByPassword

image

image

register

TL_auth_SignUpV1

image

image

fendo8888 avatar Sep 17 '22 11:09 fendo8888

He calls ConnectionsManager#native_init to initialize here and finally passes in a parameter

image image image

The

Telegram

method in the official telegram repository does not have this parameter, which is a bit strange

public static native void native_init(int currentAccount, int version, int layer, int apiId, String deviceModel, String systemVersion, String appVersion, String langCode, String systemLangCode, String configPath, String logPath, String regId, String cFingerprint, String installer, String packageId, int timezoneOffset, long userId, boolean enablePushConnection, boolean hasNetwork, int networkType); It is estimated that this parameter plays a role. When calling the two custom ones, this parameter is passed in? I don't know what this parameter is used for. I searched around the Internet and couldn't find any instructions.

image

image

fendo8888 avatar Sep 17 '22 12:09 fendo8888

Does it matter?

Yes, the app isn't related to Telegram. You can't have Telegram account without a phone number.

levlam avatar Sep 17 '22 17:09 levlam