接入obfuz->2.0

This commit is contained in:
Alex-Rachel
2025-07-26 08:10:41 +08:00
parent f2c7ff4336
commit cb86d8868e
713 changed files with 57092 additions and 10 deletions

View File

@@ -0,0 +1,24 @@
using Obfuz;
using Obfuz.EncryptionVM;
using UnityEngine;
namespace Launcher
{
public class ObfuzInitialize : MonoBehaviour
{
// 初始化EncryptionService后被混淆的代码才能正常运行
// 因此尽可能地早地初始化它。
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void SetUpStaticSecretKey()
{
#if ENABLE_OBFUZ
Debug.Log("Enable Obfuz");
Debug.Log("SetUpStaticSecret begin");
EncryptionService<DefaultStaticEncryptionScope>.Encryptor = new GeneratedEncryptionVirtualMachine(Resources.Load<TextAsset>("Obfuz/defaultStaticSecretKey").bytes);
Debug.Log("SetUpStaticSecret end");
#else
Debug.Log("Disable Obfuz");
#endif
}
}
}