From abd218fa10c6154057d673aebadb0833cca9f866 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 6 Dec 2018 15:57:36 +0100 Subject: [PATCH] Added option to load NUSTitlesRemote without decrypting anything (or parsing the FST) ( => for downloading) --- src/de/mas/wiiu/jnus/NUSTitleConfig.java | 1 + src/de/mas/wiiu/jnus/NUSTitleLoader.java | 7 +++++-- src/de/mas/wiiu/jnus/NUSTitleLoaderRemote.java | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/de/mas/wiiu/jnus/NUSTitleConfig.java b/src/de/mas/wiiu/jnus/NUSTitleConfig.java index ec0763b..9ae67b2 100644 --- a/src/de/mas/wiiu/jnus/NUSTitleConfig.java +++ b/src/de/mas/wiiu/jnus/NUSTitleConfig.java @@ -36,4 +36,5 @@ public class NUSTitleConfig { private long titleID = 0x0L; private WoomyInfo woomyInfo; + private boolean noDecryption; } diff --git a/src/de/mas/wiiu/jnus/NUSTitleLoader.java b/src/de/mas/wiiu/jnus/NUSTitleLoader.java index df4ffca..b817687 100644 --- a/src/de/mas/wiiu/jnus/NUSTitleLoader.java +++ b/src/de/mas/wiiu/jnus/NUSTitleLoader.java @@ -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; } diff --git a/src/de/mas/wiiu/jnus/NUSTitleLoaderRemote.java b/src/de/mas/wiiu/jnus/NUSTitleLoaderRemote.java index 8f44b16..e7d2017 100644 --- a/src/de/mas/wiiu/jnus/NUSTitleLoaderRemote.java +++ b/src/de/mas/wiiu/jnus/NUSTitleLoaderRemote.java @@ -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); }