NLDClient-yudde/ProjectNLD/Assets/_Test/Editor/TestCode.cs

42 lines
1.3 KiB
C#

using System.IO;
using System.Text;
using Gameplay.UI.Common;
using PhxhSDK.AOT.Encrypt;
using PhxhSDK.AOT.PreConfig;
using UnityEditor;
using UnityEngine;
public class TestCode: Editor
{
[MenuItem("Test/测试")]
public static void Test()
{
var pathParent = "C:/Users/82158/Documents/WXWork/1688856871498430/Cache/File/2025-05";
var srcName = "defaultpackage_assets_hotupdatedlls_hotupdatedll.bundle";
var encryptName = "defaultpackage_assets_hotupdatedlls_hotupdatedll_84beb51e01c770e481e0fb9bb8045c0f.bundle";
var loadSrcBytes = File.ReadAllBytes(pathParent + "/" + srcName);
var loadEncBytes = File.ReadAllBytes(pathParent + "/" + encryptName);
var decryptEndBytes = new byte[loadEncBytes.Length];
for (int i = 0; i < decryptEndBytes.Length; i++)
{
var loadByte = loadEncBytes[i];
decryptEndBytes[i] = LTSimpleEncrypt.Change(loadByte, i);
}
var isSame = true;
for (int i = 0; i < loadSrcBytes.Length; i++)
{
var loadSrcByte = loadSrcBytes[i];
var decryptByte = decryptEndBytes[i];
if (loadSrcByte != decryptByte)
{
isSame = false;
break;
}
}
Debug.LogError("测试结果:" + isSame);
}
}