obfuz/Samples/DynamicSecretKey/Assets/Bootstrap.cs

33 lines
1.1 KiB
C#
Raw Permalink Normal View History

using Obfuz;
using Obfuz.EncryptionVM;
using UnityEngine;
public class Bootstrap : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void SetUpStaticSecretKey()
{
Debug.Log("SetUpStaticSecret begin");
EncryptionService<DefaultStaticEncryptionScope>.Encryptor = new GeneratedEncryptionVirtualMachine(Resources.Load<TextAsset>("Obfuz/defaultStaticSecretKey").bytes);
Debug.Log("SetUpStaticSecret end");
}
private static void SetUpDynamicSecret()
{
Debug.Log("SetUpDynamicSecret begin");
EncryptionService<DefaultDynamicEncryptionScope>.Encryptor = new GeneratedEncryptionVirtualMachine(Resources.Load<TextAsset>("Obfuz/defaultDynamicSecretKey").bytes);
Debug.Log("SetUpDynamicSecret end");
}
void Start()
{
// <20>ӳټ<D3B3><D9BC>أ<EFBFBD><D8A3><EFBFBD>ʹ<EFBFBD><CAB9>HotUpdate<74><65><EFBFBD>򼯴<EFBFBD><F2BCAFB4><EFBFBD>ǰ<EFBFBD>ż<EFBFBD><C5BC>ض<EFBFBD>̬<EFBFBD><CCAC>Կ<EFBFBD><D4BF>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ȸ<EFBFBD><C8B8>£<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>ȸ<EFBFBD><C8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ󣬼<C9BA><F3A3ACBC><EFBFBD>
// <20>ȸ<EFBFBD><C8B8>´<EFBFBD><C2B4><EFBFBD>ǰ<EFBFBD>ż<EFBFBD><C5BC>ض<EFBFBD>̬<EFBFBD><CCAC>Կ<EFBFBD><D4BF>
SetUpDynamicSecret();
this.gameObject.AddComponent<Entry>();
}
}