Beispiel #1
0
 static void CheckProvisionForUDID(MobileProvision Provision, string UDID, string Context)
 {
     if (Provision == null)
     {
         MessageBox.Show(String.Format("Failed to load or parse {0}", Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         if (Provision.ContainsUDID(UDID))
         {
             MessageBox.Show(String.Format("Found the UDID {0} in {1}", UDID, Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show(String.Format("Warning: Failed to find UDID {0} in {1}!", UDID, Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
 static void CheckProvisionForUDID(MobileProvision Provision, string UDID, string Context)
 {
     if (Provision == null)
     {
         MessageBox.Show(String.Format("Failed to load or parse {0}", Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         if (Provision.ContainsUDID(UDID))
         {
             MessageBox.Show(String.Format("Found the UDID {0} in {1}", UDID, Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show(String.Format("Warning: Failed to find UDID {0} in {1}!", UDID, Context), Config.AppDisplayName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
Beispiel #3
0
        public static void InstallIPAOnConnectedDevices(string IPAPath)
        {
            // Read the mobile provision to check for issues
            FileOperations.ReadOnlyZipFileSystem Zip = new FileOperations.ReadOnlyZipFileSystem(IPAPath);
            MobileProvision Provision = null;

            try
            {
                MobileProvisionParser.ParseFile(Zip.ReadAllBytes("embedded.mobileprovision"));
            }
            catch (System.Exception ex)
            {
                Program.Warning(String.Format("Couldn't find an embedded mobile provision ({0})", ex.Message));
                Provision = null;
            }
            Zip.Close();

            if (Provision != null)
            {
                var DeviceList = DeploymentHelper.Get().EnumerateConnectedDevices();

                foreach (var DeviceInfo in DeviceList)
                {
                    string UDID       = DeviceInfo.UDID;
                    string DeviceName = DeviceInfo.DeviceName;

                    // Check the IPA's mobile provision against the connected device to make sure this device is authorized
                    // We'll still try installing anyways, but this message is more friendly than the failure we get back from MobileDeviceInterface
                    if (UDID != String.Empty)
                    {
                        if (!Provision.ContainsUDID(UDID))
                        {
                            Program.Warning(String.Format("Embedded provision in IPA does not include the UDID {0} of device '{1}'.  The installation is likely to fail.", UDID, DeviceName));
                        }
                    }
                    else
                    {
                        Program.Warning(String.Format("Unable to query device for UDID, and therefore unable to verify IPA embedded mobile provision contains this device."));
                    }
                }
            }

            DeploymentHelper.Get().InstallIPAOnDevice(IPAPath);
        }