mirror of
https://github.com/4sval/FModel.git
synced 2026-09-24 18:24:10 -05:00
Update README.md
This commit is contained in:
@@ -39,7 +39,6 @@ namespace FModel
|
||||
}
|
||||
AESEntries = outputList;
|
||||
}
|
||||
else { throw new Exception("Fail to locate AESManager.xml"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using FModel.Methods.BackupPAKs.Parser.AccessCodeParser;
|
||||
using FModel.Methods.BackupPAKs.Parser.TokenParser;
|
||||
using RestSharp;
|
||||
using System;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,24 +19,17 @@ namespace FModel
|
||||
/// <returns> url content </returns>
|
||||
public static string GetEndpoint(string url, bool auth)
|
||||
{
|
||||
string content = string.Empty;
|
||||
try
|
||||
{
|
||||
RestClient EndpointClient = new RestClient(url);
|
||||
RestRequest EndpointRequest = new RestRequest(Method.GET);
|
||||
RestClient EndpointClient = new RestClient(url);
|
||||
RestRequest EndpointRequest = new RestRequest(Method.GET);
|
||||
|
||||
if (auth)
|
||||
{
|
||||
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
|
||||
}
|
||||
|
||||
var response = EndpointClient.Execute(EndpointRequest);
|
||||
content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
catch (Exception ex)
|
||||
if (auth)
|
||||
{
|
||||
throw new Exception(ex.Message);
|
||||
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
|
||||
}
|
||||
|
||||
var response = EndpointClient.Execute(EndpointRequest);
|
||||
string content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
|
||||
|
||||
return content;
|
||||
}
|
||||
private static string getAccessToken(string email, string password)
|
||||
|
||||
@@ -64,9 +64,9 @@ namespace FModel
|
||||
}
|
||||
}
|
||||
}
|
||||
else { throw new Exception("Unsupported LocRes version."); }
|
||||
else { throw new ArgumentException("Unsupported LocRes version."); }
|
||||
}
|
||||
else { throw new Exception("Wrong LocResMagic number."); }
|
||||
else { throw new ArgumentException("Wrong LocResMagic number."); }
|
||||
}
|
||||
|
||||
return JsonConvert.SerializeObject(LocResDict, Formatting.Indented);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace FModel
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Once upon a time, it was used for shitty stuff
|
||||
///
|
||||
/// </summary>
|
||||
public static void JohnWickCheck()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user