From 952d8186f3ac3b5efebed33c11aed244aa27f312 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Jun 2023 20:27:43 +0300 Subject: fixed #3558 (WhatsApp not Signing in) --- protocols/WhatsApp/src/iq.cpp | 8 ++++---- protocols/WhatsApp/src/proto.h | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'protocols/WhatsApp') diff --git a/protocols/WhatsApp/src/iq.cpp b/protocols/WhatsApp/src/iq.cpp index d08eee4b6a..50490829f7 100644 --- a/protocols/WhatsApp/src/iq.cpp +++ b/protocols/WhatsApp/src/iq.cpp @@ -372,7 +372,7 @@ LBL_Error: // not received our jid from server? generate registration packet then if (m_szJid.IsEmpty()) { uint8_t buildHash[16]; - mir_md5_hash((BYTE *)APP_VERSION, sizeof(APP_VERSION) - 1, buildHash); + mir_md5_hash((BYTE *)WA_APPVERSION_STRING, sizeof(WA_APPVERSION_STRING) - 1, buildHash); appVersion.primary = v[0]; appVersion.has_primary = true; appVersion.secondary = v[1]; appVersion.has_secondary = true; @@ -409,9 +409,9 @@ LBL_Error: } Wa__ClientPayload__UserAgent__AppVersion userVersion; - userVersion.primary = 2; userVersion.has_primary = true; - userVersion.secondary = 2230; userVersion.has_secondary = true; - userVersion.tertiary = 15; userVersion.has_tertiary = true; + userVersion.primary = WA_PROTO_MAJOR; userVersion.has_primary = true; + userVersion.secondary = WA_PROTO_MINOR; userVersion.has_secondary = true; + userVersion.tertiary = WA_PROTO_BUILD; userVersion.has_tertiary = true; Wa__ClientPayload__UserAgent userAgent; userAgent.appversion = &userVersion; diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 942ab8d862..0ec03e5313 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -8,8 +8,17 @@ Copyright #if !defined(PROTO_H) #define PROTO_H +#define WA_PROTO_MAJOR 2 +#define WA_PROTO_MINOR 2323 +#define WA_PROTO_BUILD 4 +#define WA_APPVERSION WA_PROTO_MAJOR,WA_PROTO_MINOR,WA_PROTO_BUILD + +#define WA_STRINGIFY_IMPL(x) #x +#define WA_STRINGIFY(x) WA_STRINGIFY_IMPL(x) + +#define WA_APPVERSION_STRING WA_STRINGIFY(WA_APPVERSION) + #define S_WHATSAPP_NET "@s.whatsapp.net" -#define APP_VERSION "2.2230.15" #define KEY_BUNDLE_TYPE "\x05" class WhatsAppProto; -- cgit v1.2.3