Пример #1
0
    internal override bool DrawEntry(Egomotion.EgoXproject.Internal.PListDictionary dic)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(dic.StringValue(SETTING_KEY));
        EditorGUILayout.LabelField(dic.StringValue(NAME_KEY));
        var type = dic.StringValue(TYPE_KEY);

        if (type == BOOL_TYPE_VALUE)
        {
            var value = dic.BoolValue(VALUE_KEY);
            EditorGUILayout.LabelField(value ? "Yes" : "No");
        }
        else if (type == STRING_TYPE_VALUE)
        {
            var value = dic.StringValue(VALUE_KEY);
            EditorGUILayout.LabelField(value);
        }
        else if (type == INTEGER_TYPE_VALUE)
        {
            var value = dic.IntValue(VALUE_KEY);
            EditorGUILayout.LabelField(value.ToString());
        }
        else if (type == REAL_TYPE_VALUE)
        {
            var value = dic.FloatValue(VALUE_KEY);
            EditorGUILayout.LabelField(value.ToString());
        }
        else if (type == ARRAY_TYPE_VALUE)
        {
            //TODO should also be able to draw a defaul array entries
            EditorGUILayout.LabelField("Array");
        }
        else if (type == DICTIONARY_TYPE_VALUE)
        {
            //TODO should also be able to draw a defaul array entries
            EditorGUILayout.LabelField("Dictionary");
        }
        else
        {
            EditorGUILayout.LabelField("UNKNOWN");
        }

        bool remove = false;;

        if (GUILayout.Button("-"))
        {
            remove = true;
        }

        EditorGUILayout.EndHorizontal();

        return(remove);
    }
Пример #2
0
        public GameControllersCapability(PListDictionary dic)
        {
            var controllers = dic.ArrayValue(SUPPORTED_GAME_CONTROLLERS_KEY);

            if (controllers != null && controllers.Count > 0)
            {
                var gc = new List <GameControllerType>();

                for (int ii = 0; ii < controllers.Count; ii++)
                {
                    GameControllerType c;

                    if (controllers.EnumValue(ii, out c))
                    {
                        gc.Add(c);
                    }
                }

                GameControllers = gc.ToArray();
            }
        }
Пример #3
0
        PListDictionary ParseDictionary(IEnumerable <XElement> elements)
        {
            PListDictionary dict = new PListDictionary();

            if (elements != null)
            {
                for (int ii = 0; ii < elements.Count(); ii += 2)
                {
                    XElement key     = elements.ElementAt(ii);
                    XElement val     = elements.ElementAt(ii + 1);
                    var      element = ParseValue(val);

                    if (element != null)
                    {
                        dict[key.Value] = element;
                    }
                }
            }

            return(dict);
        }
Пример #4
0
        public UserManagementCapability(PListDictionary dic)
        {
            var controllers = dic.ArrayValue(USER_MANAGEMENT_KEY);

            if (controllers != null && controllers.Count > 0)
            {
                var gc = new List <UserManagementType>();

                for (int ii = 0; ii < controllers.Count; ii++)
                {
                    UserManagementType c;

                    if (controllers.EnumValue(ii, out c))
                    {
                        gc.Add(c);
                    }
                }

                UserManagement = gc.ToArray();
            }
        }
Пример #5
0
        void MergeArrays(PListArray original, PListArray toMerge, bool keepEmpty)
        {
            foreach (var element in toMerge)
            {
                if (element is PListDictionary)
                {
                    var originalDic = new PListDictionary();
                    MergeDictionaries(originalDic, element as PListDictionary, keepEmpty, false);

                    if (!keepEmpty && originalDic.Count > 0)
                    {
                        original.Add(originalDic);
                    }
                }
                else if (element is PListArray)
                {
                    var originalArray = new PListArray();
                    MergeArrays(originalArray, element as PListArray, keepEmpty);

                    if (!keepEmpty && originalArray.Count > 0)
                    {
                        original.Add(originalArray);
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(element.ToString()))
                    {
                        continue;
                    }

                    var matchedElements = ArrayContainsElement(original, element);

                    if (matchedElements == null)
                    {
                        original.Add(element);
                    }
                }
            }
        }
Пример #6
0
        void AddEnum(PListDictionary dic)
        {
            string settingName, displayName, group;

            ExtractCommon(dic, out settingName, out displayName, out group);
            var valueDic = dic.DictionaryValue(VALUE_KEY);

            if (valueDic != null)
            {
                List <string> enumValues   = new List <string>();
                List <string> enumNames    = new List <string>();
                int           defaultIndex = dic.IntValue(DEFAULT_INDEX);

                foreach (var key in valueDic.Keys)
                {
                    enumValues.Add(key);
                    enumNames.Add(valueDic.StringValue(key));
                }

                _settings[settingName] = new EnumBuildSetting(settingName, displayName, group, enumValues.ToArray(), enumNames.ToArray(), defaultIndex);
            }
        }
Пример #7
0
        public PListDictionary Serialize()
        {
            var dic = new PListDictionary();

            dic.Add(ACTIVE_CONFIGURATION_KEY, _activeConfiguration);
            var configs = new PListDictionary();

            foreach (var kvp in _configurations)
            {
                var entries = new PListArray();

                foreach (var e in kvp.Value)
                {
                    entries.Add(e);
                }

                configs.Add(kvp.Key, entries);
            }

            dic.Add(CONFIGURATIONS_KEY, configs);
            return(dic);
        }
Пример #8
0
        public CollectionBuildSettingEntry(PListDictionary dic)
            : base(dic)
        {
            //try to get array with new key
            var array = dic.ArrayValue(VALUE_KEY);

            //then try with old key
            if (array == null)
            {
                array = dic.ArrayValue(OLD_VALUE_KEY);
            }

            //get the values
            if (array != null)
            {
                Values = new List <string>();
                Values.AddRange(array.ToStringArray());
            }
            //if all failed see if it is a string (could be a custom string that is now known about.
            else
            {
                var strVal = dic.StringValue(VALUE_KEY);
                Values = StringUtils.StringListToList(strVal);
            }

            MergeMethod m;

            if (dic.EnumValue(MERGE_KEY, out m))
            {
                Merge = m;
            }
            else
            {
                Merge = MergeMethod.Append;
            }
        }
Пример #9
0
        //Background Modes
        void ApplyBackgroundModesCapability(BackgroundModesCapability capability)
        {
            //update pbxproject
            switch (_platform)
            {
            case BuildPlatform.tvOS:
                _pbxproj.EnableSystemCapability("com.apple.BackgroundModes.appletvos", true);
                break;

            case BuildPlatform.iOS:
            default:
                _pbxproj.EnableSystemCapability("com.apple.BackgroundModes", true);
                break;
            }

            //update info.plist
            var modes = new PListArray();

            if (capability.UsesBTLEAcc)
            {
                modes.Add("bluetooth-central");
            }

            if (capability.AudioAirplayPIP)
            {
                modes.Add("audio");
            }

            if (capability.ActsAsBTLEAcc)
            {
                modes.Add("bluetooth-peripheral");
            }

            if (capability.ExternalAccComms)
            {
                modes.Add("external-accessory");
            }

            if (capability.BackgroundFetch)
            {
                modes.Add("fetch");
            }

            if (capability.LocationUpdates)
            {
                modes.Add("location");
            }

            if (capability.NewsstandDownloads)
            {
                modes.Add("newsstand-content");
            }

            if (capability.RemoteNotifications)
            {
                modes.Add("remote-notification");
            }

            if (capability.VOIP)
            {
                modes.Add("voip");
            }

            if (modes.Count > 0)
            {
                var changes = new PListDictionary();
                changes.Add("UIBackgroundModes", modes);
                ApplyInfoPlistChanges(changes);
            }

            //update entitlements file
        }
Пример #10
0
        //iCloud
        void ApplyICloudCapability(ICloudCapability capability)
        {
            //update pbxproject
            _pbxproj.EnableSystemCapability("com.apple.iCloud", true);

            if (capability.CloudKit)
            {
                _pbxproj.AddSystemFramework("CloudKit.framework", LinkType.Required);
                //ensure push is enabled with cloudkit
                ApplyPushNotificationsCapability(new PushNotificationsCapability());
            }

            //update entitlements file
            var entitlementChanges   = new PListDictionary();
            var services             = new PListArray();
            var ubiquityContainerIds = new PListArray();
            var iCloudContainerIds   = new PListArray();

            if (capability.iCloudDocuments)
            {
                services.Add("CloudDocuments");
            }

            if (capability.CloudKit)
            {
                services.Add("CloudKit");
            }

            if (capability.iCloudDocuments || capability.CloudKit)
            {
                if (capability.UseCustomContainers)
                {
                    foreach (var item in capability.CustomContainers)
                    {
                        iCloudContainerIds.Add(item);

                        if (capability.iCloudDocuments)
                        {
                            ubiquityContainerIds.Add(item);
                        }
                    }
                }
                else
                {
                    iCloudContainerIds.Add("iCloud.$(CFBundleIdentifier)");

                    if (capability.iCloudDocuments)
                    {
                        ubiquityContainerIds.Add("iCloud.$(CFBundleIdentifier)");
                    }
                }
            }

            //always add, even if empty
            entitlementChanges.Add("com.apple.developer.icloud-container-identifiers", iCloudContainerIds);

            if (services.Count > 0)
            {
                entitlementChanges.Add("com.apple.developer.icloud-services", services);
            }

            if (ubiquityContainerIds.Count > 0)
            {
                entitlementChanges.Add("com.apple.developer.ubiquity-container-identifiers", ubiquityContainerIds);
            }

            if (capability.KeyValueStorage)
            {
                entitlementChanges.Add("com.apple.developer.ubiquity-kvstore-identifier", "$(TeamIdentifierPrefix)$(CFBundleIdentifier)");
            }

            ApplyEntitlementsChanges(entitlementChanges, true);
        }
Пример #11
0
        //Maps
        void ApplyMapsCapability(MapsCapability capability)
        {
            //update pbxproject
            _pbxproj.EnableSystemCapability("com.apple.Maps.iOS", true);
            _pbxproj.AddSystemFramework("MapKit.framework", LinkType.Required);
            //update info.plist
            var changes = new PListDictionary();
            var modes   = new PListArray();

            if (capability.Airplane)
            {
                modes.Add("MKDirectionsModePlane");
            }

            if (capability.Bike)
            {
                modes.Add("MKDirectionsModeBike");
            }

            if (capability.Bus)
            {
                modes.Add("MKDirectionsModeBus");
            }

            if (capability.Car)
            {
                modes.Add("MKDirectionsModeCar");
            }

            if (capability.Ferry)
            {
                modes.Add("MKDirectionsModeFerry");
            }

            if (capability.Other)
            {
                modes.Add("MKDirectionsModeOther");
            }

            if (capability.Pedestrian)
            {
                modes.Add("MKDirectionsModePedestrian");
            }

            if (capability.RideSharing)
            {
                modes.Add("MKDirectionsModeRideShare");
            }

            if (capability.Streetcar)
            {
                modes.Add("MKDirectionsModeStreetCar");
            }

            if (capability.Subway)
            {
                modes.Add("MKDirectionsModeSubway");
            }

            if (capability.Taxi)
            {
                modes.Add("MKDirectionsModeTaxi");
            }

            if (capability.Train)
            {
                modes.Add("MKDirectionsModeTrain");
            }

            if (modes.Count > 0)
            {
                changes.Add("MKDirectionsApplicationSupportedModes", modes);
                var docType = new PListDictionary();
                docType.Add("CFBundleTypeName", "MKDirectionsRequest");
                docType.Add("LSItemContentTypes", new PListArray("com.apple.maps.directionsrequest"));
                var docTypes = new PListArray(docType);
                changes.Add("CFBundleDocumentTypes", docTypes);
                ApplyInfoPlistChanges(changes);
            }
        }
Пример #12
0
 public MultipathCapability(PListDictionary dic)
 {
 }
Пример #13
0
 public HomeKitCapability(PListDictionary dic)
 {
 }
 public WirelessAccessoryConfigurationCapability(PListDictionary dic)
 {
 }
        public override PListDictionary Serialize()
        {
            var dic = new PListDictionary();

            return(dic);
        }
Пример #16
0
 public SiriCapability(PListDictionary dic)
 {
 }
Пример #17
0
        public static BaseCapability Create(SystemCapability systemCapability, PListDictionary dic)
        {
            switch (systemCapability)
            {
            case SystemCapability.iCloud:
                return(new ICloudCapability(dic));

            case SystemCapability.PushNotifications:
                return(new PushNotificationsCapability(dic));

            case SystemCapability.GameCenter:
                return(new GameCenterCapability(dic));

            case SystemCapability.Wallet:
                return(new WalletCapability(dic));

            case SystemCapability.Siri:
                return(new SiriCapability(dic));

            case SystemCapability.ApplePay:
                return(new ApplePayCapability(dic));

            case SystemCapability.InAppPurchase:
                return(new InAppPurchaseCapability(dic));

            case SystemCapability.Maps:
                return(new MapsCapability(dic));

            case SystemCapability.GameControllers:
                return(new GameControllersCapability(dic));

            case SystemCapability.PersonalVPN:
                return(new PersonalVPNCapability(dic));

            case SystemCapability.NetworkExtensions:
                return(new NetworkExtensionsCapability(dic));

            case SystemCapability.HotspotConfiguration:
                return(new HotspotConfigurationCapability(dic));

            case SystemCapability.Multipath:
                return(new MultipathCapability(dic));

            case SystemCapability.NFCTagReading:
                return(new NFCTagReadingCapability(dic));

            case SystemCapability.BackgroundModes:
                return(new BackgroundModesCapability(dic));

            case SystemCapability.InterAppAudio:
                return(new InterAppAudioCapability(dic));

            case SystemCapability.KeychainSharing:
                return(new KeychainSharingCapability(dic));

            case SystemCapability.AssociatedDomains:
                return(new AssociatedDomainsCapability(dic));

            case SystemCapability.AppGroups:
                return(new AppGroupsCapability(dic));

            case SystemCapability.DataProtection:
                return(new DataProtectionapability(dic));

            case SystemCapability.HomeKit:
                return(new HomeKitCapability(dic));

            case SystemCapability.HealthKit:
                return(new HealthKitCapability(dic));

            case SystemCapability.WirelessAccessoryConfiguration:
                return(new WirelessAccessoryConfigurationCapability(dic));

            default:
                throw new System.ArgumentOutOfRangeException();
            }
        }
Пример #18
0
 public PersonalVPNCapability(PListDictionary dic)
 {
 }
Пример #19
0
 public HealthKitCapability(PListDictionary dic)
 {
 }
 public NFCTagReadingCapability(PListDictionary dic)
 {
 }
Пример #21
0
 public GameCenterCapability(PListDictionary dic)
 {
 }
Пример #22
0
 void ExtractCommon(PListDictionary dic, out string settingName, out string displayName, out string group)
 {
     settingName = dic.StringValue(SETTING_KEY);
     displayName = dic.StringValue(DISPLAY_NAME_KEY);
     group       = dic.StringValue(GROUP_KEY);
 }
Пример #23
0
        public override PListDictionary Serialize()
        {
            var dic = new PListDictionary();

            dic.AddIfTrue(KEY_NETWORK_SERVER, KeyNetworkServer);
            dic.AddIfTrue(KEY_NETWORK_CLIENT, KeyNetworkClient);

            dic.AddIfTrue(KEY_CAMERA, KeyCamera);
            dic.AddIfTrue(KEY_AUDIO, KeyAudio);
            dic.AddIfTrue(KEY_USB, KeyUSB);
            dic.AddIfTrue(KEY_PRINTING, KeyPrinting);
            dic.AddIfTrue(KEY_BLUETOOTH, KeyBluetooth);

            dic.AddIfTrue(KEY_CONTACTS, KeyContacts);
            dic.AddIfTrue(KEY_LOCATION, KeyLocation);
            dic.AddIfTrue(KEY_CALENDAR, KeyCalendar);

            if (KeyUserSelectedFiles == READ_WRITE_OPTIONS.ReadOnly)
            {
                dic.Add(KEY_USER_SELECTED_FILES + EXT_READ_ONLY, true);
            }
            else if (KeyUserSelectedFiles == READ_WRITE_OPTIONS.ReadWrite)
            {
                dic.Add(KEY_USER_SELECTED_FILES + EXT_READ_WRITE, true);
            }

            if (KeyDownloadsFolder == READ_WRITE_OPTIONS.ReadOnly)
            {
                dic.Add(KEY_DOWNLOADS_FOLDER + EXT_READ_ONLY, true);
            }
            else if (KeyDownloadsFolder == READ_WRITE_OPTIONS.ReadWrite)
            {
                dic.Add(KEY_DOWNLOADS_FOLDER + EXT_READ_WRITE, true);
            }

            if (KeyPicturesFolder == READ_WRITE_OPTIONS.ReadOnly)
            {
                dic.Add(KEY_PICTURES_FOLDER + EXT_READ_ONLY, true);
            }
            else if (KeyPicturesFolder == READ_WRITE_OPTIONS.ReadWrite)
            {
                dic.Add(KEY_PICTURES_FOLDER + EXT_READ_WRITE, true);
            }

            if (KeyMusicFolder == READ_WRITE_OPTIONS.ReadOnly)
            {
                dic.Add(KEY_MUSIC_FOLDER + EXT_READ_ONLY, true);
            }
            else if (KeyMusicFolder == READ_WRITE_OPTIONS.ReadWrite)
            {
                dic.Add(KEY_MUSIC_FOLDER + EXT_READ_WRITE, true);
            }

            if (KeyMoviesFolder == READ_WRITE_OPTIONS.ReadOnly)
            {
                dic.Add(KEY_MOVIES_FOLDER + EXT_READ_ONLY, true);
            }
            else if (KeyMoviesFolder == READ_WRITE_OPTIONS.ReadWrite)
            {
                dic.Add(KEY_MOVIES_FOLDER + EXT_READ_WRITE, true);
            }

            return(dic);
        }
 public PushNotificationsCapability(PListDictionary dic)
 {
 }
Пример #25
0
        public AppSandboxCapability(PListDictionary dic)
        {
            KeyNetworkServer = dic.BoolValue(KEY_NETWORK_SERVER);
            KeyNetworkClient = dic.BoolValue(KEY_NETWORK_CLIENT);

            KeyCamera    = dic.BoolValue(KEY_CAMERA);
            KeyAudio     = dic.BoolValue(KEY_AUDIO);
            KeyUSB       = dic.BoolValue(KEY_USB);
            KeyPrinting  = dic.BoolValue(KEY_PRINTING);
            KeyBluetooth = dic.BoolValue(KEY_BLUETOOTH);

            KeyContacts = dic.BoolValue(KEY_CONTACTS);
            KeyLocation = dic.BoolValue(KEY_LOCATION);
            KeyCalendar = dic.BoolValue(KEY_CALENDAR);

            if (dic.BoolValue(KEY_USER_SELECTED_FILES + EXT_READ_ONLY))
            {
                KeyUserSelectedFiles = READ_WRITE_OPTIONS.ReadOnly;
            }
            else if (dic.BoolValue(KEY_USER_SELECTED_FILES + EXT_READ_WRITE))
            {
                KeyUserSelectedFiles = READ_WRITE_OPTIONS.ReadWrite;
            }
            else
            {
                KeyUserSelectedFiles = READ_WRITE_OPTIONS.None;
            }

            if (dic.BoolValue(KEY_DOWNLOADS_FOLDER + EXT_READ_ONLY))
            {
                KeyDownloadsFolder = READ_WRITE_OPTIONS.ReadOnly;
            }
            else if (dic.BoolValue(KEY_DOWNLOADS_FOLDER + EXT_READ_WRITE))
            {
                KeyDownloadsFolder = READ_WRITE_OPTIONS.ReadWrite;
            }
            else
            {
                KeyDownloadsFolder = READ_WRITE_OPTIONS.None;
            }

            if (dic.BoolValue(KEY_PICTURES_FOLDER + EXT_READ_ONLY))
            {
                KeyPicturesFolder = READ_WRITE_OPTIONS.ReadOnly;
            }
            else if (dic.BoolValue(KEY_PICTURES_FOLDER + EXT_READ_WRITE))
            {
                KeyPicturesFolder = READ_WRITE_OPTIONS.ReadWrite;
            }
            else
            {
                KeyPicturesFolder = READ_WRITE_OPTIONS.None;
            }

            if (dic.BoolValue(KEY_MUSIC_FOLDER + EXT_READ_ONLY))
            {
                KeyMusicFolder = READ_WRITE_OPTIONS.ReadOnly;
            }
            else if (dic.BoolValue(KEY_MUSIC_FOLDER + EXT_READ_WRITE))
            {
                KeyMusicFolder = READ_WRITE_OPTIONS.ReadWrite;
            }
            else
            {
                KeyMusicFolder = READ_WRITE_OPTIONS.None;
            }

            if (dic.BoolValue(KEY_MOVIES_FOLDER + EXT_READ_ONLY))
            {
                KeyMoviesFolder = READ_WRITE_OPTIONS.ReadOnly;
            }
            else if (dic.BoolValue(KEY_MOVIES_FOLDER + EXT_READ_WRITE))
            {
                KeyMoviesFolder = READ_WRITE_OPTIONS.ReadWrite;
            }
            else
            {
                KeyMoviesFolder = READ_WRITE_OPTIONS.None;
            }
        }
 public InAppPurchaseCapability(PListDictionary dic)
 {
 }
 public InterAppAudioCapability(PListDictionary dic)
 {
 }
Пример #28
0
        void MergeDictionaries(PListDictionary original, PListDictionary toMerge, bool keepEmpty, bool forceReplace)
        {
            foreach (var kvp in toMerge)
            {
                IPListElement toMergeElement = kvp.Value;

                if (toMergeElement is PListDictionary)
                {
                    var toMergeDic  = toMergeElement as PListDictionary;
                    var originalDic = original.Element <PListDictionary>(kvp.Key);

                    if (originalDic == null)
                    {
                        originalDic       = new PListDictionary();
                        original[kvp.Key] = originalDic;
                    }

                    if (forceReplace)
                    {
                        original [kvp.Key] = toMergeDic.Copy();
                        originalDic        = original.Element <PListDictionary> (kvp.Key);
                    }
                    else
                    {
                        MergeDictionaries(originalDic, toMergeDic, keepEmpty, forceReplace);
                    }

                    if (!keepEmpty && originalDic.Count <= 0)
                    {
                        original.Remove(kvp.Key);
                    }
                }
                else if (toMergeElement is PListArray)
                {
                    var toMergeArray  = toMergeElement as PListArray;
                    var originalArray = original.Element <PListArray>(kvp.Key);

                    if (originalArray == null)
                    {
                        originalArray     = new PListArray();
                        original[kvp.Key] = originalArray;
                    }

                    if (forceReplace)
                    {
                        original [kvp.Key] = toMergeArray.Copy();
                        originalArray      = original.Element <PListArray> (kvp.Key);
                    }
                    else
                    {
                        MergeArrays(originalArray, toMergeArray, keepEmpty);
                    }

                    if (!keepEmpty && originalArray.Count <= 0)
                    {
                        original.Remove(kvp.Key);
                    }
                }
                else
                {
                    //skip empty entries
                    //TODO should add empty string?
                    if (string.IsNullOrEmpty(toMergeElement.ToString()))
                    {
                        continue;
                    }

                    //add or overwrite existing value
                    original[kvp.Key] = kvp.Value.Copy();
                }
            }
        }
Пример #29
0
 public DataProtectionapability(PListDictionary dic)
 {
 }
Пример #30
0
 public AppleArcadeCapability(PListDictionary dic)
 {
 }