Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Checks your iTunes folder for any .ipas that look like Xamarin apps
void Main()
var myXamarinApps =
.EnumerateFiles(Path.Combine(Environment.GetEnvironmentVariable("HOMEPATH"), @"Music\iTunes\iTunes Media\Mobile Applications"), "*.ipa")
.Where(f=> ZipFile.Open(f, ZipArchiveMode.Read)
.Any(e=> e.FullName.Contains(".monotouch-")));
foreach (var app in myXamarinApps)
// we need this because some apps contain non-windows-friendly filenames, and ZipArchive.Entries will throw
public static class ZipArchiveHelper
private static FieldInfo _Entries;
private static MethodInfo _EnsureDirRead;
static ZipArchiveHelper()
_Entries= typeof(ZipArchive).GetField("_entries",BindingFlags.NonPublic|BindingFlags.Instance);
_EnsureDirRead = typeof(ZipArchive).GetMethod("EnsureCentralDirectoryRead", BindingFlags.NonPublic | BindingFlags.Instance);
public static List<ZipArchiveEntry> GetRawEntries(this ZipArchive archive)
try { _EnsureDirRead.Invoke(archive, null); } catch { }
return (List<ZipArchiveEntry>)_Entries.GetValue(archive);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment