Example #1
0
        public ActionResult Manifest(string id, string number, string package)
        {
            string filepath;
            var    packages = new PackageManager(id, number);

            if (!packages.Exists(package, out filepath))
            {
                return(HttpNotFound());
            }

            var plist     = new InfoPlistExtractor().ExtractFromPackage(filepath);
            var viewModel = new ManifestViewModel
            {
                BundleIdentifier = GetPropertyValue(plist, "CFBundleIdentifier"),
                BundleVersion    = GetPropertyValue(plist, "CFBundleVersion"),
                Title            = GetPropertyValue(plist, "CFBundleDisplayName"),
                DisplayImage     =
                    GetApplicationPath(Request) +
                    Url.Action("DisplayImage",
                               new { id, number, package, image = GetArrayValues(plist, "CFBundleIconFiles")[0] }),
                FullSizeImage   = GetApplicationPath(Request) + Url.Content("~/Content/512x512.png"),
                SoftwarePackage = GetApplicationPath(Request) + Url.Action("Package", new { id, number, package }),
            };


            Response.ContentType = "text/xml";
            return(View(viewModel));
        }
Example #2
0
        public void CanReadBundleIdentifierFromPackage()
        {
            var sut    = new InfoPlistExtractor();
            var stream = GetType().Assembly.GetManifestResourceStream("CustomerPortal.Web.Test.Resources.package.ipa");
            var xml    = sut.ExtractFromPackage(stream);

            var bundleIdentifier = xml.Root.Descendants("key")
                                   .First(x => x.Value == "CFBundleIdentifier")
                                   .ElementsAfterSelf("string").First().Value;

            Assert.AreEqual("com.apcurium.MK.CentralTaxiNiagara", bundleIdentifier);
        }