【AB包】添加解密工具
parent
7f46481dbf
commit
233df8ca23
|
|
@ -138,6 +138,30 @@ namespace GameEditor.AssetBundle
|
||||||
time.Stop();
|
time.Stop();
|
||||||
Debug.Log(" 耗时:" + time.ElapsedMilliseconds);
|
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("解密完成!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始打包
|
/// 开始打包
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue