Merge pull request #24 from garoxas/master

NSP update version based on .cnmt.xml
This commit is contained in:
StudentBlake 2018-09-13 14:28:19 -04:00 committed by GitHub
commit ed60192436
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,6 +295,7 @@ namespace XCI_Explorer {
try {
FileStream fileStream = File.OpenRead(TB_File.Text);
string ncaTarget = "";
string xmlVersion = "";
List<char> chars = new List<char>();
byte[] array = new byte[16];
@ -336,6 +337,8 @@ namespace XCI_Explorer {
XDocument xml = XDocument.Parse(Encoding.UTF8.GetString(array4));
TB_TID.Text = xml.Element("ContentMeta").Element("Id").Value.Remove(1, 2).ToUpper();
contentType = xml.Element("ContentMeta").Element("Type").Value;
if (contentType == "Patch")
xmlVersion = " (v" + xml.Element("ContentMeta").Element("Version").Value + ")";
/*string titleIDBaseGame = TB_TID.Text;
if (contentType != "Application") {
@ -439,7 +442,7 @@ namespace XCI_Explorer {
}
}
}
TB_GameRev.Text = NACP.NACP_Datas[0].GameVer.Replace("\0", ""); ;
TB_GameRev.Text = NACP.NACP_Datas[0].GameVer.Replace("\0", "") + xmlVersion; ;
TB_ProdCode.Text = NACP.NACP_Datas[0].GameProd.Replace("\0", ""); ;
if (TB_ProdCode.Text == "") {
TB_ProdCode.Text = "No Prod. ID";
@ -463,6 +466,10 @@ namespace XCI_Explorer {
/*if (contentType == "Patch") {
}*/
}
else {
TB_GameRev.Text = "";
TB_ProdCode.Text = "No Prod. ID";
}
// Lets get SDK Version, Distribution Type and Masterkey revision
// This is far from the best aproach, but it's what we have for now