Skip to content

Commit 8505ad3

Browse files
committed
V1.3.0.0
1 parent 472a196 commit 8505ad3

111 files changed

Lines changed: 4228 additions & 1935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-debug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
- uses: actions/setup-dotnet@v4
1414
with:
15-
dotnet-version: '6.0.x'
15+
dotnet-version: '8.0.x'
1616

1717
- name: Restore dependencies
1818
run: dotnet restore
@@ -27,4 +27,4 @@ jobs:
2727
uses: actions/upload-artifact@v4
2828
with:
2929
name: Froststrap (Debug) (${{ github.sha }})
30-
path: .\Bloxstrap\bin\Debug\net6.0-windows\win-x64\publish\*
30+
path: .\Bloxstrap\bin\Debug\net8.0-windows\win-x64\publish\*

.github/workflows/ci-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
- uses: actions/setup-dotnet@v4
1414
with:
15-
dotnet-version: '6.0.x'
15+
dotnet-version: '8.0.x'
1616

1717
- name: Restore dependencies
1818
run: dotnet restore
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/upload-artifact@v4
2828
with:
2929
name: Froststrap(Release) (${{ github.sha }})
30-
path: .\Bloxstrap\bin\Release\net6.0-windows\win-x64\publish\*
30+
path: .\Bloxstrap\bin\Release\net8.0-windows\win-x64\publish\*
3131

3232
release:
3333
needs: build

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,10 @@ Bloxstrap/UI/Elements/ContextMenu/RegionSelectorMenu.xaml.cs
355355
Bloxstrap/UI/Elements/Settings/Pages/RegionSelectorPage.xaml.cs
356356
Bloxstrap/UI/Elements/Settings/Pages/RegionSelectorPage.xaml
357357
Bloxstrap/UI/ViewModels/Settings/RegionSelectorViewModel.cs
358+
Bloxstrap/Integrations/AccountManager.cs
359+
Bloxstrap/UI/Elements/Settings/Pages/AccountManagerPage.xaml.cs
360+
Bloxstrap/UI/Elements/Settings/Pages/AccountManagerPage.xaml
361+
Bloxstrap/UI/ViewModels/Settings/AccountManagerViewModel.cs
362+
Bloxstrap/UI/Elements/Dialogs/QuickSignCodeDialog.xaml
363+
Bloxstrap/UI/Elements/Dialogs/QuickSignCodeDialog.xaml.cs
364+
Bloxstrap/Models/GameSearching.cs

Bloxstrap/App.xaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
<Application x:Class="Bloxstrap.App"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:Bloxstrap"
5-
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
6-
xmlns:converters="clr-namespace:Bloxstrap.UI.Converters"
7-
ShutdownMode="OnExplicitShutdown"
8-
DispatcherUnhandledException="GlobalExceptionHandler">
1+
<Application
2+
x:Class="Bloxstrap.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:converters="clr-namespace:Bloxstrap.UI.Converters"
6+
xmlns:local="clr-namespace:Bloxstrap"
7+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
8+
DispatcherUnhandledException="GlobalExceptionHandler"
9+
ShutdownMode="OnExplicitShutdown">
910

1011
<Application.Resources>
1112
<ResourceDictionary>
1213
<ResourceDictionary.MergedDictionaries>
1314
<ui:ThemesDictionary Theme="Dark" />
1415
<ui:ControlsDictionary />
1516
<ResourceDictionary Source="UI/Style/Dark.xaml" />
16-
<!-- NOTE: WpfUiWindow::ApplyTheme relies on this order. -->
17+
<!-- NOTE: WpfUiWindow::ApplyTheme relies on this order. -->
1718
<ResourceDictionary Source="UI/Style/Default.xaml" />
1819
</ResourceDictionary.MergedDictionaries>
1920

2021
<FontFamily x:Key="Rubik">pack://application:,,,/Resources/Fonts/#Rubik Light</FontFamily>
2122

22-
<!-- Define brushes once and reuse -->
23+
<!-- Define brushes once and reuse -->
2324
<SolidColorBrush x:Key="AccentColorSecondaryBrush" Color="{StaticResource SystemAccentColorSecondary}" />
2425
<SolidColorBrush x:Key="AccentColorTertiaryBrush" Color="{StaticResource SystemAccentColorTertiary}" />
2526

@@ -34,7 +35,7 @@
3435
</Style.Triggers>
3536
</Style>
3637

37-
<!-- Converters -->
38+
<!-- Converters -->
3839
<converters:StringFormatConverter x:Key="StringFormatConverter" />
3940
<converters:RangeConverter x:Key="RangeConverter" />
4041
<converters:EnumNameConverter x:Key="EnumNameConverter" />

Bloxstrap/App.xaml.cs

Lines changed: 92 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
using Bloxstrap.Integrations;
2+
using Microsoft.Win32;
13
using System.Reflection;
24
using System.Security.Cryptography;
35
using System.Windows;
6+
using System.Windows.Interop;
7+
using System.Windows.Media;
48
using System.Windows.Shell;
59
using System.Windows.Threading;
6-
using Microsoft.Win32;
10+
using Wpf.Ui.Appearance;
11+
using Wpf.Ui.Controls;
712
using Wpf.Ui.Hardware;
8-
using Bloxstrap.Integrations;
9-
using System.Windows.Interop;
10-
using System.Windows.Media;
1113

1214
namespace Bloxstrap
1315
{
@@ -45,7 +47,8 @@ public partial class App : Application
4547

4648
public static Bootstrapper? Bootstrapper { get; set; } = null!;
4749

48-
public FroststrapRichPresence? _froststrapRPC;
50+
public FroststrapRichPresence RichPresence { get; private set; } = null!;
51+
4952
public static bool IsActionBuild => !String.IsNullOrEmpty(BuildMetadata.CommitRef);
5053

5154
public static bool IsProductionBuild => IsActionBuild && BuildMetadata.CommitRef.StartsWith("tag", StringComparison.Ordinal);
@@ -58,7 +61,9 @@ public partial class App : Application
5861

5962
public static readonly Dictionary<string, BaseTask> PendingSettingTasks = new();
6063

61-
public static readonly JsonManager<Settings> Settings = new();
64+
// Disambiguate Settings so we use the persistable Settings (Bloxstrap.Models.Persistable.Settings),
65+
// not the auto-generated Properties.Settings which doesn't contain the clicker fields.
66+
public static readonly JsonManager<Bloxstrap.Models.Persistable.Settings> Settings = new();
6267

6368
public static readonly JsonManager<State> State = new();
6469

@@ -70,11 +75,9 @@ public partial class App : Application
7075

7176
public static readonly GBSEditor GlobalSettings = new();
7277

73-
public static readonly HttpClient HttpClient = new(
74-
new HttpClientLoggingHandler(
75-
new HttpClientHandler { AutomaticDecompression = DecompressionMethods.All }
76-
)
77-
);
78+
public static readonly CookiesManager Cookies = new();
79+
80+
public static readonly HttpClient HttpClient = new(new HttpClientLoggingHandler(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.All }));
7881

7982

8083
private static bool _showingExceptionDialog = false;
@@ -102,14 +105,6 @@ public static void Terminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS)
102105
Environment.Exit(exitCodeNum);
103106
}
104107

105-
public void CreateFroststrapRpcIfNeeded()
106-
{
107-
if (Settings.Prop.ShowUsingFroststrapRPC && _froststrapRPC == null)
108-
{
109-
_froststrapRPC = new FroststrapRichPresence();
110-
}
111-
}
112-
113108
public static void SoftTerminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS)
114109
{
115110
int exitCodeNum = (int)exitCode;
@@ -161,6 +156,78 @@ public static void FinalizeExceptionHandling(Exception ex, bool log = true)
161156
Terminate(ErrorCode.ERROR_INSTALL_FAILURE);
162157
}
163158

159+
public static FroststrapRichPresence? FrostRPC
160+
{
161+
get => (Current as App)?.RichPresence;
162+
set
163+
{
164+
if (Current is App app)
165+
app.RichPresence = value!;
166+
}
167+
}
168+
169+
private async Task PreloadAccountManagerAsync()
170+
{
171+
const string LOG_IDENT = "App::PreloadAccountManager";
172+
173+
try
174+
{
175+
Logger.WriteLine(LOG_IDENT, "Preloading account manager data...");
176+
177+
var accountManager = new AccountManager();
178+
179+
if (accountManager.ActiveAccount != null)
180+
{
181+
Logger.WriteLine(LOG_IDENT, $"Preloaded active account: {accountManager.ActiveAccount.Username}");
182+
183+
AccountManager.PreloadedInstance = accountManager;
184+
}
185+
186+
Logger.WriteLine(LOG_IDENT, "Account manager preloading completed");
187+
}
188+
catch (Exception ex)
189+
{
190+
Logger.WriteException(LOG_IDENT, ex);
191+
}
192+
}
193+
194+
public static void WindowsBackdrop()
195+
{
196+
Current.Dispatcher.Invoke(() =>
197+
{
198+
var backdropType = App.Settings.Prop.SelectedBackdrop;
199+
ApplyBackdropToAllWindows(backdropType);
200+
});
201+
}
202+
203+
private static void ApplyBackdropToAllWindows(UIBackgroundType backdropType)
204+
{
205+
var wpfBackdrop = backdropType switch
206+
{
207+
UIBackgroundType.None => BackgroundType.None,
208+
UIBackgroundType.Mica => BackgroundType.Mica,
209+
UIBackgroundType.Acrylic => BackgroundType.Acrylic,
210+
UIBackgroundType.Aero => BackgroundType.Aero,
211+
_ => BackgroundType.None
212+
};
213+
214+
foreach (Window window in Current.Windows)
215+
{
216+
if (window is UiWindow uiWindow)
217+
{
218+
bool isTransparentBackdrop = (wpfBackdrop == BackgroundType.Acrylic || wpfBackdrop == BackgroundType.Aero);
219+
220+
uiWindow.AllowsTransparency = isTransparentBackdrop;
221+
222+
uiWindow.WindowStyle = isTransparentBackdrop
223+
? WindowStyle.None
224+
: WindowStyle.SingleBorderWindow;
225+
226+
uiWindow.WindowBackdropType = wpfBackdrop;
227+
}
228+
}
229+
}
230+
164231
public void ApplyCustomFontToWindow(Window window)
165232
{
166233
var fontPath = App.Settings.Prop.CustomFontPath;
@@ -421,6 +488,11 @@ protected override void OnStartup(StartupEventArgs e)
421488
FastFlags.Load();
422489
GlobalSettings.Load();
423490

491+
_ = PreloadAccountManagerAsync();
492+
493+
if (Settings.Prop.AllowCookieAccess)
494+
Task.Run(Cookies.LoadCookies);
495+
424496
if (!Locale.SupportedLocales.ContainsKey(Settings.Prop.Locale))
425497
{
426498
Settings.Prop.Locale = "nil";
@@ -444,7 +516,7 @@ protected override void OnStartup(StartupEventArgs e)
444516

445517
protected override void OnExit(ExitEventArgs e)
446518
{
447-
_froststrapRPC?.Dispose();
519+
RichPresence?.Dispose();
448520
base.OnExit(e);
449521
}
450522
}

Bloxstrap/Bloxstrap.csproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net6.0-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<Nullable>enable</Nullable>
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>True</UseWindowsForms>
99
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
10-
<Version>1.2.6.0</Version>
11-
<FileVersion>1.2.6.0</FileVersion>
10+
<Version>1.3.0.0</Version>
11+
<FileVersion>1.3.0.0</FileVersion>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
@@ -21,7 +21,7 @@
2121
<Resource Include="Bloxstrap.ico" />
2222
<Resource Include="Resources\Checkmark.ico" />
2323
<Resource Include="Resources\CrossMark.ico" />
24-
<Resource Include="Resources\People.png" />
24+
<Resource Include="Resources\RobloxVerified.png" />
2525
<Resource Include="Resources\Froststrap Custom Background.png" />
2626
<Resource Include="Resources\LightEditor.xshd" />
2727
<Resource Include="Resources\Fonts\NotoSansThai-VariableFont_wdth,wght.ttf" />
@@ -84,13 +84,16 @@
8484
<ItemGroup>
8585
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
8686
<PackageReference Include="DiscordRichPresence" Version="1.6.1.70" />
87-
<PackageReference Include="Markdig" Version="0.41.3" />
88-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
87+
<PackageReference Include="Markdig" Version="0.43.0" />
88+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.228">
8989
<!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
9090
<PrivateAssets>all</PrivateAssets>
9191
</PackageReference>
9292
<PackageReference Include="AvalonEdit" Version="6.3.1.120" />
93-
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="65.0.8-preview" />
93+
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="66.0.5-preview" />
94+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
95+
<PackageReference Include="PuppeteerExtraSharp" Version="3.0.1" />
96+
<PackageReference Include="PuppeteerSharp" Version="20.2.4" />
9497
<PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
9598
<PackageReference Include="SharpZipLib" Version="1.4.2" />
9699
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />

Bloxstrap/Bootstrapper.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,33 @@ private async Task GetLatestVersionInfo()
422422
bool ChannelFlag = App.LaunchSettings.ChannelFlag.Active && !string.IsNullOrEmpty(App.LaunchSettings.ChannelFlag.Data);
423423

424424
// CHANNEL CHANGE MODE
425-
void EnrollChannel(string Channel = "production")
426-
{
427-
Deployment.Channel = Channel;
428-
App.Settings.Prop.Channel = Channel;
429-
App.Settings.Save();
430-
}
425+
void EnrollChannel(string Channel = "production") => Deployment.Channel = Channel;
426+
void RevertChannel() => Deployment.Channel = Deployment.DefaultChannel;
431427

432-
void RevertChannel()
428+
string EnrolledChannel = match.Groups.Count == 2 ? match.Groups[1].Value.ToLowerInvariant() : Deployment.DefaultChannel;
429+
430+
// Private channels
431+
if (App.Cookies.Loaded)
433432
{
434-
Deployment.Channel = Deployment.DefaultChannel;
435-
App.Settings.Prop.Channel = Deployment.DefaultChannel;
436-
App.Settings.Save();
437-
}
433+
UserChannel? userChannel = await App.Cookies.GetUserChannel(Deployment.BinaryType);
438434

439-
string EnrolledChannel = match.Groups.Count == 2 ? match.Groups[1].Value.ToLowerInvariant() : Deployment.DefaultChannel;
435+
if (
436+
userChannel?.Token is not null &&
437+
userChannel.AssignmentType != 1 // might need a change in the future
438+
)
439+
{
440+
// prevent roblox from thinking its a different channel
441+
// we have to do it to prevent issues with channel fflags
442+
if (!string.IsNullOrEmpty(EnrolledChannel))
443+
_launchCommandLine = _launchCommandLine.Replace(
444+
$"channel:{EnrolledChannel}",
445+
$"channel:{userChannel.Channel}",
446+
StringComparison.OrdinalIgnoreCase);
447+
448+
Deployment.ChannelToken = userChannel.Token;
449+
EnrolledChannel = userChannel.Channel;
450+
}
451+
}
440452

441453
if (!ChannelFlag)
442454
{

0 commit comments

Comments
 (0)