├── .gitattributes ├── .gitignore ├── .gitmodules ├── README.md ├── Solitude.sln └── Solitude ├── Extensions ├── ProviderExtensions.cs └── TextureExtensions.cs ├── Managers ├── AuthManager.cs ├── BackupManager.cs ├── Core.cs ├── DirectoryManager.cs ├── MappingsManager.cs └── Models │ └── Backup.cs ├── Objects ├── Auth │ └── EpicLauncherAuthenticator.cs ├── ChunkDownloader.cs ├── Dataminer.cs ├── ESolitudeMode.cs ├── Endpoints │ ├── DefaultEndpoint.cs │ ├── EndpointBase.cs │ ├── EpicManifestEndpoint.cs │ └── IEndpoint.cs ├── Graphics │ ├── FortniteIconCreator.cs │ ├── IconCreator.cs │ └── MergedImageCreator.cs └── Profile │ ├── ProfileAthena.cs │ ├── ProfileBuilder.cs │ └── ProfileCosmetic.cs ├── Program.cs ├── Properties ├── Resources.Designer.cs └── Resources.resx ├── Resources ├── BurbankBigRegular-Bold.otf ├── CUBESeries.png ├── ColumbusSeries.png ├── Common.png ├── CreatorCollabSeries.png ├── DCUSeries.png ├── Epic.png ├── FortniteIconBase.png ├── FrozenSeries.png ├── LavaSeries.png ├── Legendary.png ├── MarvelSeries.png ├── Mythic.png ├── PlatformSeries.png ├── Rare.png ├── ShadowSeries.png ├── SlurpSeries.png ├── Transcendent.png ├── Unattainable.png └── Uncommon.png └── Solitude.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "CUE4Parse"] 2 | path = CUE4Parse 3 | url = https://github.com/FabianFG/CUE4Parse.git -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solitude 2 | 3 | Hey, this tool is a pretty simple leaking tool for Fortnite updates which watches the API until a new build releases, then exports new cosmetics and stuff from the build. 4 | 5 | Shoutout to [FModel](https://github.com/4sval/FModel), as it was where I got the idea for this from about a year ago. Incredible project made by smart people. 6 | 7 | This is really straightforward to use, just build it and provide a backup file. 8 | 9 | Don't expect this to be maintained much, I just wanted to spread the knowledge on how this stuff works, and just let it be available for everyone now lol. 10 | -------------------------------------------------------------------------------- /Solitude.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32630.192 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Solitude", "Solitude\Solitude.csproj", "{819A19F1-576C-43B8-A70D-B44798413BBE}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUE4Parse", "CUE4Parse\CUE4Parse\CUE4Parse.csproj", "{1A53408D-98BB-4FD9-9959-B19280817DA6}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUE4Parse-Conversion", "CUE4Parse\CUE4Parse-Conversion\CUE4Parse-Conversion.csproj", "{2209F1F7-635B-4100-B168-0C514E41DF0A}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {819A19F1-576C-43B8-A70D-B44798413BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {819A19F1-576C-43B8-A70D-B44798413BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {819A19F1-576C-43B8-A70D-B44798413BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {819A19F1-576C-43B8-A70D-B44798413BBE}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {1A53408D-98BB-4FD9-9959-B19280817DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {1A53408D-98BB-4FD9-9959-B19280817DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {1A53408D-98BB-4FD9-9959-B19280817DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {1A53408D-98BB-4FD9-9959-B19280817DA6}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {2209F1F7-635B-4100-B168-0C514E41DF0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2209F1F7-635B-4100-B168-0C514E41DF0A}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2209F1F7-635B-4100-B168-0C514E41DF0A}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2209F1F7-635B-4100-B168-0C514E41DF0A}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {F96A2673-86D3-45AE-A5A6-B2660C1E291B} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /Solitude/Extensions/ProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | using CUE4Parse.FileProvider; 2 | using CUE4Parse.UE4.Assets.Exports.Texture; 3 | 4 | namespace Solitude.Extensions; 5 | 6 | public static class ProviderExtensions 7 | { 8 | public static void SaveTextureToDisk(this AbstractFileProvider provider, string texturePath, string outputDir) 9 | { 10 | if (!provider.TryLoadPackageObject(texturePath, out var texture)) 11 | return; 12 | 13 | texture.SaveToDisk(outputDir); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Solitude/Extensions/TextureExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using CUE4Parse.UE4.Assets.Exports.Texture; 3 | using CUE4Parse_Conversion.Textures; 4 | 5 | namespace Solitude.Extensions; 6 | 7 | public static class TextureExtensions 8 | { 9 | public static void SaveToDisk(this UTexture2D texture, string outputDir) 10 | { 11 | try 12 | { 13 | var outputPath = Path.Join(outputDir, texture.Name + ".png"); 14 | 15 | var sw = Stopwatch.StartNew(); 16 | 17 | using var fileStream = File.OpenWrite(outputPath); 18 | var decoded = texture.Decode(); 19 | fileStream.Write(decoded?.Encode(ETextureFormat.Png, out _)); 20 | 21 | sw.Stop(); 22 | 23 | Log.Information("Exported {Texture} in {Milliseconds} ms", texture.Name, sw.ElapsedMilliseconds); 24 | } 25 | catch (Exception e) 26 | { 27 | Log.Error("Couldn't export {Texture}", texture.Name); 28 | Log.Error(e, string.Empty); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Solitude/Managers/AuthManager.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Text.Json; 3 | using Solitude.Objects.Endpoints; 4 | 5 | namespace Solitude.Managers; 6 | 7 | public static class AuthManager 8 | { 9 | private static DefaultEndpoint Endpoint { get; set; } 10 | 11 | static AuthManager() 12 | { 13 | Endpoint = new("https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token", RestSharp.Method.Post); 14 | 15 | Endpoint.WithHeaders(("Authorization", "basic M2Y2OWU1NmM3NjQ5NDkyYzhjYzI5ZjFhZjA4YThhMTI6YjUxZWU5Y2IxMjIzNGY1MGE2OWVmYTY3ZWY1MzgxMmU=")); 16 | Endpoint.WithFormBody(("grant_type", "client_credentials")); 17 | } 18 | 19 | public static bool TryCreateToken([NotNullWhen(true)] out string? token) 20 | { 21 | token = string.Empty; 22 | 23 | var response = Endpoint.GetResponse(); 24 | 25 | if (!response.IsSuccessful || string.IsNullOrEmpty(response.Content)) 26 | { 27 | Log.Error("Couldn't get token response. Status code {Code}", response.StatusCode); 28 | return false; 29 | } 30 | 31 | using var doc = JsonDocument.Parse(response.Content); 32 | 33 | if (!doc.RootElement.TryGetProperty("access_token", out var tokenProp)) 34 | return false; 35 | 36 | token = tokenProp.GetString(); 37 | 38 | if (string.IsNullOrEmpty(token)) 39 | return false; 40 | 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Solitude/Managers/BackupManager.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Text.Json; 3 | using RestSharp; 4 | using Solitude.Managers.Models; 5 | 6 | namespace Solitude.Managers; 7 | 8 | public static class BackupManager 9 | { 10 | public static async Task DownloadBackup() 11 | { 12 | RestClient client = new RestClient(); 13 | RestRequest request = new RestRequest("https://api.fmodel.app/v1/backups/FortniteGame") 14 | { 15 | Timeout = TimeSpan.FromMilliseconds(3 * 1000) 16 | }; 17 | 18 | var response = await client.ExecuteAsync(request); 19 | 20 | if (!response.IsSuccessful || string.IsNullOrWhiteSpace(response.Content)) 21 | { 22 | Log.Error("Response from the FModel Backup API failed"); 23 | return string.Empty; 24 | } 25 | 26 | Debug.Assert(response.Data != null, "response.Data != null"); 27 | var backupPath = Path.Combine(DirectoryManager.BackupsDir, response.Data[4].FileName); 28 | 29 | var backupData = await client.DownloadDataAsync(new RestRequest(response.Data[4].DownloadUrl)); 30 | Log.Information($"Download {response.Data[4].FileName} at {backupPath}"); 31 | 32 | if (backupData == null || backupData.Length <= 0) 33 | { 34 | Log.Error("Failed to download the backup"); 35 | } 36 | 37 | await File.WriteAllBytesAsync(backupPath, backupData); 38 | 39 | return backupPath; 40 | } 41 | } -------------------------------------------------------------------------------- /Solitude/Managers/Core.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Text.Json; 3 | using CUE4Parse.Compression; 4 | using CUE4Parse_Conversion.Textures.BC; 5 | using EpicManifestParser.Api; 6 | using RestSharp; 7 | using Serilog.Sinks.SystemConsole.Themes; 8 | using Solitude.Objects; 9 | using Solitude.Objects.Endpoints; 10 | using Spectre.Console; 11 | 12 | namespace Solitude.Managers; 13 | 14 | public static class Core 15 | { 16 | public static async Task Init() 17 | { 18 | string backupFile; 19 | 20 | Console.Title = "Solitude"; 21 | 22 | Log.Logger = 23 | new LoggerConfiguration() 24 | .MinimumLevel.Verbose() 25 | .WriteTo.Console(theme: AnsiConsoleTheme.Literate) 26 | .CreateLogger(); 27 | 28 | await OodleInit(); 29 | await ZLibInit(); 30 | await InitDetex(); 31 | 32 | if (!MappingsManager.TryGetMappings(out var mappings)) 33 | { 34 | Log.Error("Couldn't retrieve mappings"); 35 | Console.ReadKey(); 36 | return null; 37 | } 38 | 39 | Log.Information("Pulling mappings from {MappingsPath}", mappings); 40 | 41 | var backups = Directory.GetFiles(DirectoryManager.BackupsDir); 42 | 43 | if (backups.Length == 0) 44 | { 45 | Log.Warning("No backups in backups folder."); 46 | backupFile = await BackupManager.DownloadBackup(); 47 | return new Dataminer(mappings, backupFile); 48 | } 49 | 50 | backupFile = AnsiConsole.Prompt( 51 | new SelectionPrompt() 52 | .Title("Choose a [45]backup file[/] to load for getting new files.") 53 | .PageSize(10) 54 | .HighlightStyle("45") 55 | .MoreChoicesText("[grey](Move up and down to see more options)[/]") 56 | .AddChoices(backups)); 57 | 58 | Log.Information("Selected backup file {BackupPath}", backupFile); 59 | 60 | return new Dataminer(mappings, backupFile); 61 | } 62 | 63 | private static bool TryGetVersion(string manifestResponse, [NotNullWhen(true)] out string? version) 64 | { 65 | version = null; 66 | 67 | using var doc = JsonDocument.Parse(manifestResponse); 68 | 69 | if (!doc.RootElement.TryGetProperty("elements", out var elements) || 70 | !elements[0].TryGetProperty("buildVersion", out var buildVersion)) 71 | { 72 | return false; 73 | } 74 | 75 | var versionStr = buildVersion.GetString(); 76 | 77 | if (string.IsNullOrEmpty(versionStr)) 78 | return false; 79 | 80 | version = versionStr; 81 | return true; 82 | } 83 | 84 | private static async Task WatchForUpdateAsync(EpicManifestEndpoint endpoint) 85 | { 86 | var initialRes = await endpoint.GetResponseAsync(); 87 | 88 | if (!initialRes.IsSuccessful || 89 | string.IsNullOrEmpty(initialRes.Content) || 90 | !TryGetVersion(initialRes.Content, out var oldVersion)) 91 | return null; 92 | 93 | RestResponse ret; 94 | 95 | while (true) 96 | { 97 | await Task.Delay(5000); 98 | 99 | Log.Verbose("Watching for change in manifest from {Version}", oldVersion); 100 | var response = await endpoint.GetResponseAsync(); 101 | 102 | if (!response.IsSuccessful) 103 | { 104 | Log.Error("Manifest request unsuccessful with status code {Status} while checking for change", response.StatusCode); 105 | continue; 106 | } 107 | 108 | if (string.IsNullOrEmpty(response.Content) || 109 | !TryGetVersion(response.Content, out var version) || 110 | version == oldVersion) 111 | { 112 | continue; 113 | } 114 | 115 | ret = response; 116 | break; 117 | } 118 | 119 | for (int i = 0; i < 5; i++) 120 | { 121 | Log.Information("NEW VERSION DETECTED"); 122 | } 123 | 124 | return ret; 125 | } 126 | 127 | public static async Task OodleInit() 128 | { 129 | var oodlePath = Path.Combine(DirectoryManager.FilesDir, OodleHelper.OODLE_DLL_NAME); 130 | if (!File.Exists(oodlePath)) await OodleHelper.DownloadOodleDllAsync(oodlePath); 131 | OodleHelper.Initialize(oodlePath); 132 | } 133 | 134 | public static async Task ZLibInit() 135 | { 136 | var dllPath = Path.Combine(DirectoryManager.FilesDir, ZlibHelper.DLL_NAME); 137 | if (!File.Exists(dllPath)) await ZlibHelper.DownloadDllAsync(dllPath); 138 | ZlibHelper.Initialize(dllPath); 139 | } 140 | 141 | public static async Task InitDetex() 142 | { 143 | var detexPath = Path.Combine(DirectoryManager.FilesDir, DetexHelper.DLL_NAME); 144 | if (!File.Exists(detexPath)) await DetexHelper.LoadDllAsync(detexPath); 145 | DetexHelper.Initialize(detexPath); 146 | } 147 | 148 | public static async Task RunAsync(ESolitudeMode mode, Dataminer dataminer) 149 | { 150 | RestResponse? manifestResponse; 151 | EpicManifestEndpoint endpoint = new("launcher/api/public/assets/v2/platform/Windows/namespace/fn/catalogItem/4fe75bbc5a674f4f9b356b5c90567da5/app/Fortnite/label/Live"); 152 | 153 | if (mode == ESolitudeMode.UpdateMode) 154 | { 155 | manifestResponse = await WatchForUpdateAsync(endpoint); 156 | 157 | if (manifestResponse is null) 158 | { 159 | Log.Error("Couldn't watch for new manifest"); 160 | return; 161 | } 162 | } 163 | 164 | else manifestResponse = endpoint.GetResponse(); 165 | var manifestInfo = ManifestInfo.Deserialize(manifestResponse.RawBytes); 166 | 167 | dataminer.Mode = mode; 168 | 169 | await dataminer.InstallDependenciesAsync(manifestInfo); 170 | await dataminer.LoadFilesAsync(); 171 | await dataminer.LoadNewEntriesAsync(); 172 | 173 | await dataminer.DoYourThing(); 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /Solitude/Managers/DirectoryManager.cs: -------------------------------------------------------------------------------- 1 | namespace Solitude.Managers; 2 | 3 | public static class DirectoryManager 4 | { 5 | public static string FilesDir = Path.Combine(Environment.CurrentDirectory, "Files"); 6 | public static string BackupsDir = Path.Combine(FilesDir, "Backups"); 7 | public static string ChunksDir = Path.Combine(FilesDir, "Chunks"); 8 | public static string MappingsDir = Path.Combine(FilesDir, "Mappings"); 9 | public static string OutputDir = Path.Combine(FilesDir, "Output"); 10 | public static string BundlesDir = Path.Combine(OutputDir, "Bundles"); 11 | public static string OutfitsDir = Path.Combine(OutputDir, "Outfits"); 12 | public static string ExportsDir = Path.Combine(OutputDir, "Exports"); 13 | 14 | static DirectoryManager() 15 | { 16 | foreach (var dir in new string[] { FilesDir, ChunksDir, MappingsDir, OutputDir, BundlesDir, OutfitsDir, ExportsDir, BackupsDir }) 17 | { 18 | if (!Directory.Exists(dir)) 19 | { 20 | Directory.CreateDirectory(dir); 21 | Log.Information("Created directory {Dir}", dir); 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Solitude/Managers/MappingsManager.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using RestSharp; 3 | 4 | namespace Solitude.Managers; 5 | 6 | public static class MappingsManager 7 | { 8 | private static bool TryFindSavedMappings(out string mappingsPath) 9 | { 10 | DirectoryInfo mappingsDir = new(DirectoryManager.MappingsDir); 11 | 12 | var mostRecentMappings = 13 | (from usmap in mappingsDir.GetFiles("*.usmap") 14 | orderby usmap.LastWriteTime descending 15 | select usmap).FirstOrDefault(); 16 | 17 | if (mostRecentMappings is not null) 18 | { 19 | mappingsPath = mostRecentMappings.FullName; 20 | return true; 21 | } 22 | 23 | mappingsPath = string.Empty; 24 | 25 | return false; 26 | } 27 | 28 | public static bool TryGetMappings(out string mappingsPath) 29 | { 30 | Log.Information("Attempting to retrieve mappings"); 31 | 32 | mappingsPath = string.Empty; 33 | 34 | using var client = new RestClient(); 35 | 36 | var request = new RestRequest("https://fortnitecentral.genxgames.gg/api/v1/mappings", Method.Get) 37 | { 38 | Timeout = TimeSpan.FromMilliseconds(3 * 1000) 39 | }; 40 | 41 | var response = client.Execute(request); 42 | 43 | if (!response.IsSuccessful || string.IsNullOrEmpty(response.Content)) 44 | { 45 | Log.Error("Request to FortniteCentral for mappings failed."); 46 | 47 | return TryFindSavedMappings(out mappingsPath); 48 | } 49 | 50 | using var doc = JsonDocument.Parse(response.Content); 51 | var root = doc.RootElement; 52 | 53 | if (root.GetArrayLength() <= 0) return false; 54 | 55 | foreach (var mappings in root.EnumerateArray()) 56 | { 57 | if (!mappings.TryGetProperty("fileName", out var fileName) || 58 | !mappings.TryGetProperty("url", out var url)) 59 | { 60 | continue; 61 | } 62 | 63 | mappingsPath = Path.Join(DirectoryManager.MappingsDir, fileName.GetString()); 64 | 65 | if (File.Exists(mappingsPath)) 66 | { 67 | return true; 68 | } 69 | 70 | var mappingsData = client.DownloadData(new(url.GetString())); 71 | 72 | if (mappingsData is null || mappingsData.Length <= 0) 73 | { 74 | Log.Error("Mappings data downloaded from FortniteCentral is null."); 75 | 76 | return TryFindSavedMappings(out mappingsPath); 77 | } 78 | 79 | File.WriteAllBytes(mappingsPath, mappingsData); 80 | 81 | return true; 82 | } 83 | 84 | return false; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Solitude/Managers/Models/Backup.cs: -------------------------------------------------------------------------------- 1 | using J = Newtonsoft.Json.JsonPropertyAttribute; 2 | using I = Newtonsoft.Json.JsonIgnoreAttribute; 3 | 4 | namespace Solitude.Managers.Models; 5 | 6 | public class Backup 7 | { 8 | [J] public string FileName { get; set; } 9 | [J] public string DownloadUrl { get; set; } 10 | [I][J] public string GameName { get; private set; } 11 | [I][J] public string FileSize { get; private set; } 12 | } -------------------------------------------------------------------------------- /Solitude/Objects/Auth/EpicLauncherAuthenticator.cs: -------------------------------------------------------------------------------- 1 | using RestSharp; 2 | using RestSharp.Authenticators; 3 | using Solitude.Managers; 4 | 5 | namespace Solitude.Objects.Auth; 6 | 7 | public class EpicLauncherAuthenticator : IAuthenticator 8 | { 9 | private string _token; 10 | 11 | public EpicLauncherAuthenticator() 12 | { 13 | if (!AuthManager.TryCreateToken(out var token)) 14 | { 15 | throw new System.ArgumentNullException("Couldn't get token for launcher authenticator"); 16 | } 17 | 18 | _token = token; 19 | } 20 | 21 | public ValueTask Authenticate(IRestClient client, RestRequest request) 22 | { 23 | request.AddOrUpdateHeader("Authorization", $"Bearer {_token}"); 24 | return new(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solitude/Objects/ChunkDownloader.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Text.RegularExpressions; 3 | using CUE4Parse.Compression; 4 | using CUE4Parse.FileProvider; 5 | using CUE4Parse.UE4.Readers; 6 | using EpicManifestParser; 7 | using EpicManifestParser.Api; 8 | using EpicManifestParser.UE; 9 | using EpicManifestParser.ZlibngDotNetDecompressor; 10 | using Solitude.Managers; 11 | 12 | namespace Solitude.Objects; 13 | 14 | public class ChunkDownloader 15 | { 16 | private FBuildPatchAppManifest? Manifest { get; set; } 17 | 18 | // https://github.com/4sval/FModel/blob/c014478abc4e455c7116504be92aa00eb00d757b/FModel/ViewModels/CUE4ParseViewModel.cs#L53 19 | private static readonly Regex PakFinder = new(@"^FortniteGame(/|\\)Content(/|\\)Paks(/|\\)", 20 | RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); 21 | 22 | 23 | private void LoadFileForProvider(FFileManifest file, ref StreamedFileProvider provider) 24 | { 25 | if (Manifest is null) 26 | { 27 | Log.Error("{FileName} could not be found", file.FileName); 28 | return; 29 | } 30 | 31 | var sw = Stopwatch.StartNew(); 32 | 33 | if (file.FileName.EndsWith(".utoc")) 34 | { 35 | var versions = provider.Versions; 36 | 37 | // https://github.com/4sval/FModel/blob/c014478abc4e455c7116504be92aa00eb00d757b/FModel/ViewModels/CUE4ParseViewModel.cs#L196 38 | provider.RegisterVfs(file.FileName, [file.GetStream()], 39 | it => new FRandomAccessStreamArchive(it, Manifest.Files.First(x => x.FileName.Equals(it)).GetStream(), versions)); 40 | } 41 | else if (file.FileName.EndsWith(".ucas")) 42 | { 43 | return; 44 | } 45 | else if (file.FileName.EndsWith(".sig")) 46 | { 47 | return; 48 | } 49 | else 50 | { 51 | using var pakStream = file.GetStream(); 52 | provider.RegisterVfs(file.FileName, [pakStream], null); 53 | } 54 | 55 | var ms = sw.ElapsedMilliseconds; 56 | 57 | Log.Information("Downloaded {FileName} in {Milliseconds} ms", file.FileName, ms); 58 | } 59 | 60 | public void LoadFileForProvider(string fileName, ref StreamedFileProvider provider) 61 | { 62 | var file = Manifest?.Files.First(x => x.FileName == fileName); 63 | 64 | if (file is null) 65 | { 66 | Log.Error("{FileName} could not be found", fileName); 67 | return; 68 | } 69 | 70 | LoadFileForProvider(file, ref provider); 71 | } 72 | 73 | public void LoadAllPaksForProvider(ref StreamedFileProvider provider) 74 | { 75 | if (Manifest is null) 76 | return; 77 | 78 | foreach (var file in Manifest.Files) 79 | { 80 | if (!PakFinder.IsMatch(file.FileName) || file.FileName.Contains("optional")) 81 | continue; 82 | 83 | LoadFileForProvider(file, ref provider); 84 | } 85 | 86 | provider.Mount(); 87 | } 88 | 89 | public async Task DownloadManifestAsync(ManifestInfo info) 90 | { 91 | ManifestParseOptions manifestOptions = new ManifestParseOptions 92 | { 93 | ChunkCacheDirectory = DirectoryManager.ChunksDir, 94 | ManifestCacheDirectory = DirectoryManager.ChunksDir, 95 | ChunkBaseUrl = "http://epicgames-download1.akamaized.net/Builds/Fortnite/CloudDir/", 96 | Decompressor = ManifestZlibngDotNetDecompressor.Decompress, 97 | DecompressorState = ZlibHelper.Instance, 98 | }; 99 | 100 | (Manifest, _) = await info.DownloadAndParseAsync(manifestOptions).ConfigureAwait(false); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Solitude/Objects/Dataminer.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Threading; 4 | using CommunityToolkit.HighPerformance; 5 | using CUE4Parse.FileProvider; 6 | using CUE4Parse.MappingsProvider; 7 | using CUE4Parse.UE4.Assets.Exports; 8 | using CUE4Parse.UE4.Assets.Exports.Texture; 9 | using CUE4Parse.UE4.Assets.Objects; 10 | using CUE4Parse.UE4.Objects.Core.i18N; 11 | using CUE4Parse.UE4.Objects.UObject; 12 | using CUE4Parse.UE4.Readers; 13 | using CUE4Parse.UE4.Versions; 14 | using CUE4Parse.UE4.VirtualFileSystem; 15 | using CUE4Parse_Conversion.Textures; 16 | using EpicManifestParser.Api; 17 | using K4os.Compression.LZ4.Streams; 18 | using RestSharp; 19 | using SkiaSharp; 20 | using Solitude.Extensions; 21 | using Solitude.Managers; 22 | using Solitude.Objects.Graphics; 23 | using Solitude.Objects.Profile; 24 | 25 | namespace Solitude.Objects; 26 | 27 | public enum EBackupVersion : byte 28 | { 29 | BeforeVersionWasAdded = 0, 30 | Initial, 31 | PerfectPath, 32 | 33 | LatestPlusOne, 34 | Latest = LatestPlusOne - 1 35 | } 36 | 37 | public class Dataminer 38 | { 39 | public ESolitudeMode Mode { get; set; } 40 | private StreamedFileProvider _provider; 41 | private ChunkDownloader? _chunks; 42 | private string _backup; 43 | private List? _newFiles; 44 | 45 | private const uint _LZ4Magic = 0x184D2204u; 46 | private const uint _backupMagic = 0x504B4246; 47 | 48 | public Dataminer(string mappingsPath, string backupPath) 49 | { 50 | _backup = backupPath; 51 | _provider = new("FortniteGame", new VersionContainer(EGame.GAME_UE5_6), StringComparer.OrdinalIgnoreCase) 52 | { 53 | MappingsContainer = new FileUsmapTypeMappingsProvider(mappingsPath) 54 | }; 55 | } 56 | 57 | public async Task InstallDependenciesAsync(ManifestInfo? manifestInfo) 58 | { 59 | _chunks = new ChunkDownloader(); 60 | 61 | if (manifestInfo is null) 62 | { 63 | Log.Error("Manifest response content was empty."); 64 | return; 65 | } 66 | 67 | await _chunks.DownloadManifestAsync(manifestInfo); 68 | 69 | _chunks.LoadFileForProvider("FortniteGame/Content/Paks/global.utoc", ref _provider); 70 | _chunks.LoadFileForProvider("FortniteGame/Content/Paks/pakchunk10-WindowsClient.utoc", ref _provider); // hahahahahahahahahahahahahaha 71 | _chunks.LoadFileForProvider("FortniteGame/Content/Paks/pakchunk30-WindowsClient.utoc", ref _provider); 72 | _chunks.LoadFileForProvider("FortniteGame/Content/Paks/pakchunk50-WindowsClient.utoc", ref _provider); 73 | _chunks.LoadFileForProvider("FortniteGame/Content/Paks/pakchunk100-WindowsClient.utoc", ref _provider); 74 | } 75 | 76 | public async Task LoadFilesAsync() 77 | { 78 | await _provider.MountAsync(); 79 | } 80 | 81 | // would rather just support fmodel backups than make a separate format 82 | public async Task LoadNewEntriesAsync() // https://github.com/4sval/FModel/blob/c014478abc4e455c7116504be92aa00eb00d757b/FModel/ViewModels/Commands/LoadCommand.cs#L144 83 | { 84 | var sw = Stopwatch.StartNew(); 85 | 86 | using FileStream fileStream = new FileStream(_backup, FileMode.Open); 87 | await using MemoryStream memoryStream = new MemoryStream(); 88 | 89 | if (fileStream.Read() == _LZ4Magic) 90 | { 91 | fileStream.Position -= 4; 92 | await using LZ4DecoderStream compressionStream = LZ4Stream.Decode(fileStream); 93 | await compressionStream.CopyToAsync(memoryStream).ConfigureAwait(false); 94 | } 95 | else 96 | await fileStream.CopyToAsync(memoryStream).ConfigureAwait(false); 97 | 98 | memoryStream.Position = 0; 99 | await using FStreamArchive archive = new FStreamArchive(fileStream.Name, memoryStream); 100 | _newFiles = new List(); 101 | 102 | var magic = archive.Read(); 103 | var paths = new HashSet(); 104 | 105 | if (magic != _backupMagic) 106 | { 107 | archive.Position -= sizeof(uint); 108 | while (archive.Position < archive.Length) 109 | { 110 | archive.Position += 29; 111 | paths.Add(archive.ReadString().ToLower()[1..]); 112 | archive.Position += 4; 113 | } 114 | } 115 | else 116 | { 117 | var version = archive.Read(); 118 | var count = archive.Read(); 119 | for (var i = 0; i < count; i++) 120 | { 121 | archive.Position += sizeof(long) + sizeof(byte); 122 | var fullPath = archive.ReadString(); 123 | if (version < EBackupVersion.PerfectPath) fullPath = fullPath[1..]; 124 | paths.Add(fullPath); 125 | } 126 | } 127 | 128 | foreach (var (key, value) in _provider.Files) 129 | { 130 | if (value is not VfsEntry entry || paths.Contains(key) || !entry.IsUePackage) continue; 131 | 132 | _newFiles.Add(entry); 133 | } 134 | 135 | sw.Stop(); 136 | 137 | Log.Information("Found {Count} new files in {Milliseconds} ms", _newFiles.Count, sw.ElapsedMilliseconds); 138 | } 139 | 140 | public async Task DoYourThing() 141 | { 142 | Log.Information("Prepare for leaks"); 143 | 144 | if (_newFiles is null) 145 | { 146 | Log.Error("New files are null"); 147 | return; 148 | } 149 | 150 | var sw = Stopwatch.StartNew(); 151 | 152 | var newTextures = _newFiles.Where(x => x.Path.Contains("FortniteGame/Plugins/GameFeatures")); 153 | var newBundles = newTextures.Where(x => x.Name.StartsWith("T-AthenaBundle") || x.Name.StartsWith("T_AthenaBundle")); 154 | var newOutfits = newTextures.Where(x => x.Name.StartsWith("T-AthenaSoldier") || x.Name.StartsWith("T_AthenaSoldier")); 155 | 156 | // to multithread or not to? multithreading usually leads to nothing getting exported or the corruption of some exported images. come on cue4 157 | 158 | foreach (var bundlePath in newBundles) 159 | _provider.SaveTextureToDisk(bundlePath.PathWithoutExtension, DirectoryManager.BundlesDir); 160 | 161 | foreach (var outfitPath in newOutfits) 162 | _provider.SaveTextureToDisk(outfitPath.PathWithoutExtension, DirectoryManager.OutfitsDir); 163 | 164 | sw.Stop(); 165 | 166 | Log.Information("Exported all textures in {Time} ms", sw.ElapsedMilliseconds); 167 | 168 | RunCosmetics(); 169 | 170 | foreach (var texturePath in newTextures) 171 | _provider.SaveTextureToDisk(texturePath.PathWithoutExtension, DirectoryManager.ExportsDir); 172 | 173 | await FinishOff(); 174 | } 175 | 176 | private UTexture2D GetIconForCosmetic(UObject cosmetic, IEnumerable? offerImages) 177 | { 178 | if (cosmetic.ExportType == "AthenaPickaxeItemDefinition" && 179 | cosmetic.TryGetValue(out FPackageIndex pickaxePtr, "WeaponDefinition") && 180 | pickaxePtr.TryLoad(out var wid) && 181 | wid is not null && 182 | wid.TryGetValue(out UTexture2D pickaxeIcon, "LargePreviewImage")) 183 | { 184 | return pickaxeIcon; 185 | } 186 | 187 | if (cosmetic.TryGetValue(out var displayAssetPtr, "DisplayAssetPath") && 188 | displayAssetPtr.TryLoad(out var displayAsset) && 189 | displayAsset.TryGetValue(out var tileImage, "TileImage") && 190 | tileImage.TryGetValue(out var resourceObject, "ResourceObject")) 191 | { 192 | return resourceObject; 193 | } 194 | else if (cosmetic.TryGetValue(out FPackageIndex heroDefPtr, "HeroDefinition") && 195 | heroDefPtr.TryLoad(out var heroDef) && 196 | heroDef is not null && 197 | heroDef.TryGetValue(out UTexture2D heroDefIcon, "LargePreviewImage")) 198 | { 199 | return heroDefIcon; 200 | } 201 | else if (cosmetic.TryGetValue(out UTexture2D cosmeticIcon, "LargePreviewImage")) 202 | { 203 | return cosmeticIcon; 204 | } 205 | 206 | return _provider.LoadPackageObject("FortniteGame/Content/Athena/Prototype/Textures/T_Placeholder_Item_Outfit"); 207 | } 208 | 209 | private static bool TryGetIconFromFile(UObject cosmetic, [NotNullWhen(true)] out SKBitmap? outIcon) 210 | { 211 | outIcon = null; 212 | 213 | if (cosmetic.ExportType != "AthenaCharacterItemDefinition") 214 | return false; 215 | 216 | var fileName = cosmetic.Name.Replace('_', '-'); 217 | var iconFilePath = Path.Combine(DirectoryManager.OutfitsDir, $"T-AthenaSoldiers-{fileName}.png"); 218 | 219 | if (!File.Exists(iconFilePath)) 220 | { 221 | return false; 222 | } 223 | 224 | outIcon = SKBitmap.Decode(iconFilePath); 225 | 226 | return true; 227 | } 228 | 229 | public void RunCosmetics() 230 | { 231 | if (_newFiles is null) 232 | return; 233 | 234 | Log.Information("Creating merged cosmetics image"); 235 | 236 | var sw = Stopwatch.StartNew(); 237 | 238 | var imageInfo = new SKImageInfo(512, 562); 239 | var cosmeticIconInfo = new SKImageInfo(512, 512); 240 | var newCosmetics = _newFiles.Where(x => x.PathWithoutExtension.ToLower().StartsWith("FortniteGame/Plugins/GameFeatures/BRCosmetics/Content/Athena/Items/Cosmetics/Characters")); 241 | var offerImages = _newFiles.Where(x => x.PathWithoutExtension.StartsWith("FortniteGame/Content/Catalog/NewDisplayAssets")); 242 | 243 | if (newCosmetics.Count() == 0) 244 | { 245 | Log.Warning("No new cosmetics"); 246 | return; 247 | } 248 | 249 | var profile = new ProfileBuilder(newCosmetics.Count()); 250 | using var mergedImage = new MergedImageCreator(imageInfo, newCosmetics.Count()); 251 | 252 | foreach (var cosmeticFile in newCosmetics) 253 | { 254 | profile.OnCosmeticAdded(cosmeticFile.NameWithoutExtension); 255 | 256 | if (!_provider.TryLoadPackageObject(cosmeticFile.PathWithoutExtension, out var cosmetic)) 257 | continue; 258 | 259 | using var icon = new FortniteIconCreator(imageInfo); 260 | 261 | if (cosmetic.TryGetValue(out var seriesPtr, "Series")) 262 | { 263 | icon.DrawRarityBackground(seriesPtr.Name, cosmeticIconInfo); 264 | } 265 | else if (cosmetic.TryGetValue(out var rarity, "Rarity")) 266 | { 267 | icon.DrawRarityBackground(rarity.Text, cosmeticIconInfo); 268 | } 269 | else icon.DrawRarityBackground("Unattainable"); 270 | 271 | if (TryGetIconFromFile(cosmetic, out var cosmeticIcon)) 272 | { 273 | icon.DrawAndResizeImage(cosmeticIcon, 0, 0, cosmeticIconInfo); 274 | } 275 | else icon.DrawTexture(GetIconForCosmetic(cosmetic, offerImages), 0, 0, cosmeticIconInfo); 276 | 277 | if (cosmetic.TryGetValue(out var displayName, "ItemName")) 278 | { 279 | icon.DrawDisplayName(displayName.Text.ToUpper()); 280 | } 281 | 282 | var img = icon.GetImage(); 283 | 284 | if (img is not null) 285 | mergedImage.AddIcon(img); 286 | } 287 | 288 | using var mergedBmp = mergedImage.Build(); 289 | using var encoded = mergedBmp.Encode(SKEncodedImageFormat.Webp, 80); 290 | 291 | sw.Stop(); 292 | 293 | Log.Information("Created merged image with {Num} cosmetics in {Time} ms", newCosmetics.Count(), sw.ElapsedMilliseconds); 294 | 295 | using var fs = File.Create(Path.Join(DirectoryManager.OutputDir, "merged.webp")); 296 | encoded?.AsStream().CopyTo(fs); 297 | 298 | File.WriteAllText(Path.Join(DirectoryManager.OutputDir, "profile_athena.json"), profile.Build()); 299 | } 300 | 301 | private async Task FinishOff() 302 | { 303 | _chunks.LoadAllPaksForProvider(ref _provider); // download everything else because we got the quick stuff out 304 | await LoadNewEntriesAsync(); 305 | 306 | if (_newFiles is null) 307 | return; 308 | 309 | var textures = _newFiles.Where(x => x.NameWithoutExtension.StartsWith("T-")); 310 | 311 | foreach (var t in textures) 312 | { 313 | if (File.Exists(Path.Join(DirectoryManager.ExportsDir, $"{t.NameWithoutExtension}.png"))) 314 | continue; 315 | 316 | if (!_provider.TryLoadPackageObject(t.PathWithoutExtension, out var texture)) 317 | continue; 318 | 319 | texture.SaveToDisk(DirectoryManager.ExportsDir); 320 | } 321 | 322 | if (_provider.TryLoadPackageObject("FortniteGame/Content/Athena/Apollo/Maps/UI/Apollo_Terrain_Minimap.Apollo_Terrain_Minimap", out UTexture2D map)) 323 | { 324 | map?.SaveToDisk(DirectoryManager.OutputDir); 325 | Log.Information("Saved map image"); 326 | } 327 | 328 | // the rest? do it yourself ;) 329 | } 330 | } 331 | -------------------------------------------------------------------------------- /Solitude/Objects/ESolitudeMode.cs: -------------------------------------------------------------------------------- 1 | namespace Solitude.Objects; 2 | 3 | public enum ESolitudeMode 4 | { 5 | GetNew, 6 | UpdateMode 7 | } 8 | -------------------------------------------------------------------------------- /Solitude/Objects/Endpoints/DefaultEndpoint.cs: -------------------------------------------------------------------------------- 1 | using RestSharp; 2 | 3 | namespace Solitude.Objects.Endpoints; 4 | 5 | public class DefaultEndpoint : EndpointBase 6 | { 7 | 8 | public DefaultEndpoint(string url, Method requestMethod = Method.Get, RestClientOptions? options = null, Parameter? body = null) 9 | { 10 | Client = new(options ?? new()); 11 | Request = new(url, requestMethod); 12 | 13 | if (body is not null) 14 | { 15 | Request.AddParameter(body); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Solitude/Objects/Endpoints/EndpointBase.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using RestSharp; 3 | 4 | namespace Solitude.Objects.Endpoints; 5 | 6 | public abstract class EndpointBase : IEndpoint 7 | { 8 | protected RestClient Client { get; set; } 9 | protected RestRequest Request { get; set; } 10 | 11 | public void Accept(params string[] acceptedTypes) 12 | { 13 | Client.AcceptedContentTypes = acceptedTypes; 14 | } 15 | 16 | public void WithHeaders(params (string, string)[] headers) 17 | { 18 | foreach (var header in headers) 19 | Request.AddOrUpdateHeader(header.Item1, header.Item2); 20 | } 21 | 22 | public void WithFormBody(params (string, string)[] bodyParams) 23 | { 24 | Request.AddOrUpdateHeader("Content-Type", "application/x-www-form-urlencoded"); 25 | 26 | foreach (var param in bodyParams) 27 | Request.AddOrUpdateParameter( 28 | Parameter.CreateParameter(param.Item1, param.Item2, ParameterType.GetOrPost)); 29 | } 30 | 31 | public void WithFormBody(params Parameter[] bodyParams) 32 | { 33 | Request.AddOrUpdateHeader("Content-Type", "application/x-www-form-urlencoded"); 34 | 35 | foreach (var param in bodyParams) 36 | Request.AddOrUpdateParameter(param); 37 | } 38 | 39 | public RestResponse GetResponse() 40 | { 41 | return Client.Execute(Request); 42 | } 43 | 44 | public RestResponse GetResponse() 45 | { 46 | return Client.Execute(Request); 47 | } 48 | 49 | public async Task GetResponseAsync() 50 | { 51 | return await Client.ExecuteAsync(Request); 52 | } 53 | public async Task> GetResponseAsync() 54 | { 55 | return await Client.ExecuteAsync(Request); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Solitude/Objects/Endpoints/EpicManifestEndpoint.cs: -------------------------------------------------------------------------------- 1 | using RestSharp; 2 | using Solitude.Objects.Auth; 3 | 4 | namespace Solitude.Objects.Endpoints; 5 | 6 | public class EpicManifestEndpoint : DefaultEndpoint // took these endpoint models from Nightwatcher, another project of mine 7 | { 8 | private static readonly RestClientOptions _options = new() 9 | { 10 | Authenticator = new EpicLauncherAuthenticator() 11 | }; 12 | 13 | public EpicManifestEndpoint(string manifestPath) 14 | : base($"https://launcher-public-service-prod06.ol.epicgames.com/{manifestPath}", options: _options) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Solitude/Objects/Endpoints/IEndpoint.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using RestSharp; 3 | 4 | namespace Solitude.Objects.Endpoints; 5 | 6 | public interface IEndpoint 7 | { 8 | RestResponse GetResponse(); 9 | RestResponse GetResponse(); 10 | Task GetResponseAsync(); 11 | Task> GetResponseAsync(); 12 | } 13 | -------------------------------------------------------------------------------- /Solitude/Objects/Graphics/FortniteIconCreator.cs: -------------------------------------------------------------------------------- 1 | using SkiaSharp; 2 | 3 | namespace Solitude.Objects.Graphics; 4 | 5 | public class FortniteIconCreator : IconCreator 6 | { 7 | private static SKBitmap IconBase = SKBitmap.Decode(Properties.Resources.FortniteIconBase); 8 | private static SKTypeface BurbankFont = SKTypeface.FromData(SKData.CreateCopy(Properties.Resources.BurbankFont)); 9 | 10 | public FortniteIconCreator(SKImageInfo info) : base(info.Width, info.Height) 11 | { 12 | } 13 | 14 | public FortniteIconCreator() : base(1024, 1124) 15 | { 16 | } 17 | 18 | public void DrawRarityBackground(string name, SKImageInfo? overrideInfo = null) 19 | { 20 | if (name.Contains("::")) 21 | name = name.Split("::")[1]; 22 | 23 | var bg = Properties.Resources.ResourceManager.GetObject(name) as byte[]; 24 | 25 | if (bg is null) 26 | { 27 | DrawRarityBackground("Unattainable"); 28 | return; 29 | } 30 | 31 | Canvas?.DrawBitmap(SKBitmap.Decode(bg).Resize(overrideInfo ?? Info, SKFilterQuality.High), 0, 0); 32 | } 33 | 34 | public void DrawDisplayName(string name) 35 | { 36 | using var textPaint = new SKPaint() 37 | { 38 | TextSize = 32, 39 | IsAntialias = true, 40 | Color = SKColors.GhostWhite, 41 | Typeface = BurbankFont, 42 | TextAlign = SKTextAlign.Center, 43 | Style = SKPaintStyle.Fill, 44 | FakeBoldText = true 45 | }; 46 | 47 | while (textPaint.MeasureText(name) > 475) 48 | { 49 | textPaint.TextSize *= 0.9f; 50 | } 51 | 52 | Canvas?.DrawBitmap(IconBase, 0, 0); 53 | 54 | Canvas?.DrawText(name, Info.Width / 2, Info.Height - 20, textPaint); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /Solitude/Objects/Graphics/IconCreator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CUE4Parse.UE4.Assets.Exports.Texture; 3 | using CUE4Parse_Conversion.Textures; 4 | using SkiaSharp; 5 | 6 | namespace Solitude.Objects.Graphics; 7 | 8 | public class IconCreator : IDisposable 9 | { 10 | public SKSurface? Surface { get; protected set; } 11 | public SKCanvas? Canvas { get; protected set; } 12 | public SKImageInfo Info { get; set; } 13 | 14 | public IconCreator(int width, int height) 15 | { 16 | Info = new(width, height); 17 | 18 | Surface = SKSurface.Create(Info); 19 | Canvas = Surface.Canvas; 20 | } 21 | 22 | public void DrawTexture(UTexture2D texture, int x, int y, SKImageInfo? overrideInfo = null) 23 | { 24 | using var decoded = texture.Decode()?.ToSkBitmap(); 25 | using var resized = decoded?.Resize(overrideInfo ?? Info, new SKSamplingOptions(SKCubicResampler.Mitchell)); 26 | Canvas?.DrawBitmap(resized, x, y); 27 | } 28 | 29 | public void DrawAndResizeImage(SKBitmap bmp, int x, int y, SKImageInfo resizeSize) 30 | => Canvas?.DrawBitmap(bmp.Resize(resizeSize, SKFilterQuality.High), x, y); 31 | 32 | public void DrawImage(SKBitmap bmp, int x, int y) => Canvas?.DrawBitmap(bmp, x, y); 33 | 34 | public SKImage? GetImage() => Surface?.Snapshot(); 35 | 36 | public void Dispose() 37 | { 38 | Canvas?.Dispose(); 39 | Surface?.Dispose(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Solitude/Objects/Graphics/MergedImageCreator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using SkiaSharp; 4 | 5 | namespace Solitude.Objects.Graphics; 6 | 7 | public class MergedImageCreator(SKImageInfo imagesSize, int reserveCount = 0) : IDisposable 8 | { 9 | public SKImageInfo ImagesSize { get; init; } = imagesSize; 10 | private List Images { get; init; } = new(reserveCount); 11 | 12 | public void AddIcon(SKImage image) => Images.Add(image); 13 | 14 | public SKBitmap Build() 15 | { 16 | var imageOrder = (int)Math.Ceiling(Math.Sqrt(Images.Count)); 17 | 18 | var combinedWidth = ImagesSize.Width * imageOrder; 19 | var combinedHeight = Images.Count / imageOrder; 20 | 21 | if (Images.Count % imageOrder != 0) 22 | combinedHeight++; 23 | 24 | combinedHeight *= ImagesSize.Height; 25 | 26 | var bitmap = new SKBitmap(combinedWidth, combinedHeight); 27 | using var canvas = new SKCanvas(bitmap); 28 | var point = new SKPoint(0, 0); 29 | 30 | for (int i = 0, placement = 0; i < Images.Count; i++) 31 | { 32 | if (placement >= imageOrder) 33 | { 34 | placement = 0; 35 | point.Y += ImagesSize.Height; 36 | } 37 | point.X = ImagesSize.Width * placement; 38 | 39 | canvas.DrawImage(Images[i], point); 40 | placement++; 41 | } 42 | 43 | return bitmap; 44 | } 45 | 46 | public void Dispose() 47 | { 48 | foreach (var image in Images) 49 | image.Dispose(); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Solitude/Objects/Profile/ProfileAthena.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Solitude.Objects.Profile; 5 | 6 | public class ProfileAthena 7 | { 8 | public string _id { get; set; } = "Nightwatcher"; 9 | public DateTime created { get; set; } = DateTime.Now; 10 | public DateTime updated { get; set; } = DateTime.Now; 11 | public int rvn { get; set; } = 69; 12 | public int wipeNumber { get; set; } = 1; 13 | public string accountId { get; set; } = "Nightwatcher"; 14 | public string profileId { get; set; } = "athena"; 15 | public string version { get; set; } = "Nightwatcher"; 16 | public Items items { get; set; } = new(); 17 | public Stats stats { get; set; } = new(); 18 | public int commandRevision { get; set; } = 69; 19 | 20 | public class Items 21 | { 22 | public Loadout sandbox_loadout { get; set; } = new(); 23 | } 24 | 25 | public class Loadout 26 | { 27 | public string templateId { get; set; } = "CosmeticLocker:cosmeticlocker_athena"; 28 | public Attributes attributes { get; set; } = new(); 29 | public int quantity { get; set; } = 1; 30 | 31 | public void AddCharacter(string id) => attributes.locker_slots_data.slots.Character.items.Add(id); 32 | public void AddBackpack(string id) => attributes.locker_slots_data.slots.Backpack.items.Add(id); 33 | public void AddDance(string id) => attributes.locker_slots_data.slots.Dance.items.Add(id); 34 | public void AddGlider(string id) => attributes.locker_slots_data.slots.Glider.items.Add(id); 35 | public void AddItemWrap(string id) => attributes.locker_slots_data.slots.ItemWrap.items.Add(id); 36 | public void AddLoadingScreen(string id) => attributes.locker_slots_data.slots.LoadingScreen.items.Add(id); 37 | public void AddMusicPack(string id) => attributes.locker_slots_data.slots.MusicPack.items.Add(id); 38 | public void AddPickaxe(string id) => attributes.locker_slots_data.slots.Pickaxe.items.Add(id); 39 | public void AddContrail(string id) => attributes.locker_slots_data.slots.SkyDiveContrail.items.Add(id); 40 | } 41 | 42 | public class Attributes 43 | { 44 | public Locker_Slots_Data locker_slots_data { get; set; } = new(); 45 | public int use_count { get; set; } = 1; 46 | public string banner_icon_template { get; set; } = "BRS11_Prestige5"; 47 | public string locker_name { get; set; } = "Nightwatcher"; 48 | public string banner_color_template { get; set; } = "DefaultColor40"; 49 | public bool item_seen { get; set; } = false; 50 | public bool favorite { get; set; } = false; 51 | } 52 | 53 | public class Locker_Slots_Data 54 | { 55 | public Slots slots { get; set; } = new(); 56 | } 57 | 58 | public class Slots 59 | { 60 | public Pickaxe Pickaxe { get; set; } = new(); 61 | public Dance Dance { get; set; } = new(); 62 | public Glider Glider { get; set; } = new(); 63 | public Character Character { get; set; } = new(); 64 | public Backpack Backpack { get; set; } = new(); 65 | public ItemWrap ItemWrap { get; set; } = new(); 66 | public LoadingScreen LoadingScreen { get; set; } = new(); 67 | public MusicPack MusicPack { get; set; } = new(); 68 | public SkydiveContrail SkyDiveContrail { get; set; } = new(); 69 | } 70 | 71 | public class Pickaxe 72 | { 73 | public List items { get; set; } = new(); 74 | public ActiveVariant[] activeVariants { get; set; } = { }; 75 | } 76 | 77 | public class Dance 78 | { 79 | public List items { get; set; } = new(); 80 | } 81 | 82 | public class Glider 83 | { 84 | public List items { get; set; } = new(); 85 | } 86 | 87 | public class Character 88 | { 89 | public List items { get; set; } = new(); 90 | public ActiveVariant[] activeVariants { get; set; } = { }; 91 | } 92 | 93 | public class ActiveVariant 94 | { 95 | public Variant[] variants { get; set; } 96 | } 97 | 98 | public class Variant 99 | { 100 | public string channel { get; set; } 101 | public string active { get; set; } 102 | public object[] owned { get; set; } 103 | } 104 | 105 | public class Backpack 106 | { 107 | public List items { get; set; } = new(); 108 | public ActiveVariant[] activeVariants { get; set; } = { }; 109 | } 110 | 111 | public class ItemWrap 112 | { 113 | public List items { get; set; } = new(); 114 | public ActiveVariant[] activeVariants { get; set; } = { }; 115 | } 116 | 117 | public class LoadingScreen 118 | { 119 | public List items { get; set; } = new(); 120 | public ActiveVariant[] activeVariants { get; set; } = { }; 121 | } 122 | 123 | public class MusicPack 124 | { 125 | public List items { get; set; } = new(); 126 | public ActiveVariant[] activeVariants { get; set; } = { }; 127 | } 128 | 129 | public class SkydiveContrail 130 | { 131 | public List items { get; set; } = new(); 132 | public ActiveVariant[] activeVariants { get; set; } = { }; 133 | } 134 | 135 | public class Stats 136 | { 137 | public StatAttributes attributes { get; set; } = new(); 138 | } 139 | 140 | public class StatAttributes 141 | { 142 | public int season_match_boost { get; set; } = 999; 143 | public string[] loadouts { get; set; } = { "sandbox_loadout" }; 144 | public int rested_xp_overflow { get; set; } = 0; 145 | public bool mfa_reward_claimed { get; set; } = true; 146 | public Quest_Manager quest_manager { get; set; } = new(); 147 | public int book_level { get; set; } = 1000; 148 | public int season_num { get; set; } = 15; 149 | public int season_update { get; set; } = 1; 150 | public int book_xp { get; set; } = 1; 151 | public object[] permissions { get; set; } = { }; 152 | public bool book_purchased { get; set; } = true; 153 | public int lifetime_wins { get; set; } = 999; 154 | public string party_assist_quest { get; set; } = string.Empty; 155 | public object[] purchased_battle_pass_tier_offers { get; set; } = { }; 156 | public float rested_xp_exchange { get; set; } = 0.333f; 157 | public int level { get; set; } = 999; 158 | public long xp_overflow { get; set; } = 999999999999; 159 | public int rested_xp { get; set; } = 204000; 160 | public float rested_xp_mult { get; set; } = 12.75f; 161 | public int accountLevel { get; set; } = 10000; 162 | public Competitive_Identity competitive_identity { get; set; } = new(); 163 | public int inventory_limit_bonus { get; set; } = 0; 164 | public string last_applied_loadout { get; set; } = "sandbox_loadout"; 165 | public Daily_Rewards daily_rewards { get; set; } = new(); 166 | public int xp { get; set; } = 10; 167 | public int season_friend_match_boost { get; set; } = 1; 168 | public int active_loadout_index { get; set; } = 1; 169 | public Past_Seasons[] past_seasons { get; set; } = { }; 170 | } 171 | 172 | public class Quest_Manager 173 | { 174 | } 175 | 176 | public class Competitive_Identity 177 | { 178 | } 179 | 180 | public class Daily_Rewards 181 | { 182 | } 183 | 184 | public class Past_Seasons 185 | { 186 | public int seasonNumber { get; set; } 187 | public int numWins { get; set; } = 10000; 188 | public int seasonXp { get; set; } = 1000000; 189 | public int seasonLevel { get; set; } = 500; 190 | public int bookXp { get; set; } = 1000000; 191 | public int bookLevel { get; set; } = 500; 192 | public bool purchasedVIP { get; set; } = true; 193 | } 194 | } 195 | 196 | -------------------------------------------------------------------------------- /Solitude/Objects/Profile/ProfileBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace Solitude.Objects.Profile; 6 | 7 | public class ProfileBuilder(int reserve = 0) 8 | { 9 | private List _cosmetics = new(reserve); 10 | private ProfileAthena _profile = new(); 11 | 12 | public override string ToString() => Build(); 13 | 14 | public string Build() 15 | { 16 | var profileJson = JObject.FromObject(_profile); 17 | 18 | if (profileJson is null) 19 | return string.Empty; 20 | 21 | var items = profileJson["items"]; 22 | 23 | if (items is null) 24 | return string.Empty; 25 | 26 | foreach (var cosmetic in _cosmetics) 27 | { 28 | items[cosmetic.templateId] = JObject.FromObject(cosmetic); 29 | } 30 | 31 | return profileJson.ToString(Formatting.Indented); 32 | } 33 | 34 | public ProfileCosmetic OnCosmeticAdded(string id) 35 | { 36 | ProfileCosmetic ret; 37 | var prefix = id.Remove(id.IndexOf('_')).ToLower(); 38 | 39 | switch (prefix) 40 | { 41 | case "cid": 42 | case "character": 43 | ret = new ProfileCosmetic(id, "AthenaCharacter"); 44 | _profile.items.sandbox_loadout.AddCharacter(ret.templateId); 45 | break; 46 | case "bid": 47 | case "backpack": 48 | ret = new ProfileCosmetic(id, "AthenaBackpack"); 49 | _profile.items.sandbox_loadout.AddBackpack(ret.templateId); 50 | break; 51 | case "pickaxe": 52 | ret = new ProfileCosmetic(id, "AthenaPickaxe"); 53 | _profile.items.sandbox_loadout.AddPickaxe(ret.templateId); 54 | break; 55 | case "eid": 56 | ret = new ProfileCosmetic(id, "AthenaDance"); 57 | _profile.items.sandbox_loadout.AddDance(ret.templateId); 58 | break; 59 | case "glider": 60 | ret = new ProfileCosmetic(id, "AthenaGlider"); 61 | _profile.items.sandbox_loadout.AddGlider(ret.templateId); 62 | break; 63 | case "wrap": 64 | ret = new ProfileCosmetic(id, "AthenaItemWrap"); 65 | _profile.items.sandbox_loadout.AddItemWrap(ret.templateId); 66 | break; 67 | case "musicpack": 68 | ret = new ProfileCosmetic(id, "AthenaMusicPack"); 69 | _profile.items.sandbox_loadout.AddMusicPack(ret.templateId); 70 | break; 71 | case "loadingscreen": 72 | case "lsid": 73 | ret = new ProfileCosmetic(id, "AthenaLoadingScreen"); 74 | _profile.items.sandbox_loadout.AddLoadingScreen(ret.templateId); 75 | break; 76 | case "umbrella": 77 | ret = new ProfileCosmetic(id, "AthenaGlider"); 78 | _profile.items.sandbox_loadout.AddGlider(ret.templateId); 79 | break; 80 | case "contrail": 81 | case "trails": 82 | ret = new ProfileCosmetic(id, "AthenaSkyDiveContrail"); 83 | _profile.items.sandbox_loadout.AddContrail(ret.templateId); 84 | break; 85 | case "petcarrier": 86 | ret = new ProfileCosmetic(id, "AthenaBackpack"); 87 | _profile.items.sandbox_loadout.AddBackpack(ret.templateId); 88 | break; 89 | case "spray": 90 | case "spid": 91 | case "toy": 92 | case "emoji": 93 | ret = new ProfileCosmetic(id, "AthenaDance"); 94 | _profile.items.sandbox_loadout.AddDance(ret.templateId); 95 | break; 96 | default: 97 | ret = new ProfileCosmetic(id, "AthenaCharacter"); 98 | break; 99 | }; 100 | 101 | _cosmetics.Add(ret); 102 | 103 | return ret; 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /Solitude/Objects/Profile/ProfileCosmetic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solitude.Objects.Profile; 4 | 5 | public class ProfileCosmetic 6 | { 7 | public ProfileCosmetic(string cosmeticId, string backendType, bool isFavorite = false, bool isArchived = false) 8 | { 9 | templateId = $"{backendType}:{cosmeticId}"; 10 | attributes.favorite = isFavorite; 11 | attributes.archived = isArchived; 12 | } 13 | 14 | public string templateId { get; set; } 15 | public Attributes attributes { get; set; } = new(); 16 | public int quantity { get; set; } = 1; 17 | } 18 | 19 | public class Attributes 20 | { 21 | public DateTime creation_time { get; set; } = DateTime.Now; 22 | public int max_level_bonus { get; set; } = 0; 23 | public int level { get; set; } = 1; 24 | public bool item_seen { get; set; } = true; 25 | public int rnd_sel_cnt { get; set; } = 0; 26 | public int xp { get; set; } = 0; 27 | public ProfileAthena.Variant[] variants { get; set; } = { }; 28 | public bool favorite { get; set; } = false; 29 | public bool archived { get; set; } = false; 30 | } 31 | -------------------------------------------------------------------------------- /Solitude/Program.cs: -------------------------------------------------------------------------------- 1 | global using Serilog; 2 | 3 | using Solitude.Managers; 4 | using Solitude.Objects; 5 | using Spectre.Console; 6 | 7 | var dataminer = Core.Init().GetAwaiter().GetResult(); 8 | 9 | if (dataminer is null) 10 | return; 11 | 12 | var choice = AnsiConsole.Prompt( 13 | new SelectionPrompt() 14 | .Title("Choose the [45]Solitude[/] mode") 15 | .PageSize(10) 16 | .HighlightStyle("45") 17 | .MoreChoicesText("[grey](Move up and down to see more options)[/]") 18 | .AddChoices(new[] 19 | { 20 | "Get New", 21 | "Update Mode" 22 | })); 23 | 24 | ESolitudeMode mode; 25 | 26 | switch (choice) 27 | { 28 | case "Update Mode": 29 | mode = ESolitudeMode.UpdateMode; 30 | break; 31 | 32 | default: 33 | mode = ESolitudeMode.GetNew; 34 | break; 35 | } 36 | 37 | await Core.RunAsync(mode, dataminer); 38 | 39 | Log.Information("Done! Press any key to close."); 40 | 41 | Console.ReadKey(); -------------------------------------------------------------------------------- /Solitude/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Solitude.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Solitude.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Byte[]. 65 | /// 66 | internal static byte[] BurbankBigRegular_Bold { 67 | get { 68 | object obj = ResourceManager.GetObject("BurbankBigRegular_Bold", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Byte[]. 75 | /// 76 | internal static byte[] BurbankFont { 77 | get { 78 | object obj = ResourceManager.GetObject("BurbankFont", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Byte[]. 85 | /// 86 | internal static byte[] ColumbusSeries { 87 | get { 88 | object obj = ResourceManager.GetObject("ColumbusSeries", resourceCulture); 89 | return ((byte[])(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Byte[]. 95 | /// 96 | internal static byte[] Common { 97 | get { 98 | object obj = ResourceManager.GetObject("Common", resourceCulture); 99 | return ((byte[])(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Byte[]. 105 | /// 106 | internal static byte[] CreatorCollabSeries { 107 | get { 108 | object obj = ResourceManager.GetObject("CreatorCollabSeries", resourceCulture); 109 | return ((byte[])(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Byte[]. 115 | /// 116 | internal static byte[] CUBESeries { 117 | get { 118 | object obj = ResourceManager.GetObject("CUBESeries", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Byte[]. 125 | /// 126 | internal static byte[] DCUSeries { 127 | get { 128 | object obj = ResourceManager.GetObject("DCUSeries", resourceCulture); 129 | return ((byte[])(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Byte[]. 135 | /// 136 | internal static byte[] Epic { 137 | get { 138 | object obj = ResourceManager.GetObject("Epic", resourceCulture); 139 | return ((byte[])(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Byte[]. 145 | /// 146 | internal static byte[] FortniteIconBase { 147 | get { 148 | object obj = ResourceManager.GetObject("FortniteIconBase", resourceCulture); 149 | return ((byte[])(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized resource of type System.Byte[]. 155 | /// 156 | internal static byte[] FrozenSeries { 157 | get { 158 | object obj = ResourceManager.GetObject("FrozenSeries", resourceCulture); 159 | return ((byte[])(obj)); 160 | } 161 | } 162 | 163 | /// 164 | /// Looks up a localized resource of type System.Byte[]. 165 | /// 166 | internal static byte[] LavaSeries { 167 | get { 168 | object obj = ResourceManager.GetObject("LavaSeries", resourceCulture); 169 | return ((byte[])(obj)); 170 | } 171 | } 172 | 173 | /// 174 | /// Looks up a localized resource of type System.Byte[]. 175 | /// 176 | internal static byte[] Legendary { 177 | get { 178 | object obj = ResourceManager.GetObject("Legendary", resourceCulture); 179 | return ((byte[])(obj)); 180 | } 181 | } 182 | 183 | /// 184 | /// Looks up a localized resource of type System.Byte[]. 185 | /// 186 | internal static byte[] MarvelSeries { 187 | get { 188 | object obj = ResourceManager.GetObject("MarvelSeries", resourceCulture); 189 | return ((byte[])(obj)); 190 | } 191 | } 192 | 193 | /// 194 | /// Looks up a localized resource of type System.Byte[]. 195 | /// 196 | internal static byte[] Mythic { 197 | get { 198 | object obj = ResourceManager.GetObject("Mythic", resourceCulture); 199 | return ((byte[])(obj)); 200 | } 201 | } 202 | 203 | /// 204 | /// Looks up a localized resource of type System.Byte[]. 205 | /// 206 | internal static byte[] PlatformSeries { 207 | get { 208 | object obj = ResourceManager.GetObject("PlatformSeries", resourceCulture); 209 | return ((byte[])(obj)); 210 | } 211 | } 212 | 213 | /// 214 | /// Looks up a localized resource of type System.Byte[]. 215 | /// 216 | internal static byte[] Rare { 217 | get { 218 | object obj = ResourceManager.GetObject("Rare", resourceCulture); 219 | return ((byte[])(obj)); 220 | } 221 | } 222 | 223 | /// 224 | /// Looks up a localized resource of type System.Byte[]. 225 | /// 226 | internal static byte[] ShadowSeries { 227 | get { 228 | object obj = ResourceManager.GetObject("ShadowSeries", resourceCulture); 229 | return ((byte[])(obj)); 230 | } 231 | } 232 | 233 | /// 234 | /// Looks up a localized resource of type System.Byte[]. 235 | /// 236 | internal static byte[] SlurpSeries { 237 | get { 238 | object obj = ResourceManager.GetObject("SlurpSeries", resourceCulture); 239 | return ((byte[])(obj)); 240 | } 241 | } 242 | 243 | /// 244 | /// Looks up a localized resource of type System.Byte[]. 245 | /// 246 | internal static byte[] Transcendent { 247 | get { 248 | object obj = ResourceManager.GetObject("Transcendent", resourceCulture); 249 | return ((byte[])(obj)); 250 | } 251 | } 252 | 253 | /// 254 | /// Looks up a localized resource of type System.Byte[]. 255 | /// 256 | internal static byte[] Unattainable { 257 | get { 258 | object obj = ResourceManager.GetObject("Unattainable", resourceCulture); 259 | return ((byte[])(obj)); 260 | } 261 | } 262 | 263 | /// 264 | /// Looks up a localized resource of type System.Byte[]. 265 | /// 266 | internal static byte[] Uncommon { 267 | get { 268 | object obj = ResourceManager.GetObject("Uncommon", resourceCulture); 269 | return ((byte[])(obj)); 270 | } 271 | } 272 | } 273 | } 274 | -------------------------------------------------------------------------------- /Solitude/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\BurbankBigRegular-Bold.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\Resources\BurbankBigRegular-Bold.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\Resources\ColumbusSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 129 | 130 | 131 | ..\Resources\Common.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\Resources\CreatorCollabSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\Resources\CUBESeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | 140 | ..\Resources\DCUSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\Resources\Epic.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 144 | 145 | 146 | ..\Resources\FortniteIconBase.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 147 | 148 | 149 | ..\Resources\FrozenSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 150 | 151 | 152 | ..\Resources\LavaSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 153 | 154 | 155 | ..\Resources\Legendary.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 156 | 157 | 158 | ..\Resources\MarvelSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 159 | 160 | 161 | ..\Resources\Mythic.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 162 | 163 | 164 | ..\Resources\PlatformSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 165 | 166 | 167 | ..\Resources\Rare.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 168 | 169 | 170 | ..\Resources\ShadowSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 171 | 172 | 173 | ..\Resources\SlurpSeries.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 174 | 175 | 176 | ..\Resources\Transcendent.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 177 | 178 | 179 | ..\Resources\Unattainable.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 180 | 181 | 182 | ..\Resources\Uncommon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 183 | 184 | -------------------------------------------------------------------------------- /Solitude/Resources/BurbankBigRegular-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/BurbankBigRegular-Bold.otf -------------------------------------------------------------------------------- /Solitude/Resources/CUBESeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/CUBESeries.png -------------------------------------------------------------------------------- /Solitude/Resources/ColumbusSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/ColumbusSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Common.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Common.png -------------------------------------------------------------------------------- /Solitude/Resources/CreatorCollabSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/CreatorCollabSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/DCUSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/DCUSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Epic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Epic.png -------------------------------------------------------------------------------- /Solitude/Resources/FortniteIconBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/FortniteIconBase.png -------------------------------------------------------------------------------- /Solitude/Resources/FrozenSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/FrozenSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/LavaSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/LavaSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Legendary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Legendary.png -------------------------------------------------------------------------------- /Solitude/Resources/MarvelSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/MarvelSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Mythic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Mythic.png -------------------------------------------------------------------------------- /Solitude/Resources/PlatformSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/PlatformSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Rare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Rare.png -------------------------------------------------------------------------------- /Solitude/Resources/ShadowSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/ShadowSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/SlurpSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/SlurpSeries.png -------------------------------------------------------------------------------- /Solitude/Resources/Transcendent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Transcendent.png -------------------------------------------------------------------------------- /Solitude/Resources/Unattainable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Unattainable.png -------------------------------------------------------------------------------- /Solitude/Resources/Uncommon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNaeem/Solitude/18aa505275c08cbef50ebd18c1e2b6abc34fc273/Solitude/Resources/Uncommon.png -------------------------------------------------------------------------------- /Solitude/Solitude.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | True 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | True 33 | True 34 | Resources.resx 35 | 36 | 37 | 38 | 39 | 40 | ResXFileCodeGenerator 41 | Resources.Designer.cs 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | --------------------------------------------------------------------------------