Skip to content

Commit

Permalink
Fix merge csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
FeroxRev committed Aug 1, 2016
1 parent 342c079 commit 9a074d8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
36 changes: 18 additions & 18 deletions PokemonGo.RocketAPI/Login/GoogleLogin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DankMemes.GPSOAuthSharp;
using DankMemes.GPSOAuthSharp;
using PokemonGo.RocketAPI.Exceptions;
using System;
using System.Collections.Generic;
Expand All @@ -24,25 +24,25 @@ public GoogleLogin(string email, string password)

public async Task<string> GetAccessToken()
{
var client = new GPSOAuthClient(email, password);
var client = new GPSOAuthClient(email, password);
var response = client.PerformMasterLogin();

if (response.ContainsKey("Error"))
throw new GoogleException(response["Error"]);

//Todo: captcha/2fa implementation

if (!response.ContainsKey("Auth"))
throw new GoogleOfflineException();

var oauthResponse = client.PerformOAuth(response["Token"],
"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com",
"com.nianticlabs.pokemongo",
"321187995bc7cdc2b5fc91b11a96e2baa8602c62");

if (!oauthResponse.ContainsKey("Auth"))
throw new GoogleOfflineException();

if (response.ContainsKey("Error"))
throw new GoogleException(response["Error"]);

//Todo: captcha/2fa implementation

if (!response.ContainsKey("Auth"))
throw new GoogleOfflineException();

var oauthResponse = client.PerformOAuth(response["Token"],
"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com",
"com.nianticlabs.pokemongo",
"321187995bc7cdc2b5fc91b11a96e2baa8602c62");

if (!oauthResponse.ContainsKey("Auth"))
throw new GoogleOfflineException();

return oauthResponse["Auth"];
}
}
Expand Down
10 changes: 5 additions & 5 deletions PokemonGo.RocketAPI/Login/PtcLogin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using PokemonGo.RocketAPI.Exceptions;
using System.Collections.Generic;
using System.Net;
Expand Down Expand Up @@ -26,7 +26,7 @@ public async Task<string> GetAccessToken()
AllowAutoRedirect = false
};

using (var tempHttpClient = new HttpClient(handler))
using (var tempHttpClient = new System.Net.Http.HttpClient(handler))
{
//Get session cookie
var sessionData = await GetSessionCookie(tempHttpClient).ConfigureAwait(false);
Expand Down Expand Up @@ -73,7 +73,7 @@ private static IDictionary<string, string> GenerateTokenVarRequest(string ticket
{"code", ticketId}
};

private static async Task<string> GetLoginTicket(string username, string password, HttpClient tempHttpClient, SessionData sessionData)
private static async Task<string> GetLoginTicket(string username, string password, System.Net.Http.HttpClient tempHttpClient, SessionData sessionData)
{
HttpResponseMessage loginResp;
var loginRequest = GenerateLoginRequest(sessionData, username, password);
Expand All @@ -86,15 +86,15 @@ private static async Task<string> GetLoginTicket(string username, string passwor
return ticketId;
}

private static async Task<SessionData> GetSessionCookie(HttpClient tempHttpClient)
private static async Task<SessionData> GetSessionCookie(System.Net.Http.HttpClient tempHttpClient)
{
var sessionResp = await tempHttpClient.GetAsync(Resources.PtcLoginUrl).ConfigureAwait(false);
var data = await sessionResp.Content.ReadAsStringAsync().ConfigureAwait(false);
var sessionData = JsonConvert.DeserializeObject<SessionData>(data);
return sessionData;
}

private static async Task<string> GetToken(HttpClient tempHttpClient, string ticketId)
private static async Task<string> GetToken(System.Net.Http.HttpClient tempHttpClient, string ticketId)
{
HttpResponseMessage tokenResp;
var tokenRequest = GenerateTokenVarRequest(ticketId);
Expand Down
3 changes: 2 additions & 1 deletion PokemonGo.RocketAPI/PokemonGo.RocketAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<ItemGroup>
<Compile Include="Exceptions\GoogleException.cs" />
<Compile Include="Exceptions\GoogleOfflineException.cs" />
<Compile Include="Exceptions\LoginFailedException.cs" />
<Compile Include="HttpClient\PokemonClient.cs" />
<Compile Include="Enums\AuthType.cs" />
<Compile Include="Exceptions\AccessTokenExpiredException.cs" />
Expand All @@ -99,7 +100,7 @@
<Compile Include="Helpers\Utils.cs" />
<Compile Include="ISettings.cs" />
<Compile Include="Login\GoogleLogin.cs" />
<Compile Include="Login\GoogleLoginGPSOAuth.cs" />
<Compile Include="Login\ILoginType.cs" />
<Compile Include="Login\PtcLogin.cs" />
<Compile Include="Rpc\BaseRpc.cs" />
<Compile Include="Rpc\Download.cs" />
Expand Down

0 comments on commit 9a074d8

Please sign in to comment.