private static HashSet <string> GenerateNativeClassList(RuntimeClassRegistry rcr, string directory, string[] rootAssemblies, StrippingInfo strippingInfo)
        {
            HashSet <string> hashSet = CodeStrippingUtils.CollectNativeClassListFromRoots(directory, rootAssemblies, strippingInfo);

            string[] nativeClassBlackList = CodeStrippingUtils.NativeClassBlackList;
            for (int i = 0; i < nativeClassBlackList.Length; i++)
            {
                string text = nativeClassBlackList[i];
                hashSet.Add(text);
                if (strippingInfo != null)
                {
                    strippingInfo.RegisterDependency(text, "Blacklisted");
                }
            }
            foreach (string current in CodeStrippingUtils.NativeClassDependencyBlackList.Keys)
            {
                if (hashSet.Contains(current))
                {
                    string text2 = CodeStrippingUtils.NativeClassDependencyBlackList[current];
                    hashSet.Add(text2);
                    if (strippingInfo != null)
                    {
                        strippingInfo.RegisterDependency(text2, string.Format("Blacklisted due to dependent class '{0}'", current));
                    }
                }
            }
            foreach (string current2 in rcr.GetAllNativeClassesIncludingManagersAsString())
            {
                int num = BaseObjectTools.StringToClassID(current2);
                if (num != -1 && !BaseObjectTools.IsBaseObject(num))
                {
                    hashSet.Add(current2);
                    if (strippingInfo != null && !BaseObjectTools.IsDerivedFromClassID(num, CodeStrippingUtils.gameManagerClassId))
                    {
                        strippingInfo.RegisterDependency(current2, "Used in Scenes");
                    }
                }
            }
            HashSet <string> hashSet2 = new HashSet <string>();

            foreach (string current3 in hashSet)
            {
                int iD = BaseObjectTools.StringToClassID(current3);
                while (!BaseObjectTools.IsBaseObject(iD))
                {
                    hashSet2.Add(BaseObjectTools.ClassIDToString(iD));
                    int superClassID = BaseObjectTools.GetSuperClassID(iD);
                    if (strippingInfo != null)
                    {
                        strippingInfo.RegisterDependency(BaseObjectTools.ClassIDToString(superClassID), BaseObjectTools.ClassIDToString(iD));
                    }
                    iD = BaseObjectTools.GetSuperClassID(iD);
                }
            }
            return(hashSet2);
        }
Exemple #2
0
        private static HashSet <string> GenerateNativeClassList(RuntimeClassRegistry rcr, string directory, string[] rootAssemblies)
        {
            HashSet <string> hashSet = CodeStrippingUtils.CollectNativeClassListFromRoots(directory, rootAssemblies);

            string[] nativeClassBlackList = CodeStrippingUtils.NativeClassBlackList;
            for (int i = 0; i < nativeClassBlackList.Length; i++)
            {
                string item = nativeClassBlackList[i];
                hashSet.Add(item);
            }
            foreach (string current in CodeStrippingUtils.NativeClassDependencyBlackList.Keys)
            {
                if (hashSet.Contains(current))
                {
                    string item2 = CodeStrippingUtils.NativeClassDependencyBlackList[current];
                    hashSet.Add(item2);
                }
            }
            foreach (string current2 in rcr.GetAllNativeClassesIncludingManagersAsString())
            {
                int num = BaseObjectTools.StringToClassID(current2);
                if (num != -1 && !BaseObjectTools.IsBaseObject(num))
                {
                    hashSet.Add(current2);
                }
            }
            HashSet <string> hashSet2 = new HashSet <string>();

            foreach (string current3 in hashSet)
            {
                int iD = BaseObjectTools.StringToClassID(current3);
                while (!BaseObjectTools.IsBaseObject(iD))
                {
                    hashSet2.Add(BaseObjectTools.ClassIDToString(iD));
                    iD = BaseObjectTools.GetSuperClassID(iD);
                }
            }
            return(hashSet2);
        }
Exemple #3
0
        private static HashSet <string> GenerateNativeClassList(RuntimeClassRegistry rcr, string directory, string[] rootAssemblies)
        {
            HashSet <string> stringSet1 = CodeStrippingUtils.CollectNativeClassListFromRoots(directory, rootAssemblies);

            foreach (string nativeClassBlack in CodeStrippingUtils.NativeClassBlackList)
            {
                stringSet1.Add(nativeClassBlack);
            }
            using (Dictionary <string, string> .KeyCollection.Enumerator enumerator = CodeStrippingUtils.NativeClassDependencyBlackList.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    if (stringSet1.Contains(current))
                    {
                        string classDependencyBlack = CodeStrippingUtils.NativeClassDependencyBlackList[current];
                        stringSet1.Add(classDependencyBlack);
                    }
                }
            }
            using (List <string> .Enumerator enumerator = rcr.GetAllNativeClassesIncludingManagersAsString().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    int    classId = BaseObjectTools.StringToClassID(current);
                    if (classId != -1 && !BaseObjectTools.IsBaseObject(classId))
                    {
                        stringSet1.Add(current);
                    }
                }
            }
            HashSet <string> stringSet2 = new HashSet <string>();

            using (HashSet <string> .Enumerator enumerator = stringSet1.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    for (int ID = BaseObjectTools.StringToClassID(enumerator.Current); !BaseObjectTools.IsBaseObject(ID); ID = BaseObjectTools.GetSuperClassID(ID))
                    {
                        stringSet2.Add(BaseObjectTools.ClassIDToString(ID));
                    }
                }
            }
            return(stringSet2);
        }
        private static HashSet <string> GenerateNativeClassList(RuntimeClassRegistry rcr, string directory, string[] rootAssemblies)
        {
            HashSet <string> set = CollectNativeClassListFromRoots(directory, rootAssemblies);

            foreach (string str in NativeClassBlackList)
            {
                set.Add(str);
            }
            foreach (string str2 in rcr.GetAllNativeClassesIncludingManagersAsString())
            {
                int iD = BaseObjectTools.StringToClassID(str2);
                if ((iD != -1) && !BaseObjectTools.IsBaseObject(iD))
                {
                    set.Add(str2);
                }
            }
            HashSet <string> set2 = new HashSet <string>();

            foreach (string str3 in set)
            {
                for (int i = BaseObjectTools.StringToClassID(str3); !BaseObjectTools.IsBaseObject(i); i = BaseObjectTools.GetSuperClassID(i))
                {
                    set2.Add(BaseObjectTools.ClassIDToString(i));
                }
            }
            return(set2);
        }