forked from BestBotsInTown-EU/Snapchat-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnapchatGenerateTokens.cpp
More file actions
48 lines (30 loc) · 1.43 KB
/
SnapchatGenerateTokens.cpp
File metadata and controls
48 lines (30 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// SnapchatGenerateTokens.cpp
//
// $Id: ... $
//
// This class generates the Snapchat signature variables x-snap-access-token and x-snapchat-att-token
//
// Requirements: no external API, no external service
//
// Copyright (C) 2023 - 2025 by BestBotsInTown, West Europe
// Telegram: BestBotsInTown - https://telegram.me/BestBotsInTown - E-Mail: info@bestbotsintown.com
// Other contact options: https://linktree.com/BestBotsInTown
#include "SnapchatGenerateTokens.h"
std::string SnapchatGenerateTokens::generateHTTPHeaderSignature (std::string strJob) {
std::string strHTTPHeaderSignature = "";
if (strJob == "accept-friend-request") {
// Code removed due to privacy/security reasons
// Telegram: BestBotsInTown - https://telegram.me/BestBotsInTown - E-Mail: info@bestbotsintown.com
// Other contact options: https://linktree.com/BestBotsInTown
} else if (strJob == "add-friend") {
// retrieve x-snap-access-token ("hCgw...") from global variable
strHTTPHeaderSignature += "x-snap-access-token:" + m_strSnapAccessToken + "\n";
// generate x-snapchat-att-token ("Ci...") with reverse engineered native library code
if (generateXSnapchatAttToken()) {
strHTTPHeaderSignature += "x-snapchat-att-token: " + retrieveXSnapchatAttToken() + "\n";
}
// "BgAAAA..." HTTP body (cGRPC Protobuf variable) follows at ::generateHTTPBody()
}
return strHTTPHeaderSignature;
}