MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ShowInstallDialogPage

Function ShowInstallDialogPage

Goldleaf/source/ui/ui_InstallLayout.cpp:88–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 };
87
88 InstallDialogResult ShowInstallDialogPage(nsp::Installer &nsp_installer, const size_t program_idx) {
89 const size_t program_count = nsp_installer.GetInstallablePrograms().size();
90 const auto &program = nsp_installer.GetInstallablePrograms().at(program_idx);
91
92 auto info = cfg::Strings.GetString(82) + "\n\n";
93
94 const auto &cnts = nsp_installer.GetContents();
95 info += cfg::Strings.GetString(93) + " ";
96 u32 cnt_count = 0;
97 for(const auto &cnt: cnts) {
98 info += FormatContentType(static_cast<NcmContentType>(cnt.content_type)) + ", ";
99 cnt_count++;
100 if(cnt_count > 3) {
101 cnt_count = 0;
102 info += "\n";
103 }
104 }
105 if(info.back() == '\n') {
106 info.pop_back();
107 }
108 info.pop_back();
109 info.pop_back();
110
111 const auto key_gen = nsp_installer.GetKeyGeneration();
112 info += "\n" + cfg::Strings.GetString(95) + " " + std::to_string(key_gen) + " ";
113 info += "(" + hos::GetKeyGenerationRange(key_gen) + ")";
114
115 if(nsp_installer.HasTicket()) {
116 const auto &ticket = nsp_installer.GetTicketFile();
117 info += "\n\n" + cfg::Strings.GetString(94) + "\n";
118 info += "[" + FormatTicketFlags(ticket.data.flags) + "]";
119 info += "\n - " + cfg::Strings.GetString(235) + " " + ticket.data.GetTitleKey();
120 info += "\n - " + cfg::Strings.GetString(236) + " ";
121 switch(ticket.signature) {
122 case cnt::TicketSignature::RSA_4096_SHA1: {
123 info += "RSA-4096 PKCS#1 v1.5 (SHA1)";
124 break;
125 }
126 case cnt::TicketSignature::RSA_2048_SHA1: {
127 info += "RSA-2048 PKCS#1 v1.5 (SHA1)";
128 break;
129 }
130 case cnt::TicketSignature::ECDSA_SHA1: {
131 info += "ECDSA (SHA256)";
132 break;
133 }
134 case cnt::TicketSignature::RSA_4096_SHA256: {
135 info += "RSA-4096 PKCS#1 v1.5 (SHA256)";
136 break;
137 }
138 case cnt::TicketSignature::RSA_2048_SHA256: {
139 info += "RSA-2048 PKCS#1 v1.5 (SHA256)";
140 break;
141 }
142 case cnt::TicketSignature::ECDSA_SHA256: {
143 info += "ECDSA (SHA256)";
144 break;
145 }

Callers 1

StartInstallMethod · 0.85

Calls 13

FormatContentTypeFunction · 0.85
GetKeyGenerationRangeFunction · 0.85
FormatTicketFlagsFunction · 0.85
IsApplicationNacpEmptyFunction · 0.85
FindApplicationNacpNameFunction · 0.85
GetContentsMethod · 0.80
GetKeyGenerationMethod · 0.80
HasTicketMethod · 0.80
GetTitleKeyMethod · 0.80
GetContentMetaTypeMethod · 0.80
DisplayDialogMethod · 0.80

Tested by

no test coverage detected