Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Xamarin.MacDev/MobileProvision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static MobileProvision LoadFromFile (string fileName)
}
}

LoggingService.LogInfo ($"Loaded provisioning profile from '{fileName}'");
LoggingService.LogInfo ($"Loaded provisioning profile '{m.Name}' from '{fileName}'");

return m;
}
Expand Down
74 changes: 37 additions & 37 deletions Xamarin.MacDev/MobileProvisionIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,25 +359,25 @@ public static MobileProvision GetMobileProvision (MobileProvisionPlatform platfo
var latestCreationDate = DateTime.MinValue;

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return null;
}

foreach (var profile in index.ProvisioningProfiles) {
if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (name == profile.Name || name == profile.Uuid)
return MobileProvision.LoadFromFile (profile.FileName);

failures?.Add ($"The profile '{profile.Name}' is not applicable because its Name and Uuid ({profile.Uuid}) do not match '{name}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its Name and Uuid ({profile.Uuid}) do not match '{name}'.");
}

return null;
Expand All @@ -392,7 +392,7 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var now = DateTime.UtcNow;

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return list;
}

Expand All @@ -401,17 +401,17 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var profile = index.ProvisioningProfiles [i];

if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (!includeExpired && profile.ExpirationDate < now) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
continue;
}

Expand Down Expand Up @@ -444,7 +444,7 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var now = DateTime.UtcNow;

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return list;
}

Expand All @@ -453,22 +453,22 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var profile = index.ProvisioningProfiles [i];

if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (!includeExpired && profile.ExpirationDate < now) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
continue;
}

if (type != MobileProvisionDistributionType.Any && (profile.Distribution & type) == 0) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
continue;
}

Expand Down Expand Up @@ -505,15 +505,15 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
throw new ArgumentNullException (nameof (developerCertificates));

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return list;
}

foreach (var certificate in developerCertificates)
thumbprints.Add (certificate.Thumbprint);

if (thumbprints.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles because there are no developer certificates.");
LoggingService.LogInfo ($"Could not find any provisioning profiles because there are no developer certificates.");
return list;
}

Expand All @@ -522,28 +522,28 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var profile = index.ProvisioningProfiles [i];

if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (!includeExpired && profile.ExpirationDate < now) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
continue;
}

if (type != MobileProvisionDistributionType.Any && (profile.Distribution & type) == 0) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
continue;
}

foreach (var cert in profile.DeveloperCertificates) {
if (!thumbprints.Contains (cert.Thumbprint)) {
failures?.Add ($"The profile '{profile.Name}' might not be applicable because its developer certificate (of {profile.DeveloperCertificates.Count} certificates) {cert.Name}'s thumbprint ({cert.Thumbprint}) is not in the list of accepted thumbprints ({string.Join (", ", thumbprints)}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' might not be applicable because its developer certificate (of {profile.DeveloperCertificates.Count} certificates) {cert.Name}'s thumbprint ({cert.Thumbprint}) is not in the list of accepted thumbprints ({string.Join (", ", thumbprints)}).");
continue;
}

Expand Down Expand Up @@ -581,7 +581,7 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
throw new ArgumentNullException (nameof (bundleIdentifier));

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return list;
}

Expand All @@ -590,22 +590,22 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var profile = index.ProvisioningProfiles [i];

if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (!includeExpired && profile.ExpirationDate < now) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
continue;
}

if (type != MobileProvisionDistributionType.Any && (profile.Distribution & type) == 0) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
continue;
}

Expand All @@ -621,12 +621,12 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
id = id.TrimEnd ('*');

if (!bundleIdentifier.StartsWith (id, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
continue;
}
} else if (id != bundleIdentifier) {
// the CFBundleIdentifier provided by our caller does not match this provisioning profile
failures?.Add ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
continue;
}

Expand Down Expand Up @@ -666,15 +666,15 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
throw new ArgumentNullException (nameof (developerCertificates));

if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
LoggingService.LogInfo ($"Could not find any provisioning profiles on this machine.");
return list;
}

foreach (var certificate in developerCertificates)
thumbprints.Add (certificate.Thumbprint);

if (thumbprints.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles because there are no developer certificates.");
LoggingService.LogInfo ($"Could not find any provisioning profiles because there are no developer certificates.");
return list;
}

Expand All @@ -683,22 +683,22 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
var profile = index.ProvisioningProfiles [i];

if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
continue;
}

if (!profile.Platforms.Contains (platform)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its platforms ({string.Join (", ", profile.Platforms.Select ((v) => v.ToString ()))}) do not match the requested platform ({platform}).");
continue;
}

if (!includeExpired && profile.ExpirationDate < now) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because it has expired ({profile.ExpirationDate}).");
continue;
}

if (type != MobileProvisionDistributionType.Any && (profile.Distribution & type) == 0) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its ({profile.Distribution}) does not match the expected type ({type}).");
continue;
}

Expand All @@ -714,20 +714,20 @@ public static IList<MobileProvision> GetMobileProvisions (MobileProvisionPlatfor
id = id.TrimEnd ('*');

if (!bundleIdentifier.StartsWith (id, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
continue;
}
} else if (id != bundleIdentifier) {
// the CFBundleIdentifier provided by our caller does not match this provisioning profile
failures?.Add ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
LoggingService.LogInfo ($"The profile '{profile.Name}' is not applicable because its id ({profile.ApplicationIdentifier}) does not match the bundle identifer {bundleIdentifier}.");
continue;
}

var anyMatchingCerts = profile.DeveloperCertificates.Any (cert => thumbprints.Contains (cert.Thumbprint));
if (!anyMatchingCerts) {
failures?.Add ($"The profile '{profile.Name}' ({profile.ApplicationIdentifier}) is not applicable because none of its developer certificates match the currently available certificates. This provisioning profile has {profile.DeveloperCertificates.Count} certificate(s):");
LoggingService.LogInfo ($"The profile '{profile.Name}' ({profile.ApplicationIdentifier}) is not applicable because none of its developer certificates match the currently available certificates. This provisioning profile has {profile.DeveloperCertificates.Count} certificate(s):");
foreach (var cert in profile.DeveloperCertificates)
failures?.Add ($" {cert.Name} ({cert.Thumbprint})");
LoggingService.LogInfo ($" {cert.Name} ({cert.Thumbprint})");
} else {
if (unique) {
int idx;
Expand Down