Add firebaseDeviceVerificationParametersPlayIntegrity.cloud_project_number.

This commit is contained in:
levlam 2024-06-27 19:24:45 +03:00
parent aa6c964692
commit 8b1ed9d258
4 changed files with 19 additions and 5 deletions

View File

@ -177,8 +177,10 @@ authorizationStateClosed = AuthorizationState;
//@description Device verification must be performed with the SafetyNet Attestation API @nonce Nonce to pass to the SafetyNet Attestation API
firebaseDeviceVerificationParametersSafetyNet nonce:bytes = FirebaseDeviceVerificationParameters;
//@description Device verification must be performed with the Play Integrity API @nonce Base64url-encoded nonce to pass to the Play Integrity API
firebaseDeviceVerificationParametersPlayIntegrity nonce:string = FirebaseDeviceVerificationParameters;
//@description Device verification must be performed with the Play Integrity API
//@nonce Base64url-encoded nonce to pass to the Play Integrity API
//@cloud_project_number Cloud project number to pass to the Play Integrity API
firebaseDeviceVerificationParametersPlayIntegrity nonce:string cloud_project_number:int64 = FirebaseDeviceVerificationParameters;
//@description Represents the current state of 2-step verification

View File

@ -229,7 +229,11 @@ SendCodeHelper::AuthenticationCodeInfo SendCodeHelper::get_sent_authentication_c
}
if ((code_type->flags_ & telegram_api::auth_sentCodeTypeFirebaseSms::PLAY_INTEGRITY_NONCE_MASK) != 0) {
return AuthenticationCodeInfo{AuthenticationCodeInfo::Type::FirebaseAndroidPlayIntegrity, code_type->length_,
<<<<<<< HEAD
code_type->play_integrity_nonce_.as_slice().str()};
=======
std::move(nonce), 0, code_type->play_integrity_project_id_};
>>>>>>> 1062f39ce (Add firebaseDeviceVerificationParametersPlayIntegrity.cloud_project_number.)
}
#elif TD_DARWIN
if ((code_type->flags_ & telegram_api::auth_sentCodeTypeFirebaseSms::RECEIPT_MASK) != 0) {
@ -285,7 +289,7 @@ td_api::object_ptr<td_api::AuthenticationCodeType> SendCodeHelper::get_authentic
case AuthenticationCodeInfo::Type::FirebaseAndroidPlayIntegrity:
return td_api::make_object<td_api::authenticationCodeTypeFirebaseAndroid>(
td_api::make_object<td_api::firebaseDeviceVerificationParametersPlayIntegrity>(
base64url_encode(authentication_code_info.pattern)),
base64url_encode(authentication_code_info.pattern), authentication_code_info.cloud_project_number),
authentication_code_info.length);
case AuthenticationCodeInfo::Type::FirebaseIos:
return td_api::make_object<td_api::authenticationCodeTypeFirebaseIos>(

View File

@ -78,11 +78,17 @@ class SendCodeHelper {
Type type = Type::None;
int32 length = 0;
int32 push_timeout = 0;
int64 cloud_project_number = 0;
string pattern;
AuthenticationCodeInfo() = default;
AuthenticationCodeInfo(Type type, int32 length, string pattern, int32 push_timeout = 0)
: type(type), length(length), push_timeout(push_timeout), pattern(std::move(pattern)) {
AuthenticationCodeInfo(Type type, int32 length, string pattern, int32 push_timeout = 0,
int64 cloud_project_number = 0)
: type(type)
, length(length)
, push_timeout(push_timeout)
, cloud_project_number(cloud_project_number)
, pattern(std::move(pattern)) {
}
template <class StorerT>

View File

@ -19,6 +19,7 @@ void SendCodeHelper::AuthenticationCodeInfo::store(StorerT &storer) const {
store(type, storer);
store(length, storer);
store(push_timeout, storer);
store(cloud_project_number, storer);
store(pattern, storer);
}
@ -28,6 +29,7 @@ void SendCodeHelper::AuthenticationCodeInfo::parse(ParserT &parser) {
parse(type, parser);
parse(length, parser);
parse(push_timeout, parser);
parse(cloud_project_number, parser);
parse(pattern, parser);
}