internal static ProvisioningProfile Browse(string path)
        {
            string title     = "Select the Provising Profile used for Manual Signing";
            string directory = path;
            ProvisioningProfile result;

            if (InternalEditorUtility.inBatchMode)
            {
                result = null;
            }
            else
            {
                ProvisioningProfile provisioningProfile = null;
                while (true)
                {
                    path = EditorUtility.OpenFilePanel(title, directory, "mobileprovision");
                    if (path.Length == 0)
                    {
                        break;
                    }
                    if (ProvisioningProfileGUI.GetProvisioningProfileId(path, out provisioningProfile))
                    {
                        goto Block_3;
                    }
                }
                result = null;
                return(result);

Block_3:
                result = provisioningProfile;
            }
            return(result);
        }
        internal static void ShowProvisioningProfileUIWithCallback(GUIContent titleWithToolTip, ProvisioningProfile profile, ProvisioningProfileGUI.ProvisioningProfileChangedDelegate callback)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(titleWithToolTip, EditorStyles.label, new GUILayoutOption[0]);
            if (GUILayout.Button("Browse", EditorStyles.miniButton, new GUILayoutOption[0]))
            {
                ProvisioningProfile provisioningProfile = ProvisioningProfileGUI.Browse("");
                if (provisioningProfile != null && !string.IsNullOrEmpty(provisioningProfile.UUID))
                {
                    profile = provisioningProfile;
                    callback(profile);
                    GUI.FocusControl("");
                }
            }
            GUILayout.EndHorizontal();
            EditorGUI.BeginChangeCheck();
            EditorGUI.indentLevel++;
            GUIContent label = EditorGUIUtility.TextContent("Profile ID:");

            profile.UUID = EditorGUILayout.TextField(label, profile.UUID, new GUILayoutOption[0]);
            EditorGUI.indentLevel--;
            if (EditorGUI.EndChangeCheck())
            {
                callback(profile);
            }
        }
        internal static void ShowUIWithDefaults(string provisioningPrefKey, SerializedProperty enableAutomaticSigningProp, GUIContent automaticSigningGUI, SerializedProperty manualSigningIDProp, GUIContent manualSigningProfileGUI, SerializedProperty appleDevIDProp, GUIContent teamIDGUIContent)
        {
            int  defaultAutomaticSigningValue = ProvisioningProfileGUI.GetDefaultAutomaticSigningValue(enableAutomaticSigningProp, iOSEditorPrefKeys.kDefaultiOSAutomaticallySignBuild);
            bool boolForAutomaticSigningValue = ProvisioningProfileGUI.GetBoolForAutomaticSigningValue(defaultAutomaticSigningValue);
            Rect controlRect = EditorGUILayout.GetControlRect(true, 0f, new GUILayoutOption[0]);

            EditorGUI.BeginProperty(controlRect, automaticSigningGUI, enableAutomaticSigningProp);
            bool flag = EditorGUILayout.Toggle(automaticSigningGUI, boolForAutomaticSigningValue, new GUILayoutOption[0]);

            if (flag != boolForAutomaticSigningValue)
            {
                enableAutomaticSigningProp.intValue = ProvisioningProfileGUI.GetIntValueForAutomaticSigningBool(flag);
            }
            EditorGUI.EndProperty();
            if (!flag)
            {
                ProvisioningProfileGUI.ShowProvisioningProfileUIWithDefaults(provisioningPrefKey, manualSigningIDProp, manualSigningProfileGUI);
            }
            else
            {
                string defaultStringValue = ProvisioningProfileGUI.GetDefaultStringValue(appleDevIDProp, iOSEditorPrefKeys.kDefaultiOSAutomaticSignTeamId);
                Rect   controlRect2       = EditorGUILayout.GetControlRect(true, 0f, new GUILayoutOption[0]);
                EditorGUI.BeginProperty(controlRect2, teamIDGUIContent, appleDevIDProp);
                EditorGUI.BeginChangeCheck();
                string stringValue = EditorGUILayout.TextField(teamIDGUIContent, defaultStringValue, new GUILayoutOption[0]);
                if (EditorGUI.EndChangeCheck())
                {
                    appleDevIDProp.stringValue = stringValue;
                }
                EditorGUI.EndProperty();
            }
        }
        internal static void ShowProvisioningProfileUIWithProperty(GUIContent titleWithToolTip, ProvisioningProfile profile, SerializedProperty prop)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(titleWithToolTip, EditorStyles.label, new GUILayoutOption[0]);
            Rect       controlRect = EditorGUILayout.GetControlRect(false, 0f, new GUILayoutOption[0]);
            GUIContent label       = EditorGUIUtility.TextContent("Profile ID:");

            EditorGUI.BeginProperty(controlRect, label, prop);
            if (GUILayout.Button("Browse", EditorStyles.miniButton, new GUILayoutOption[0]))
            {
                ProvisioningProfile provisioningProfile = ProvisioningProfileGUI.Browse("");
                if (provisioningProfile != null && !string.IsNullOrEmpty(provisioningProfile.UUID))
                {
                    profile          = provisioningProfile;
                    prop.stringValue = profile.UUID;
                    GUI.FocusControl("");
                }
            }
            GUILayout.EndHorizontal();
            EditorGUI.EndProperty();
            EditorGUI.BeginChangeCheck();
            EditorGUI.indentLevel++;
            controlRect = EditorGUILayout.GetControlRect(true, 0f, new GUILayoutOption[0]);
            label       = EditorGUIUtility.TextContent("Profile ID:");
            EditorGUI.BeginProperty(controlRect, label, prop);
            profile.UUID = EditorGUILayout.TextField(label, profile.UUID, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                prop.stringValue = profile.UUID;
            }
            EditorGUI.EndProperty();
            EditorGUI.indentLevel--;
        }
        private static void ShowProvisioningProfileUIWithDefaults(string defaultPreferenceKey, SerializedProperty uuidProp, GUIContent title)
        {
            string text = uuidProp.stringValue;

            if (string.IsNullOrEmpty(text))
            {
                text = EditorPrefs.GetString(defaultPreferenceKey);
            }
            ProvisioningProfileGUI.ShowProvisioningProfileUIWithProperty(title, new ProvisioningProfile(text), uuidProp);
        }
 public void ShowExternalApplications()
 {
     GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinHeight(25f) };
     EditorGUILayout.LabelField(EditorGUIUtility.TextContent("Xcode Default Settings|All of these settings can be overridden in the Player Settings panel"), EditorStyles.boldLabel, options);
     this.m_DefaultAutomaticallySignBuild = EditorGUILayout.Toggle(EditorGUIUtility.TextContent("Automatically Sign|Can be overridden in Player Settings"), this.m_DefaultAutomaticallySignBuild, new GUILayoutOption[0]);
     this.m_DefaultAutomaticSignTeamId    = EditorGUILayout.TextField(EditorGUIUtility.TextContent("Automatic Signing Team Id:|Can be overriden in Player Settings"), this.m_DefaultAutomaticSignTeamId, new GUILayoutOption[0]);
     GUILayout.Space(10f);
     ProvisioningProfileGUI.ShowProvisioningProfileUIWithCallback(EditorGUIUtility.TextContent("iOS Manual Provisioning Profile|Can be overridden in Player Settings"), this.m_DefaultiOSProvisioningProfile, delegate(ProvisioningProfile profile) {
         this.m_DefaultiOSProvisioningProfile = profile;
         this.WritePreferences();
         this.ReadPreferences();
     });
     GUILayout.Space(10f);
     ProvisioningProfileGUI.ShowProvisioningProfileUIWithCallback(EditorGUIUtility.TextContent("tvOS Manual Provisioning Profile|Can be overridden in Player Settings"), this.m_DefaulttvOSProvisioningProfile, delegate(ProvisioningProfile profile) {
         this.m_DefaulttvOSProvisioningProfile = profile;
         this.WritePreferences();
         this.ReadPreferences();
     });
 }