From 233df8ca235560a21cb483cb12d84c0dbf64d2e4 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Mon, 2 Aug 2021 11:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90AB=E5=8C=85=E3=80=91=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A7=A3=E5=AF=86=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetBundle/Core/AssetBundleBuilder.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs b/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs index 5d7fd17f22..fdf7e93de0 100644 --- a/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs +++ b/Assets/Scripts/Editor/GameEditor/AssetBundle/Core/AssetBundleBuilder.cs @@ -138,6 +138,30 @@ namespace GameEditor.AssetBundle time.Stop(); Debug.Log(" 耗时:" + time.ElapsedMilliseconds); } + + + + [MenuItem("AssetBundle/解密AB")] + public static void JieMi() + { + string filePath = EditorUtility.OpenFilePanel("Resource path", string.Empty, "unity3d"); + + byte[] oldData = File.ReadAllBytes(filePath); + int len = (int)GameLogic.AppConst.EncyptBytesLength; + int newOldLen = oldData.Length - len;//定死了,128个空byte + var newData = new byte[newOldLen]; + for (int tb = len; tb < oldData.Length; tb++) + { + newData[tb - len] = oldData[tb]; + } + FileStream fs = File.OpenWrite(filePath + "jm");//打开写入进去 + fs.Write(newData, 0, newOldLen); + fs.Close(); + + Debug.Log("解密完成!"); + } + + /// /// 开始打包 ///