Exemplo n.º 1
0
        // Token: 0x06000010 RID: 16 RVA: 0x00002278 File Offset: 0x00000478
        public unsafe static Dictionary <string, object> ParseAppDictionaryData(void *root_dict)
        {
            int num = CFDictParser.CFDictionaryGetCount(root_dict);
            Dictionary <string, object> dictionary = new Dictionary <string, object>(num);

            void *[] array  = new void *[num];
            void *[] values = new void *[num];
            CFDictParser.CFDictionaryGetKeysAndValues(root_dict, array, values);
            for (int i = 0; i < num; i++)
            {
                CFDictParser.CFType cFType = CFDictParser.CFGetTypeID(array[i]);
                if (cFType != CFDictParser.CFType.CFString)
                {
                    throw new Exception("Key not string type");
                }
                string        stringFromObject = CFDictParser.GetStringFromObject(array[i]);
                List <string> list             = new List <string>();
                list.Add("CFBundleDisplayName");
                list.Add("CFBundleName");
                list.Add("CFBundleIconFiles");
                list.Add("UIPrerenderedIcon");
                list.Add("ApplicationType");
                list.Add("UIFileSharingEnabled");
                list.Add("SignerIdentity");
                void *   dict    = CFDictParser.CFDictionaryGetValue(root_dict, array[i]);
                int      num2    = CFDictParser.CFDictionaryGetCount(dict);
                void *[] array2  = new void *[num2];
                void *[] values2 = new void *[num2];
                CFDictParser.CFDictionaryGetKeysAndValues(dict, array2, values2);
                Dictionary <string, object> dictionary2 = new Dictionary <string, object>(num2);
                for (int j = 0; j < num2; j++)
                {
                    CFDictParser.CFType cFType2 = CFDictParser.CFGetTypeID(array2[j]);
                    if (cFType2 != CFDictParser.CFType.CFString)
                    {
                        throw new Exception("Key not string type");
                    }
                    string stringFromObject2 = CFDictParser.GetStringFromObject(array2[j]);
                    if (list.Contains(stringFromObject2))
                    {
                        dictionary2.Add(stringFromObject2, CFDictParser.ParseObject(CFDictParser.CFDictionaryGetValue(dict, array2[j]), stringFromObject2));
                    }
                }
                dictionary.Add(stringFromObject, dictionary2);
            }
            return(dictionary);
        }
Exemplo n.º 2
0
        // Token: 0x06000013 RID: 19 RVA: 0x000024D8 File Offset: 0x000006D8
        private unsafe static Array GetArrayFromObject(void *obj)
        {
            int num = CFDictParser.CFArrayGetCount(obj);

            object[] array  = new object[num];
            void *[] array2 = new void *[num];
            CFDictParser.__CFRange _CFRange = default(CFDictParser.__CFRange);
            _CFRange.length   = num;
            _CFRange.location = 0;
            for (int i = 0; i < num; i++)
            {
                array2[i] = CFDictParser.CFArrayGetValueAtIndex(obj, i);
            }
            for (int i = 0; i < num; i++)
            {
                array[i] = CFDictParser.ParseObject(array2[i], null);
            }
            return(array);
        }
Exemplo n.º 3
0
        // Token: 0x06000011 RID: 17 RVA: 0x000023FC File Offset: 0x000005FC
        public unsafe static Dictionary <string, object> Parse(void *root_dict)
        {
            int num = CFDictParser.CFDictionaryGetCount(root_dict);
            Dictionary <string, object> dictionary = new Dictionary <string, object>(num);

            void *[] array  = new void *[num];
            void *[] values = new void *[num];
            CFDictParser.CFDictionaryGetKeysAndValues(root_dict, array, values);
            for (int i = 0; i < num; i++)
            {
                CFDictParser.CFType cFType = CFDictParser.CFGetTypeID(array[i]);
                if (cFType != CFDictParser.CFType.CFString)
                {
                    throw new Exception("Key not string type");
                }
                string stringFromObject = CFDictParser.GetStringFromObject(array[i]);
                void * obj = CFDictParser.CFDictionaryGetValue(root_dict, array[i]);
                dictionary.Add(stringFromObject, CFDictParser.ParseObject(obj, stringFromObject));
            }
            return(dictionary);
        }