Esempio n. 1
0
        private async Task <string> DecryptContent(String fileName, bool IsIndexFile = false)
        {
            string contentString = string.Empty;
            string fullName      = null;

            if (IsIndexFile)
            {
                fullName = Path.Combine(dlBook.GetDirectory(), "index", fileName.Replace(Constants.XML, Constants.ZIP));
            }
            else
            {
                fullName = Path.Combine(dlBook.GetDirectory(), fileName.Replace(Constants.XML, Constants.ZIP));
            }
            if (await GlobalAccess.DirectoryService.FileExists(fullName))
            {
                contentString += await DecryptManager.DecryptContentFromZipFile(fullName, this.contentKey, dlBook.GetInitVector());
            }
            else
            {
                Logger.Log("Missing file");
            }


            return(contentString);
        }
Esempio n. 2
0
        public string UpdateContentImgSrcValue(string content)
        {
            Regex  regex  = new Regex(Constants.CONTENT_IMAGES_PLACEHOLDER, RegexOptions.IgnoreCase);
            string imgSrc = Path.Combine(GlobalAccess.DirectoryService.GetAppExternalRootPath(),
                                         DlBook.GetDirectory() + "\\");

            content = regex.Replace(content, imgSrc);
            return(content);
        }