Jump to content
×
×
  • Create New...

Génération Zaap Token


Hoosted
 Share

Recommended Posts

  • Contributor

Je vous partage un code réaliser par AzureHaze pour récupérer le game token à partir de l'api Ankama ( pour émuler ce que fait le luncher ) si ça peut être utile à certains.

Révélation
using System.Net;
using System.Text;
using System.Text.Json;

var client = new HttpClient();
var login = "XXX";
var password = "XXX";
var gameId = 102;

var req = new HttpRequestMessage
{
    RequestUri = new Uri("https://haapi.ankama.com/json/Ankama/v5/Api/CreateApiKey"),
    Method = HttpMethod.Post,
    Version = HttpVersion.Version20,
    Headers =
    {
        { "user-agent", "Zaap 3.6.15" }
    },
    Content = new StringContent($"login={login}&password={password}&game_id={gameId}&long_life_token=true&shop_key=ZAAP&payment_mode=OK&lang=en", Encoding.UTF8, "text/plain")
};

var response = await client.SendAsync(req);
var createKeyResponse = await JsonSerializer.DeserializeAsync<Dictionary<string, object>>(await response.Content.ReadAsStreamAsync());
var apiKey = createKeyResponse?["key"].ToString();

Console.WriteLine(JsonSerializer.Serialize(createKeyResponse, new JsonSerializerOptions { WriteIndented = true }));

req = new HttpRequestMessage
{
    RequestUri = new Uri("https://haapi.ankama.com/json/Ankama/v5/Account/SignOnWithApiKey"),
    Method = HttpMethod.Post,
    Version = HttpVersion.Version20,
    Headers =
    {
        { "apiKey", $"{apiKey}" },
        { "user-agent", "Zaap 3.6.15" }
    },
    Content = new StringContent($"game={createKeyResponse?["game_id"]}", Encoding.UTF8, "text/plain")
};

response = await client.SendAsync(req);
var signOnResponse = await JsonSerializer.DeserializeAsync<Dictionary<string, object>>(await response.Content.ReadAsStreamAsync());

Console.WriteLine(JsonSerializer.Serialize(signOnResponse, new JsonSerializerOptions { WriteIndented = true }));

var sessionId = signOnResponse["id"].ToString();

req = new HttpRequestMessage
{
    RequestUri = new Uri($"https://haapi.ankama.com/json/Ankama/v5/Game/StartSessionWithApiKey?session_id={sessionId}&server_id=&character_id=&date="),
    Method = HttpMethod.Get,
    Version = HttpVersion.Version20,
    Headers =
    {
        { "apiKey", $"{apiKey}" },
        { "user-agent", "Zaap 3.6.15" }
    }
};

response = await client.SendAsync(req);
var startSessionResponse = await response.Content.ReadAsStringAsync();

Console.WriteLine(startSessionResponse);

req = new HttpRequestMessage
{
    RequestUri = new Uri($"https://haapi.ankama.com/json/Ankama/v5/Account/CreateToken?game=99&certificate_id=&certificate_hash="),
    Method = HttpMethod.Get,
    Version = HttpVersion.Version20,
    Headers =
    {
        { "apiKey", $"{apiKey}" },
        { "user-agent", "Zaap 3.6.15" }
    }
};

response = await client.SendAsync(req);
var createTokenResponse = await JsonSerializer.DeserializeAsync<Dictionary<string, object>>(await response.Content.ReadAsStreamAsync());

Console.WriteLine(JsonSerializer.Serialize(createTokenResponse, new JsonSerializerOptions { WriteIndented = true }));

 

 

  • Funky Emulation 2
Link to comment
Share on other sites

 Share



Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.