Skip to content

Commit

Permalink
refactor: rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
cengelha committed Aug 6, 2024
1 parent f480047 commit 2ca71ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libNOM.map/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,19 @@ private static void GetPropertiesToObfuscate(JToken token, List<JProperty> jProp
#region Mapping

private static Dictionary<string, string> GetMapForDeobfuscation(bool useAccount) => (useAccount ? _mapForCommonAccount.Concat(_mapForDeobfuscationAccount) : _mapForCommon.Concat(_mapForDeobfuscation)).ToDictionary(i => i.Key, i => i.Value);

private static Dictionary<string, string> GetMapForObfuscation(bool useAccount) => (useAccount ? _mapForCommonAccount.Concat(_mapForObfuscationAccount) : _mapForCommon.Concat(_mapForObfuscation)).ToDictionary(i => i.Value, i => i.Key); // switch to have the origin as Key

/// <inheritdoc cref="GetMappedOrInput(string, bool)"/>
public static string GetMappedOrInput(string key) => GetMappedOrInput(key, false);
/// <inheritdoc cref="GetMappedKeyOrInput(string, bool)"/>
public static string GetMappedKeyOrInput(string key) => GetMappedKeyOrInput(key, false);

/// <summary>
/// Maps the specified key. Works for both, deobfuscated and obfuscated input.
/// </summary>
/// <param name="key"></param>
/// <param name="useAccount"></param>
/// <returns>The mapped key or the input if no mapping found.</returns>
public static string GetMappedOrInput(string key, bool useAccount)
public static string GetMappedKeyOrInput(string key, bool useAccount)
{
if (GetMapForDeobfuscation(useAccount).TryGetValue(key, out var resultFromDeobfuscation))
return resultFromDeobfuscation;
Expand Down

0 comments on commit 2ca71ba

Please sign in to comment.