internal static void ShowProvisioningProfileUIWithCallback(GUIContent titleWithToolTip, ProvisioningProfile profile, 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 profile2 = Browse("");
         if ((profile2 != null) && !string.IsNullOrEmpty(profile2.UUID))
         {
             profile = profile2;
             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);
     }
 }
        private static void parseFile(string filePath, ProvisioningProfile profile)
        {
            System.IO.StreamReader file = new System.IO.StreamReader(filePath);
            string line;

            while ((line = file.ReadLine()) != null)
            {
                Match match = Regex.Match(line, s_FirstLinePattern);
                if (match.Success)
                {
                    // get the next line immediately and check it
                    if ((line = file.ReadLine()) != null)
                    {
                        Match secondMatch = Regex.Match(line, s_SecondLinePattern);
                        if (secondMatch.Success)
                        {
                            profile.UUID = secondMatch.Groups[1].Value;
                            break;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(profile.UUID))
                {
                    break;
                }
            }
            file.Close();
        }
        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 bool GetProvisioningProfileId(string filePath, out ProvisioningProfile provisioningProfile)
        {
            ProvisioningProfile provisioningProfile2 = ProvisioningProfile.ParseProvisioningProfileAtPath(filePath);

            provisioningProfile = provisioningProfile2;
            return(provisioningProfile2.UUID != null);
        }
        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);
            }
        }
        private static void parseFile(string filePath, ProvisioningProfile profile)
        {
            StreamReader streamReader = new StreamReader(filePath);
            string       input;

            while ((input = streamReader.ReadLine()) != null)
            {
                Match match = Regex.Match(input, ProvisioningProfile.s_FirstLinePattern);
                if (match.Success)
                {
                    if ((input = streamReader.ReadLine()) != null)
                    {
                        Match match2 = Regex.Match(input, ProvisioningProfile.s_SecondLinePattern);
                        if (match2.Success)
                        {
                            profile.UUID = match2.Groups[1].Value;
                            break;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(profile.UUID))
                {
                    break;
                }
            }
            streamReader.Close();
        }
        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--;
        }
Beispiel #8
0
        internal static ProvisioningProfile Browse(string path)
        {
            var msg = "Select the Provising Profile used for Manual Signing";

            var defaultFolder = path;

            if (InternalEditorUtility.inBatchMode)
            {
                return(null);
            }

            ProvisioningProfile provisioningProfile = null;

            do
            {
                path = EditorUtility.OpenFilePanel(msg, defaultFolder, "mobileprovision");

                // user pressed cancel?
                if (path.Length == 0)
                {
                    return(null);
                }
            }while (!GetProvisioningProfileId(path, out provisioningProfile));

            return(provisioningProfile);
        }
        internal static ProvisioningProfile ParseProvisioningProfileAtPath(string pathToFile)
        {
            ProvisioningProfile provisioningProfile = new ProvisioningProfile();

            ProvisioningProfile.parseFile(pathToFile, provisioningProfile);
            return(provisioningProfile);
        }
 public void ReadPreferences()
 {
     this.m_DefaultAutomaticallySignBuild = EditorPrefs.GetBool(iOSEditorPrefKeys.kDefaultiOSAutomaticallySignBuild, true);
     this.m_DefaultAutomaticSignTeamId = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaultiOSAutomaticSignTeamId);
     string uUID = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaultiOSProvisioningProfileUUID);
     this.m_DefaultiOSProvisioningProfile = new ProvisioningProfile(uUID);
     uUID = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaulttvOSProvisioningProfileUUID);
     this.m_DefaulttvOSProvisioningProfile = new ProvisioningProfile(uUID);
 }
        public void ReadPreferences()
        {
            this.m_DefaultAutomaticallySignBuild = EditorPrefs.GetBool(iOSEditorPrefKeys.kDefaultiOSAutomaticallySignBuild, true);
            this.m_DefaultAutomaticSignTeamId    = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaultiOSAutomaticSignTeamId);
            string uUID = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaultiOSProvisioningProfileUUID);

            this.m_DefaultiOSProvisioningProfile = new ProvisioningProfile(uUID);
            uUID = EditorPrefs.GetString(iOSEditorPrefKeys.kDefaulttvOSProvisioningProfileUUID);
            this.m_DefaulttvOSProvisioningProfile = new ProvisioningProfile(uUID);
        }
 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();
     });
 }
 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();
     });
 }
        internal static ProvisioningProfile Browse(string path)
        {
            string title     = "Select the Provising Profile used for Manual Signing";
            string directory = path;

            if (InternalEditorUtility.inBatchMode)
            {
                return(null);
            }
            ProvisioningProfile provisioningProfile = null;

            do
            {
                path = EditorUtility.OpenFilePanel(title, directory, "mobileprovision");
                if (path.Length == 0)
                {
                    return(null);
                }
            }while (!GetProvisioningProfileId(path, out provisioningProfile));
            return(provisioningProfile);
        }
 private static void parseFile(string filePath, ProvisioningProfile profile)
 {
     string str;
     StreamReader reader = new StreamReader(filePath);
     while ((str = reader.ReadLine()) != null)
     {
         if (Regex.Match(str, s_FirstLinePattern).Success && ((str = reader.ReadLine()) != null))
         {
             Match match2 = Regex.Match(str, s_SecondLinePattern);
             if (match2.Success)
             {
                 profile.UUID = match2.Groups[1].Value;
                 break;
             }
         }
         if (!string.IsNullOrEmpty(profile.UUID))
         {
             break;
         }
     }
     reader.Close();
 }
        private static void parseFile(string filePath, ProvisioningProfile profile)
        {
            string       str;
            StreamReader reader = new StreamReader(filePath);

            while ((str = reader.ReadLine()) != null)
            {
                if (Regex.Match(str, s_FirstLinePattern).Success&& ((str = reader.ReadLine()) != null))
                {
                    Match match2 = Regex.Match(str, s_SecondLinePattern);
                    if (match2.Success)
                    {
                        profile.UUID = match2.Groups[1].Value;
                        break;
                    }
                }
                if (!string.IsNullOrEmpty(profile.UUID))
                {
                    break;
                }
            }
            reader.Close();
        }
 internal static void ShowProvisioningProfileUIWithProperty(GUIContent titleWithToolTip, ProvisioningProfile profile, SerializedProperty prop)
 {
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Label(titleWithToolTip, EditorStyles.label, new GUILayoutOption[0]);
     Rect totalPosition = EditorGUILayout.GetControlRect(false, 0f, new GUILayoutOption[0]);
     GUIContent label = EditorGUIUtility.TextContent("Profile ID:");
     EditorGUI.BeginProperty(totalPosition, label, prop);
     if (GUILayout.Button("Browse", EditorStyles.miniButton, new GUILayoutOption[0]))
     {
         ProvisioningProfile profile2 = Browse("");
         if ((profile2 != null) && !string.IsNullOrEmpty(profile2.UUID))
         {
             profile = profile2;
             prop.stringValue = profile.UUID;
             GUI.FocusControl("");
         }
     }
     GUILayout.EndHorizontal();
     EditorGUI.EndProperty();
     EditorGUI.BeginChangeCheck();
     EditorGUI.indentLevel++;
     totalPosition = EditorGUILayout.GetControlRect(true, 0f, new GUILayoutOption[0]);
     label = EditorGUIUtility.TextContent("Profile ID:");
     EditorGUI.BeginProperty(totalPosition, label, prop);
     profile.UUID = EditorGUILayout.TextField(label, profile.UUID, new GUILayoutOption[0]);
     if (EditorGUI.EndChangeCheck())
     {
         prop.stringValue = profile.UUID;
     }
     EditorGUI.EndProperty();
     EditorGUI.indentLevel--;
 }
 internal static ProvisioningProfile ParseProvisioningProfileAtPath(string pathToFile)
 {
     ProvisioningProfile profile = new ProvisioningProfile();
     parseFile(pathToFile, profile);
     return profile;
 }
 internal static bool GetProvisioningProfileId(string filePath, out ProvisioningProfile provisioningProfile)
 {
     ProvisioningProfile profile = ProvisioningProfile.ParseProvisioningProfileAtPath(filePath);
     provisioningProfile = profile;
     return (profile.UUID != null);
 }