Example #1
0
        public void ReplaceMobileProvision(byte[] mobileProvisionBytes)
        {
            m_zipFile.BeginUpdate();
            MemoryStreamDataSource mobileProvisionDataSource = new MemoryStreamDataSource(mobileProvisionBytes);

            m_zipFile.Add(mobileProvisionDataSource, m_appDirectoryPath + MobileProvisionFileName);

            CodeResourcesFile codeResources = GetCodeResourcesFile();

            codeResources.UpdateFileHash(MobileProvisionFileName, mobileProvisionBytes);

            MobileProvisionFile mobileProvision = new MobileProvisionFile(mobileProvisionBytes);
            string provisionedBundleIdentifier  = mobileProvision.PList.Entitlements.BundleIdentifier;

            if (provisionedBundleIdentifier != GetBundleIdentifier())
            {
                // We must update the info.plist's CFBundleIdentifier to match the one from the mobile provision
                InfoFile infoFile = GetInfoFile();
                infoFile.BundleIdentifier = provisionedBundleIdentifier;
                byte[] infoBytes = infoFile.GetBytes();
                MemoryStreamDataSource infoDataSource = new MemoryStreamDataSource(infoBytes);
                m_zipFile.Add(infoDataSource, m_appDirectoryPath + InfoFileName);

                codeResources.UpdateFileHash(InfoFileName, infoBytes);
            }

            byte[] codeResourcesBytes = codeResources.GetBytes();
            MemoryStreamDataSource codeResourcesDataSource = new MemoryStreamDataSource(codeResourcesBytes);

            m_zipFile.Add(codeResourcesDataSource, m_appDirectoryPath + CodeResourcesFilePath);

            m_zipFile.CommitUpdate();
        }
Example #2
0
        public string GetBundleIdentifier()
        {
            InfoFile infoFile = GetInfoFile();

            if (infoFile != null)
            {
                return(infoFile.BundleIdentifier);
            }
            return(null);
        }
Example #3
0
        public string GetExecutableName()
        {
            InfoFile infoFile = GetInfoFile();

            if (infoFile != null)
            {
                return(infoFile.ExecutableName);
            }
            return(null);
        }