diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index d7e2bca8..31741680 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1634,9 +1634,8 @@ call id:int32 user_id:int32 is_outgoing:Bool state:CallState = Call; //@description Contains settings for the authentication of the user's phone number //@allow_flash_call Pass true if the authentication code may be sent via flash call to the specified phone number //@is_current_phone_number Pass true if the authenticated phone number is used on the current device -//@app_specific_sms_token For official applications only. A single use app specific 11-character token received from SmsManager.createAppSpecificSmsToken if the app is run on Android >= 26 and the authentication code is allowed to be automatically received from the SMS. If specified, this token is preferred over app_hash_string -//@app_hash_string For official applications only. An 11-character hash string that identifies the app if the app can use Android SMS Retriever API (requires Google Play Services >= 11.0). See https://developers.google.com/identity/sms-retriever/ for more details -phoneNumberAuthenticationSettings allow_flash_call:Bool is_current_phone_number:Bool app_specific_sms_token:string app_hash_string:string = PhoneNumberAuthenticationSettings; +//@allow_sms_retriever_api For official applications only. True, if the app can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details +phoneNumberAuthenticationSettings allow_flash_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool = PhoneNumberAuthenticationSettings; //@description Represents a list of animations @animations List of animations diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 6b38b1bc..9cdc7034 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/SendCodeHelper.cpp b/td/telegram/SendCodeHelper.cpp index ae248715..7bd1557c 100644 --- a/td/telegram/SendCodeHelper.cpp +++ b/td/telegram/SendCodeHelper.cpp @@ -48,14 +48,10 @@ telegram_api::object_ptr SendCodeHelper::get_input_c if (settings->is_current_phone_number_) { flags |= telegram_api::codeSettings::CURRENT_NUMBER_MASK; } - if (check_utf8(settings->app_specific_sms_token_) && !settings->app_specific_sms_token_.empty()) { - app_hash = settings->app_specific_sms_token_; - } else if (check_utf8(settings->app_hash_string_) && !settings->app_hash_string_.empty()) { + if (settings->allow_sms_retriever_api_) { flags |= telegram_api::codeSettings::APP_HASH_PERSISTENT_MASK; - app_hash = settings->app_hash_string_; - } - if (!app_hash.empty()) { flags |= telegram_api::codeSettings::APP_HASH_MASK; + app_hash = "ignored1234"; } } return telegram_api::make_object(flags, false /*ignored*/, false /*ignored*/,