Added option to load NUSTitlesRemote without decrypting anything (or parsing the FST) ( => for downloading)

This commit is contained in:
Maschell 2018-12-06 15:57:36 +01:00
parent 7e07765fa1
commit abd218fa10
3 changed files with 11 additions and 2 deletions

View File

@ -36,4 +36,5 @@ public class NUSTitleConfig {
private long titleID = 0x0L;
private WoomyInfo woomyInfo;
private boolean noDecryption;
}

View File

@ -48,18 +48,21 @@ abstract class NUSTitleLoader {
throw new Exception();
}
if (config.isNoDecryption()) {
return result;
}
Ticket ticket = config.getTicket();
if (ticket == null) {
ticket = Ticket.parseTicket(dataProvider.getRawTicket());
}
result.setTicket(ticket);
// System.out.println(ticket);
Content fstContent = tmd.getContentByIndex(0);
InputStream fstContentEncryptedStream = dataProvider.getInputStreamFromContent(fstContent, 0);
if (fstContentEncryptedStream == null) {
log.warning("FST is null");
return null;
}

View File

@ -39,12 +39,17 @@ public final class NUSTitleLoaderRemote extends NUSTitleLoader {
}
public static NUSTitle loadNUSTitle(long titleID, int version, Ticket ticket) throws Exception {
return loadNUSTitle(titleID, Settings.LATEST_TMD_VERSION, ticket, false);
}
public static NUSTitle loadNUSTitle(long titleID, int version, Ticket ticket, boolean noEncryption) throws Exception {
NUSTitleLoader loader = new NUSTitleLoaderRemote();
NUSTitleConfig config = new NUSTitleConfig();
config.setVersion(version);
config.setTitleID(titleID);
config.setTicket(ticket);
config.setNoDecryption(noEncryption);
return loader.loadNusTitle(config);
}