Skip to content

Commit

Permalink
修改 DisableEncryption添加配置检查
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Oct 18, 2024
1 parent 8425bd0 commit c309880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SinmaiAssist {
public static partial class BuildInfo {
public const string CommitHash = "0d6fc6a";
public const string BuildDate = "2024-10-18T12:05:17.5213371+08:00";
public const string CommitHash = "8425bd0";
public const string BuildDate = "2024-10-18T15:40:17.6707799+08:00";
}
}
5 changes: 3 additions & 2 deletions Fix/DisableEncryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static bool PreObfuscator(string srcStr, ref string __result)
__result = srcStr.Replace("MaimaiExp", "").Replace("MaimaiChn", "");
return false;
}

[HarmonyPatch]
public class EncryptDecrypt
{
Expand All @@ -28,9 +28,10 @@ public static IEnumerable<MethodBase> TargetMethods()
methods.FirstOrDefault(it => it.Name == "Decrypt" && it.IsPublic)
];
}

public static bool Prefix(object[] __args, ref object __result)
{
if (!SinmaiAssist.config.Fix.DisableEncryption) return true;
if (__args.Length == 1)
{
// public static byte[] Encrypt(byte[] data)
Expand Down

0 comments on commit c309880

Please sign in to comment.