Skip to content

Commit

Permalink
Update register data
Browse files Browse the repository at this point in the history
  • Loading branch information
mgp25 committed Mar 23, 2015
1 parent cde9ffa commit d62153b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion WhatsAppApi/Register/WaToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class WaToken
public static string GenerateToken(string number)
{

string token = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1418865329241"+number;
string token = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1425519315543"+number;
byte[] asciiBytes = ASCIIEncoding.ASCII.GetBytes(token);
byte[] hashedBytes = MD5CryptoServiceProvider.Create().ComputeHash(asciiBytes);
return BitConverter.ToString(hashedBytes).Replace("-", "").ToLower();
Expand Down
5 changes: 2 additions & 3 deletions WhatsAppApi/Register/WhatsRegisterV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static bool RequestCode(string phoneNumber, out string password, out stri
PhoneNumber pn = new PhoneNumber(phoneNumber);
string token = System.Uri.EscapeDataString(WhatsRegisterV2.GetToken(pn.Number));

request = String.Format("https://v.whatsapp.net/v2/code?method={0}&in={1}&cc={2}&id={3}&lg=en&lc=US&token={4}&mcc=000&mnc=000&reason=self-send-jailbroken&network_radio_type=1", method, pn.Number, pn.CC, id, token);
request = String.Format("https://v.whatsapp.net/v2/code?method={0}&in={1}&cc={2}&id={3}&lg={4}&lc={5}&token={6}&sim_mcc=000&sim_mnc=000", method, pn.Number, pn.CC, id, pn.ISO639, pn.ISO3166, token, pn.MCC, pn.MNC);
response = GetResponse(request);
password = response.GetJsonValue("pw");
if (!string.IsNullOrEmpty(password))
Expand Down Expand Up @@ -84,8 +84,7 @@ public static string RegisterCode(string phoneNumber, string code, out string re
}
PhoneNumber pn = new PhoneNumber(phoneNumber);

string uri = string.Format("https://v.whatsapp.net/v2/register?cc={0}&in={1}&id={2}&code={3}&lg={4}&lc={5}", pn.CC, pn.Number, id, code, pn.ISO639, pn.ISO3166);
response = GetResponse(uri);
string uri = string.Format("https://v.whatsapp.net/v2/register?cc={0}&in={1}&id={2}&code={3}", pn.CC, pn.Number, id, code);
if (response.GetJsonValue("status") == "ok")
{
return response.GetJsonValue("pw");
Expand Down
6 changes: 3 additions & 3 deletions WhatsAppApi/Settings/WhatsConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class WhatsConstants
/// <summary>
/// The whatsapp version the client complies to
/// </summary>
public const string WhatsAppVer = "2.12.60";
public const string WhatsAppVer = "2.11.16";

/// <summary>
/// The port that needs to be connected to
Expand All @@ -52,12 +52,12 @@ public class WhatsConstants
/// <summary>
/// iPhone device
/// </summary>
public const string Device = "Nokia302";
public const string Device = "iPhone";

/// <summary>
/// The useragent used for http requests
/// </summary>
public const string UserAgent = "WhatsApp/2.12.60 S40Version/14.26 Device/Nokia302";
public const string UserAgent = "WhatsApp/2.12.68 S40Version/14.26 Device/Nokia302";

#endregion

Expand Down

0 comments on commit d62153b

Please sign in to comment.