diff --git a/FModel/ViewModels/ApiEndpoints/DynamicApiEndpoint.cs b/FModel/ViewModels/ApiEndpoints/DynamicApiEndpoint.cs
index 490d4df2..7ef2b3d2 100644
--- a/FModel/ViewModels/ApiEndpoints/DynamicApiEndpoint.cs
+++ b/FModel/ViewModels/ApiEndpoints/DynamicApiEndpoint.cs
@@ -1,6 +1,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using FModel.Extensions;
using FModel.Framework;
using FModel.ViewModels.ApiEndpoints.Models;
using Newtonsoft.Json.Linq;
@@ -34,7 +35,11 @@ public class DynamicApiEndpoint : AbstractApiProvider
if (dynamicKey["guid"] is not { } guid || dynamicKey["key"] is not { } key)
continue;
- ret.DynamicKeys.Add(new DynamicKey{Guid = guid.ToString(), Key = Helper.FixKey(key.ToString())});
+ ret.DynamicKeys.Add(new DynamicKey
+ {
+ Name = dynamicKey["name"]?.ToString(),
+ Guid = guid.ToString(), Key = Helper.FixKey(key.ToString())
+ });
}
}
return ret;
@@ -58,7 +63,9 @@ public class DynamicApiEndpoint : AbstractApiProvider
var tokens = body.SelectTokens(path);
var ret = new MappingsResponse[] {new()};
ret[0].Url = tokens.ElementAtOrDefault(0).ToString();
- ret[0].FileName = tokens.ElementAtOrDefault(1).ToString();
+ if (tokens.ElementAtOrDefault(1) is not { } fileName)
+ fileName = ret[0].Url.SubstringAfterLast("/");
+ ret[0].FileName = fileName.ToString();
return ret;
}
diff --git a/FModel/ViewModels/ApiEndpoints/Models/MappingsResponse.cs b/FModel/ViewModels/ApiEndpoints/Models/MappingsResponse.cs
index 8ffc6c5b..4f9ee734 100644
--- a/FModel/ViewModels/ApiEndpoints/Models/MappingsResponse.cs
+++ b/FModel/ViewModels/ApiEndpoints/Models/MappingsResponse.cs
@@ -12,13 +12,12 @@ public class MappingsResponse
[I][J] public string Hash { get; private set; }
[I][J] public long Length { get; private set; }
[I][J] public string Uploaded { get; private set; }
- [J] public Meta Meta { get; set; }
+ [I][J] public Meta Meta { get; set; }
public MappingsResponse()
{
Url = string.Empty;
FileName = string.Empty;
- Meta = new Meta();
}
[I] public bool IsValid => !string.IsNullOrEmpty(Url) &&
diff --git a/FModel/Views/AesManager.xaml b/FModel/Views/AesManager.xaml
index 442fd17c..f9a7e95f 100644
--- a/FModel/Views/AesManager.xaml
+++ b/FModel/Views/AesManager.xaml
@@ -29,7 +29,7 @@
-
+
diff --git a/FModel/Views/DirectorySelector.xaml b/FModel/Views/DirectorySelector.xaml
index 147c6641..c92476b3 100644
--- a/FModel/Views/DirectorySelector.xaml
+++ b/FModel/Views/DirectorySelector.xaml
@@ -28,7 +28,7 @@
-
+
diff --git a/FModel/Views/Resources/Controls/EndpointEditor.xaml b/FModel/Views/Resources/Controls/EndpointEditor.xaml
index 1dd2d004..15d89fa8 100644
--- a/FModel/Views/Resources/Controls/EndpointEditor.xaml
+++ b/FModel/Views/Resources/Controls/EndpointEditor.xaml
@@ -8,7 +8,7 @@
xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
WindowStartupLocation="CenterScreen" IconVisibility="Collapsed" ResizeMode="NoResize" Closing="OnClosing"
Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.50'}"
- Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.30'}">
+ Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.35'}">
@@ -57,12 +57,18 @@
+
-
+
+
+
+
+
+
@@ -77,7 +83,7 @@
Style="{DynamicResource {x:Static adonisUi:Styles.AccentButton}}" Click="OnTest"/>
-
diff --git a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs
index d552351c..b44556de 100644
--- a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs
+++ b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs
@@ -28,6 +28,27 @@ public partial class EndpointEditor
Title = title;
TargetResponse.SyntaxHighlighting =
EndpointResponse.SyntaxHighlighting = AvalonExtensions.HighlighterSelector("json");
+
+ InstructionBox.Text = type switch
+ {
+ EEndpointType.Aes =>
+@"In order to make this work, you first need to understand JSON and its query language. If you don't, please close this window. If your game never changes its AES keys or is not even encrypted, please close this window. If you do understand what you are doing, you have to know that the AES path supports up to 2 tokens.
+
+ The first token is mandatory and will be assigned to the main AES key. It has to be looking like a key, else your configuration will not be valid (the key validity against your files will not be checked). Said key must be hexadecimal and can start without ""0x"".
+
+ If your game uses several AES keys, you can specify a second token that will be your list of dynamic keys. The format needed is a list of objects with, at least, the next 2 variables:
+{
+ ""guid"": ""the archive guid"",
+ ""key"": ""the archive aes key""
+}",
+ EEndpointType.Mapping =>
+@"In order to make this work, you first need to understand JSON and its query language. If you don't, please close this window. If your game does not have unversioned package properties, please close this window. If you do understand what you are doing, you have to know that the Mapping path supports up to 2 tokens.
+
+ The first token is mandatory and will be assigned to the mapping download URL, which can be all kinds of mapping but not Brotli compressed.
+
+ The second token is optional and will be assigned to the mapping file name. If unspecified, said file name will be grabbed from the URL.",
+ _ => ""
+ };
}
private void OnClick(object sender, RoutedEventArgs e)