obfuz/Samples/CustomConfigure/Assets/Bootstrap.cs

33 lines
905 B
C#
Raw Normal View History

2025-05-20 16:48:06 +08:00
using Obfuz;
using Obfuz.EncryptionVM;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bootstrap : MonoBehaviour
{
// <20><>ʼ<EFBFBD><CABC>EncryptionService<63>󱻻<EFBFBD><F3B1BBBB><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>
// <20><><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>س<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
[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");
}
int Add(int a, int b)
{
return a + b + 1;
}
// Start is called before the first frame update
void Start()
{
Debug.Log("Hello, Obfuz");
int a = Add(10, 20);
Debug.Log($"a = {a}");
}
}