示例#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);
        }
示例#2
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);
        }
示例#3
0
        // Token: 0x06000016 RID: 22 RVA: 0x00002680 File Offset: 0x00000880
        private unsafe static object ParseObject(void *obj, string keyname)
        {
            CFDictParser.CFType cFType  = CFDictParser.CFGetTypeID(obj);
            CFDictParser.CFType cFType2 = cFType;
            object result;

            if (cFType2 != CFDictParser.CFType.CFString)
            {
                switch (cFType2)
                {
                case CFDictParser.CFType.CFDictionary:
                    result = CFDictParser.Parse(obj);
                    return(result);

                case CFDictParser.CFType.CFArray:
                case CFDictParser.CFType.CFBundleIconFiles:
                    result = CFDictParser.GetArrayFromObject(obj);
                    return(result);

                case CFDictParser.CFType.CFBoolean:
                    result = CFDictParser.CFBooleanGetValue(obj);
                    return(result);

                case CFDictParser.CFType.CFNumber:
                    result = CFDictParser.GetNumberFromObject(obj);
                    return(result);

                case CFDictParser.CFType.CFData:
                    result = CFDictParser.GetDataFromObject(obj);
                    return(result);
                }
                result = CFDictParser.GetDataFromObject(obj);
            }
            else
            {
                result = CFDictParser.GetStringFromObject(obj);
            }
            return(result);
        }