Since 18 Feb 2023, Telegram no longer send verification code by SMS when trying to connect with 3rd-party libraries.
Telegram gives on the official pair which is used in android telegram API_PUBLISHED_FLOOD
I'm looking for a way to fix this story because I know there is a 100% solution.
What did I do?
I added a bunch of different parameters to init connection.
For example, I will take pyrogram code, but telethon has the same results, only there inside the library I had to add params and uncomment lang_pack
init_params = JsonObject(value=[
JsonObjectValue(
key="installer",
value=JsonString(value="com.android.shell")
),
JsonObjectValue(
key="package_id",
value=JsonString(value=".telegram.messenger")
),
JsonObjectValue(
key="tz_offset",
value=JsonNumber(value=-25200)
),
JsonObjectValue(
key="perf_cat",
value=JsonNumber(value=params['PERF_CAT']) # for example 2
)
])
try:
app = Client(number,
phone_number=number,
workdir="soft/sessions",
api_id=params['APP_ID'],
api_hash=params['APP_HASH'],
device_model=params['DEVICE'], // "Huaweinova Y90"
system_version=params['SDK'], // "SDK 30"
app_version="11.8.2 (57842)",
lang_pack=params['LANG_PACK'], // "android"
lang_code=params['LANG_CODE'], // "es"
system_lang_code=params['SYSTEM_LANG_CODE'], // "es-la"
proxy=proxy,
client_platform=ClientPlatform.ANDROID,
init_connection_params=init_params
)
await app.connect()
sent = await app.send_code(
phone_number=number,
allow_app_hash=True,
allow_flashcall=True,
allow_firebase=True,
current_number=True,
allow_missed_call=True,
)
This did not produce any results.
Then I went to look at telegram android source .
Build in 2 modes, release and debug.
Both applications write API_PUBLISHED_FLOOD in the logs.
I got the feeling that Telegram does not document all the parts and something is missing in this puzzle.