Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static byte[] getAssemblyHash()
- {
- #if UNITY_EDITOR
- string path_0 = new DirectoryInfo(Application.dataPath).Parent+"/Builds/Test/Unturned_Data/Managed/Assembly-CSharp.dll";
- string path_1 = new DirectoryInfo(Application.dataPath).Parent+"/Builds/Test/Unturned_Data/Managed/Other-Assembly-CSharp.dll";
- string path_2 = new DirectoryInfo(Application.dataPath).Parent+"/Builds/Test/Unturned_Data/Managed/Assembly-CSharp-firstpass.dll";
- string path_3 = new DirectoryInfo(Application.dataPath).Parent+"/Builds/Test/Unturned_Data/Managed/Other-Assembly-CSharp-firstpass.dll";
- #elif UNITY_STANDALONE_OSX
- string path_0 = PATH + "/Unturned.app/Contents/Data/Managed/Other-Assembly-CSharp.dll";
- string path_1 = PATH + "/Unturned.app/Contents/Data/Managed/Assembly-CSharp.dll";
- string path_2 = PATH + "/Unturned.app/Contents/Data/Managed/Other-Assembly-CSharp-firstpass.dll";
- string path_3 = PATH + "/Unturned.app/Contents/Data/Managed/Assembly-CSharp-firstpass.dll";
- #else
- string path_0 = PATH + "/Unturned_Data/Managed/Assembly-CSharp.dll";
- string path_1 = PATH + "/Unturned_Data/Managed/Other-Assembly-CSharp.dll";
- string path_2 = PATH + "/Unturned_Data/Managed/Assembly-CSharp-firstpass.dll";
- string path_3 = PATH + "/Unturned_Data/Managed/Other-Assembly-CSharp-firstpass.dll";
- #endif
- FileStream stream_0 = new FileStream(path_0, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] bytes_0 = new byte[stream_0.Length];
- stream_0.Close();
- stream_0.Dispose();
- #if DEV
- return Hash.SHA1(bytes_0);
- #else
- FileStream stream_1 = new FileStream(path_1, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] bytes_1 = new byte[stream_1.Length];
- stream_1.Close();
- stream_1.Dispose();
- FileStream stream_2 = new FileStream(path_2, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] bytes_2 = new byte[stream_2.Length];
- stream_2.Close();
- stream_2.Dispose();
- FileStream stream_3 = new FileStream(path_3, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] bytes_3 = new byte[stream_3.Length];
- stream_3.Close();
- stream_3.Dispose();
- return Hash.combine(Hash.SHA1(bytes_0), Hash.SHA1(bytes_1), Hash.SHA1(bytes_2), Hash.SHA1(bytes_3));
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement