summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-12 20:27:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-12 20:27:48 +0300
commit952d8186f3ac3b5efebed33c11aed244aa27f312 (patch)
treee01ff7249034dbabc993dc9e31f703de47a4c6eb
parentab227cc514430be9528df261043af860dc3d3b42 (diff)
fixed #3558 (WhatsApp not Signing in)
-rw-r--r--protocols/WhatsApp/src/iq.cpp8
-rw-r--r--protocols/WhatsApp/src/proto.h11
2 files changed, 14 insertions, 5 deletions
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 © 2019-23 George Hazan
#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;