Skip to content

Commit

Permalink
semi-working piece of crap
Browse files Browse the repository at this point in the history
  • Loading branch information
dd01da0465b4542f8f8af4ecedc149ed committed Jun 26, 2020
1 parent 7778fcc commit f2da63f
Show file tree
Hide file tree
Showing 31 changed files with 237 additions and 2,051 deletions.
41 changes: 24 additions & 17 deletions AuroraLauncher/AuroraLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{C6D5E15A-5A85-4F00-BECF-854A4A54B1EC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>AuroraLauncher</RootNamespace>
<AssemblyName>FortniteLauncher</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
Expand All @@ -22,7 +22,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NATIVE NO_EGL GUI ONLINE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NATIVE ONLINE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -33,7 +33,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NATIVE NO_EGL GUI ONLINE</DefineConstants>
<DefineConstants>TRACE;NATIVE ONLINE FAKE_API</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -52,6 +52,12 @@
<ApplicationIcon>AuroraMin.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.5.2\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="BrotliSharpLib, Version=0.3.2.0, Culture=neutral, PublicKeyToken=3f4e2a1cd615fcb7, processorArchitecture=MSIL">
<HintPath>..\packages\BrotliSharpLib.0.3.3\lib\net451\BrotliSharpLib.dll</HintPath>
</Reference>
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
Expand All @@ -65,19 +71,28 @@
<HintPath>..\packages\RestSharp.106.11.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Titanium.Web.Proxy, Version=3.1.1301.0, Culture=neutral, PublicKeyToken=8e41e1f1c790d7cf, processorArchitecture=MSIL">
<HintPath>..\packages\Titanium.Web.Proxy.3.1.1301\lib\net45\Titanium.Web.Proxy.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Build.cs" />
<Compile Include="OldGui.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OldGui.designer.cs">
<DependentUpon>OldGui.cs</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -110,9 +125,6 @@
<EmbeddedResource Include="Gui.resx">
<DependentUpon>Gui.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OldGui.resx">
<DependentUpon>OldGui.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand All @@ -125,11 +137,6 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="LIBRARIES.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="Resources\Discord-Logo-Color.png" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions AuroraLauncher/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
internal class Build
{
internal const string ClientExecutable = "FortniteClient-Win64-Shipping.exe";
#if !NO_EGL
internal const string ClientArguments = "";
#else
internal const string ClientArguments = "-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal";
#endif

internal const string LauncherNative = "AuroraNative.dll";
internal const string LauncherUri = "https://aurorafn.dev";
Expand Down
84 changes: 58 additions & 26 deletions AuroraLauncher/GUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,71 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Titanium.Web.Proxy;
using Titanium.Web.Proxy.EventArguments;
using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Models;

namespace AuroraLauncher
{
partial class Gui : MaterialForm
{
MaterialSkinManager _skinManager;
#region Field Region

public Configuration Configuration;
MaterialSkinManager _skinManager;

Settings _settings;

ProxyServer _proxy;

Thread _commonHeartbeat;
Thread _onlineHeartbeat;

bool _onlinePaused;

bool _showedUpdate;

Process _clientProcess;
/// <summary>
/// 0 = None, 1 = BattlEye, 2 = EasyAntiCheat
/// </summary>
int _clientAnticheat = 2; // Forced to EAC, until added into Settings.
int _clientAnticheat = 1; // Forced to BE, until added into Settings.

#endregion

#region Property Region

public Configuration Configuration { get; private set; }

#endregion

#region Constructor Region

public Gui()
{
InitializeComponent();

Text += $" [{App.Version}]";

_skinManager = MaterialSkinManager.Instance;
_skinManager.AddFormToManage(this);

Configuration = new Configuration();
Configuration.Open();

// Settings form manages SkinManager
_settings = new Settings(this);

Text += $" [{App.Version}]";
_proxy = new ProxyServer();
_proxy.BeforeRequest += OnBeforeRequest;

_proxy.AddEndPoint(new ExplicitProxyEndPoint(IPAddress.Any, 6000, true));
_proxy.Start();

materialSingleLineTextFieldEmail.Text = Configuration.Email;
materialSingleLineTextFieldPassword.Text = Configuration.Password;
Expand All @@ -71,6 +93,24 @@ public Gui()
#endif
}

#endregion

#region Method Region

public async Task OnBeforeRequest(object sender, SessionEventArgs e)
{
Console.WriteLine(e.HttpClient.Request.Url);

if (e.HttpClient.Request.Url.Contains(".epicgames.com"))
{
var builder = new UriBuilder(e.HttpClient.Request.Url);

builder.Host = "aurorafn.dev";

e.HttpClient.Request.Url = builder.Uri.ToString();
}
}

delegate void SetOnlineTextDelegate(string text);

void SetOnlineText(string text)
Expand Down Expand Up @@ -128,7 +168,7 @@ void CommonHeartbeat()
SetHide();
}
else
_clientProcess = null; // TODO: Probably a dumb hack?
_clientProcess = null; // TODO (Cyuubi): Probably a dumb hack?
}
else
{
Expand Down Expand Up @@ -202,20 +242,10 @@ private void materialRaisedButtonPasswordView_Click(object sender, EventArgs e)
materialRaisedButtonPasswordView.Text = "Hide";
}

void DiscordClick()
{
Process.Start("https://discord.gg/AuroraFN");
}
void DiscordClick() => Process.Start("https://discord.gg/AuroraFN");

private void pictureBoxDiscord_Click(object sender, EventArgs e)
{
DiscordClick();
}

private void materialFlatButtonDiscord_Click(object sender, EventArgs e)
{
DiscordClick();
}
private void pictureBoxDiscord_Click(object sender, EventArgs e) => DiscordClick();
private void materialFlatButtonDiscord_Click(object sender, EventArgs e) => DiscordClick();

public static bool IsValidPath(string path)
{
Expand Down Expand Up @@ -288,7 +318,7 @@ private void materialRaisedButtonLaunch_Click(object sender, EventArgs e)
return;
}

// TODO: Fix this?
// TODO (Cyuubi): Fix this?
if (materialSingleLineTextFieldPassword.Text.Contains(" "))
{
MessageBox.Show("Invalid Password, are you sure it's correct?", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error);
Expand Down Expand Up @@ -334,14 +364,14 @@ private void materialRaisedButtonLaunch_Click(object sender, EventArgs e)
return;
}

var arguments = $"-AUTH_LOGIN={Configuration.Email} -AUTH_PASSWORD={Configuration.Password} -AUTH_TYPE=epic " + Configuration.Arguments;
var arguments = $"-AUTH_LOGIN={Configuration.Email} -AUTH_PASSWORD={Configuration.Password} -AUTH_TYPE=epic {Build.ClientArguments} {Configuration.Arguments}";

if (_clientAnticheat == 0) // None
arguments += $" {Build.ClientArguments} -noeac -nobe -fltoken=none";
arguments += $" -noeac -nobe -fltoken=none";
else if (_clientAnticheat == 1) // BattlEye
arguments += $" {Build.ClientArguments} -noeac -fromfl=be -fltoken={Build.BeToken}";
arguments += $" -noeac -fromfl=be -fltoken={Build.BeToken}";
else if (_clientAnticheat == 2) // EasyAntiCheat
arguments += $" {Build.ClientArguments} -nobe -fromfl=eac -fltoken={Build.EacToken}";
arguments += $" -nobe -fromfl=eac -fltoken={Build.EacToken}";

_clientProcess = new Process
{
Expand Down Expand Up @@ -373,7 +403,7 @@ private void materialRaisedButtonLaunch_Click(object sender, EventArgs e)

reader.Start();
#else
Helper.InjectDll(_clientProcess.Id, Build.LauncherNative);
Helper.InjectDll(_clientProcess.Id, nativePath);
#endif // NATIVE
}

Expand All @@ -397,5 +427,7 @@ private void materialFlatButtonSettings_Click(object sender, EventArgs e)
_settings.Location = Location;
_settings.ShowDialog();
}

#endregion
}
}
7 changes: 0 additions & 7 deletions AuroraLauncher/LIBRARIES.txt

This file was deleted.

Loading

0 comments on commit f2da63f

Please sign in to comment.