diff --git a/Il2CppInspector.Common/Reflection/Constants.cs b/Il2CppInspector.Common/Reflection/Constants.cs index a8a701a..d921ab4 100644 --- a/Il2CppInspector.Common/Reflection/Constants.cs +++ b/Il2CppInspector.Common/Reflection/Constants.cs @@ -36,5 +36,18 @@ namespace Il2CppInspector.Reflection "using", /* "using static", */ "virtual", "void", "volatile", "while" }; + + // Default namespaces to exclude + public static readonly List DefaultExcludedNamespaces = new List { + "System", + "Mono", + "Microsoft.Win32", + "Unity", + "UnityEditor", + "UnityEngine", + "UnityEngineInternal", + "AOT", + "JetBrains.Annotations" + }; } } diff --git a/Il2CppTests/TestRunner.cs b/Il2CppTests/TestRunner.cs index 2a37b4f..d62c5aa 100644 --- a/Il2CppTests/TestRunner.cs +++ b/Il2CppTests/TestRunner.cs @@ -41,25 +41,11 @@ namespace Il2CppInspector if (inspectors.Count == 0) throw new Exception("Could not find any images in the IL2CPP binary"); - // Exclusions - - var excludedNamespaces = new List { - "System", - "Mono", - "Microsoft.Win32", - "Unity", - "UnityEditor", - "UnityEngine", - "UnityEngineInternal", - "AOT", - "JetBrains.Annotations" - }; - // Dump each image in the binary separately int i = 0; foreach (var il2cpp in inspectors) new CSharpCodeStubs(new Il2CppModel(il2cpp)) { - ExcludedNamespaces = excludedNamespaces, + ExcludedNamespaces = Constants.DefaultExcludedNamespaces, SuppressMetadata = false, MustCompile = true }.WriteSingleFile(testPath + @"\test-result" + (i++ > 0 ? "-" + (i - 1) : "") + ".cs");