internal static string PostprocessStacktrace(string oldString, bool stripEngineInternalInformation) { string result; if (oldString == null) { result = string.Empty; } else { string[] array = oldString.Split(new char[] { '\n' }); StringBuilder stringBuilder = new StringBuilder(oldString.Length); for (int i = 0; i < array.Length; i++) { array[i] = array[i].Trim(); } for (int j = 0; j < array.Length; j++) { string text = array[j]; if (text.Length != 0 && text[0] != '\n') { if (!text.StartsWith("in (unmanaged)")) { if (stripEngineInternalInformation && text.StartsWith("UnityEditor.EditorGUIUtility:RenderGameViewCameras")) { break; } if (stripEngineInternalInformation && j < array.Length - 1 && StackTraceUtility.IsSystemStacktraceType(text)) { if (StackTraceUtility.IsSystemStacktraceType(array[j + 1])) { goto IL_297; } int num = text.IndexOf(" (at"); if (num != -1) { text = text.Substring(0, num); } } if (text.IndexOf("(wrapper managed-to-native)") == -1) { if (text.IndexOf("(wrapper delegate-invoke)") == -1) { if (text.IndexOf("at <0x00000> <unknown method>") == -1) { if (!stripEngineInternalInformation || !text.StartsWith("[") || !text.EndsWith("]")) { if (text.StartsWith("at ")) { text = text.Remove(0, 3); } int num2 = text.IndexOf("[0x"); int num3 = -1; if (num2 != -1) { num3 = text.IndexOf("]", num2); } if (num2 != -1 && num3 > num2) { text = text.Remove(num2, num3 - num2 + 1); } text = text.Replace(" in <filename unknown>:0", ""); text = text.Replace("\\", "/"); if (!string.IsNullOrEmpty(StackTraceUtility.projectFolder)) { text = text.Replace(StackTraceUtility.projectFolder, ""); } text = text.Replace('\\', '/'); int num4 = text.LastIndexOf(" in "); if (num4 != -1) { text = text.Remove(num4, 5); text = text.Insert(num4, " (at "); text = text.Insert(text.Length, ")"); } stringBuilder.Append(text + "\n"); } } } } } } IL_297 :; } result = stringBuilder.ToString(); } return(result); }
internal static string PostprocessStacktrace(string oldString, bool stripEngineInternalInformation) { if (oldString == null) { return(string.Empty); } string[] strArray = oldString.Split('\n'); StringBuilder stringBuilder = new StringBuilder(oldString.Length); for (int index = 0; index < strArray.Length; ++index) { strArray[index] = strArray[index].Trim(); } for (int index = 0; index < strArray.Length; ++index) { string str1 = strArray[index]; if (str1.Length != 0 && (int)str1[0] != 10 && !str1.StartsWith("in (unmanaged)")) { if (!stripEngineInternalInformation || !str1.StartsWith("UnityEditor.EditorGUIUtility:RenderGameViewCameras")) { if (stripEngineInternalInformation && index < strArray.Length - 1 && StackTraceUtility.IsSystemStacktraceType((object)str1)) { if (!StackTraceUtility.IsSystemStacktraceType((object)strArray[index + 1])) { int length = str1.IndexOf(" (at"); if (length != -1) { str1 = str1.Substring(0, length); } } else { continue; } } if (str1.IndexOf("(wrapper managed-to-native)") == -1 && str1.IndexOf("(wrapper delegate-invoke)") == -1 && str1.IndexOf("at <0x00000> <unknown method>") == -1 && (!stripEngineInternalInformation || !str1.StartsWith("[") || !str1.EndsWith("]"))) { if (str1.StartsWith("at ")) { str1 = str1.Remove(0, 3); } int startIndex1 = str1.IndexOf("[0x"); int num = -1; if (startIndex1 != -1) { num = str1.IndexOf("]", startIndex1); } if (startIndex1 != -1 && num > startIndex1) { str1 = str1.Remove(startIndex1, num - startIndex1 + 1); } string str2 = str1.Replace(" in <filename unknown>:0", string.Empty).Replace(StackTraceUtility.projectFolder, string.Empty).Replace('\\', '/'); int startIndex2 = str2.LastIndexOf(" in "); if (startIndex2 != -1) { string str3 = str2.Remove(startIndex2, 5).Insert(startIndex2, " (at "); str2 = str3.Insert(str3.Length, ")"); } stringBuilder.Append(str2 + "\n"); } } else { break; } } } return(stringBuilder.ToString()); }