This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Using Iteedee.ApkReader package | |
byte[] manifestData = null; | |
byte[] resourcesData = null; | |
using (ICSharpCode.SharpZipLib.Zip.ZipInputStream zip = new ICSharpCode.SharpZipLib.Zip.ZipInputStream(File.OpenRead(path))) | |
{ | |
using (var filestream = new FileStream(path, FileMode.Open, FileAccess.Read)) | |
{ | |
ICSharpCode.SharpZipLib.Zip.ZipFile zipfile = new ICSharpCode.SharpZipLib.Zip.ZipFile(filestream); | |
ICSharpCode.SharpZipLib.Zip.ZipEntry item; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FileStream fs = new FileStream(@"/index-v1.json", FileMode.Open); | |
using (BinaryReader s = new BinaryReader(fs)) | |
{ | |
byte[] bytes = new byte[50 * 1024]; | |
string hashBase64 = ParseToSha1(bytes); | |
Debug.WriteLine("index-v1.json: " + hashBase64); | |
} | |
//Or by text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string mapPath = HttpContext.Current.Server.MapPath("/"); | |
string pfx = @mapPath + "/keystore.p12"; | |
X509Certificate2 cert = new X509Certificate2(pfx, "password"); | |
string xml = @mapPath + "/file.SF"; | |
byte[] fileContent = System.IO.File.ReadAllBytes(xml); | |
ContentInfo contentInfo = new ContentInfo(fileContent); | |
SignedCms cms = new SignedCms(contentInfo, true); | |
CmsSigner signer = new CmsSigner(cert); | |
cms.ComputeSignature(signer); |