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("解密完成!"); + } + + /// /// 开始打包 ///