diff --git a/pom.xml b/pom.xml index 5db0749..48f92e8 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ com.github.Maschell JNUSLib - e3be1f5 + b95e1ab org.projectlombok @@ -109,5 +109,15 @@ commons-cli 1.4 + + org.slf4j + slf4j-api + 1.7.5 + + + org.slf4j + slf4j-log4j12 + 1.7.5 + diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSTDataProviderContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSTDataProviderContainer.java index 32f726e..44229a2 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSTDataProviderContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSTDataProviderContainer.java @@ -3,7 +3,9 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; import java.util.Optional; import java.util.function.Supplier; -import de.mas.wiiu.jnus.entities.fst.FSTEntry; +import de.mas.wiiu.jnus.entities.FST.nodeentry.DirectoryEntry; +import de.mas.wiiu.jnus.entities.FST.nodeentry.FileEntry; +import de.mas.wiiu.jnus.entities.FST.nodeentry.NodeEntry; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.interfaces.FSTDataProvider; @@ -42,11 +44,11 @@ public class FSTDataProviderContainer implements FuseContainer { @Override public int open(String path, FuseFileInfo fi) { - Optional entryOpt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); + Optional entryOpt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); if (entryOpt.isPresent()) { - if (entryOpt.get().isDir()) { + if (entryOpt.get().isDirectory()) { return -ErrorCodes.EISDIR(); - } else if (!entryOpt.get().isNotInPackage()) { + } else if (!entryOpt.get().isLink()) { return 0; } } @@ -60,18 +62,18 @@ public class FSTDataProviderContainer implements FuseContainer { stat.st_nlink.set(2); return 0; } - Optional entryOpt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); + Optional entryOpt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); int res = 0; if (entryOpt.isPresent()) { - FSTEntry entry = entryOpt.get(); - if (entry.isDir()) { + NodeEntry entry = entryOpt.get(); + if (entry.isDirectory()) { stat.st_mode.set(FileStat.S_IFDIR | 0755); stat.st_nlink.set(2); } else { stat.st_mode.set(FileStat.S_IFREG | FileStat.ALL_READ); stat.st_nlink.set(1); - stat.st_size.set(entry.getFileSize()); + stat.st_size.set(((FileEntry) entry).getSize()); } } else { System.out.println("error for " + path); @@ -82,10 +84,10 @@ public class FSTDataProviderContainer implements FuseContainer { @Override public int readdir(String path, Pointer buf, FuseFillDir filter, long offset, FuseFileInfo fi) { - FSTEntry entry = getDataProvider().getRoot(); + DirectoryEntry entry = getDataProvider().getRoot(); if (!path.equals("/")) { - Optional entryOpt = FSTUtils.getFileEntryDir(entry, path); + Optional entryOpt = FSTUtils.getFileEntryDir(entry, path); if (!entryOpt.isPresent()) { return -ErrorCodes.ENOENT(); } @@ -95,9 +97,9 @@ public class FSTDataProviderContainer implements FuseContainer { filter.apply(buf, ".", null, 0); filter.apply(buf, "..", null, 0); - for (FSTEntry e : entry.getChildren()) { - if (!e.isNotInPackage()) { - filter.apply(buf, e.getFilename(), null, 0); + for (NodeEntry e : entry.getChildren()) { + if (!e.isLink()) { + filter.apply(buf, e.getName(), null, 0); } } return 0; @@ -105,19 +107,19 @@ public class FSTDataProviderContainer implements FuseContainer { @Override public int read(String path, Pointer buf, long size, long offset, FuseFileInfo fi) { - Optional entryopt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); - if (entryopt.isPresent() && !entryopt.get().isNotInPackage()) { + Optional entryopt = FSTUtils.getFSTEntryByFullPath(getDataProvider().getRoot(), path); + if (entryopt.isPresent() && !entryopt.get().isLink() && entryopt.get().isFile()) { - FSTEntry entry = entryopt.get(); + FileEntry entry = (FileEntry) entryopt.get(); - if (offset >= entry.getFileSize()) { + if (offset >= entry.getSize()) { return 0; } - if (offset + size > entry.getFileSize()) { - size = entry.getFileSize() - offset; + if (offset + size > entry.getSize()) { + size = entry.getSize() - offset; } - - if(size > Integer.MAX_VALUE) { + + if (size > Integer.MAX_VALUE) { System.err.println("Request read size was too big."); return -ErrorCodes.EIO(); } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalBackupNUSTitleContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalBackupNUSTitleContainer.java index 24a16b0..1495ca8 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalBackupNUSTitleContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalBackupNUSTitleContainer.java @@ -24,9 +24,9 @@ public class LocalBackupNUSTitleContainer extends GroupFuseContainer { @Override protected void doInit() { - File[] wud = folder.listFiles(f -> f.isDirectory() && f.getName().startsWith("v")); + File[] wud = folder.listFiles(f -> f.getName().startsWith("tmd.")); for (File versionF : wud) { - short version = Short.parseShort(versionF.getName().substring(1)); + short version = Short.parseShort(versionF.getName().substring(4)); this.addFuseContainer(String.format("v%d", version), new FSTDataProviderContainer(Optional.of(this), () -> { long titleID = Utils.StringToLong(folder.getName()); NUSTitle t = null; diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalNUSTitleContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalNUSTitleContainer.java index a560c93..8c1f0a2 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalNUSTitleContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/LocalNUSTitleContainer.java @@ -7,8 +7,8 @@ import java.util.Optional; import de.mas.wiiu.jnus.NUSTitle; import de.mas.wiiu.jnus.NUSTitleLoaderLocal; -import de.mas.wiiu.jnus.entities.TMD; import de.mas.wiiu.jnus.entities.Ticket; +import de.mas.wiiu.jnus.entities.TMD.TitleMetaData; import de.mas.wiiu.jnus.fuse_wiiu.Settings; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.fuse_wiiu.utils.TicketUtils; @@ -28,7 +28,7 @@ public class LocalNUSTitleContainer extends GroupFuseContainer { long titleID = 0; short version = 0; try { - TMD tmd = TMD.parseTMD(new File(folder.getAbsoluteFile() + File.separator + "title.tmd")); + TitleMetaData tmd = TitleMetaData.parseTMD(new File(folder.getAbsoluteFile() + File.separator + "title.tmd")); titleID = tmd.getTitleID(); version = tmd.getTitleVersion(); } catch (IOException | ParseException e2) { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderFuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderFuseContainer.java index 69853d1..c21c106 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderFuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderFuseContainer.java @@ -12,6 +12,7 @@ import lombok.val; public class MultipleFSTDataProviderFuseContainer extends GroupFuseContainer { private final File file; private final FSTDataProviderLoader loader; + private int i = 0; public MultipleFSTDataProviderFuseContainer(Optional parent, File file, FSTDataProviderLoader loader) { super(parent); @@ -31,7 +32,7 @@ public class MultipleFSTDataProviderFuseContainer extends GroupFuseContainer void parseContents(List dps) { for (val dp : dps) { - this.addFuseContainer(dp.getName(), new FSTDataProviderContainer(getParent(), dp)); + this.addFuseContainer(dp.getName() + "_" + (++i), new FSTDataProviderContainer(getParent(), dp)); } } } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderRecursiveFuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderRecursiveFuseContainer.java index 32dc964..aed4582 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderRecursiveFuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/MultipleFSTDataProviderRecursiveFuseContainer.java @@ -7,7 +7,8 @@ import java.util.List; import java.util.Optional; import de.mas.wiiu.jnus.NUSTitleLoaderFST; -import de.mas.wiiu.jnus.entities.fst.FSTEntry; +import de.mas.wiiu.jnus.entities.FST.nodeentry.DirectoryEntry; +import de.mas.wiiu.jnus.entities.FST.nodeentry.FileEntry; import de.mas.wiiu.jnus.fuse_wiiu.Settings; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FSTDataProviderLoader; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; @@ -25,34 +26,29 @@ public class MultipleFSTDataProviderRecursiveFuseContainer extends MultipleFS void parseContents(List dps) { try { for (FSTDataProvider dp : dps) { - for (FSTEntry tmd : FSTUtils.getFSTEntriesByRegEx(dp.getRoot(), ".*tmd")) { - Optional parentOpt = tmd.getParent(); - if (parentOpt.isPresent()) { - FSTEntry parent = parentOpt.get(); - if (parent.getFileChildren().stream().filter(f -> f.getFilename().endsWith(".app")).findAny().isPresent()) { - FSTDataProvider fdp = null; + for (FileEntry tmd : FSTUtils.getFSTEntriesByRegEx(dp.getRoot(), ".*tmd")) { + DirectoryEntry parent = tmd.getParent(); + if (parent.getFileChildren().stream().filter(f -> f.getName().endsWith(".app")).findAny().isPresent()) { + FSTDataProvider fdp = null; + try { + fdp = new FSTDataProviderNUSTitle(NUSTitleLoaderFST.loadNUSTitle(dp, parent, Settings.retailCommonKey)); + } catch (IOException | ParseException e) { try { - fdp = new FSTDataProviderNUSTitle(NUSTitleLoaderFST.loadNUSTitle(dp, parent, Settings.retailCommonKey)); - } catch (IOException | ParseException e) { - try { - fdp = new FSTDataProviderNUSTitle(NUSTitleLoaderFST.loadNUSTitle(dp, parent, Settings.devCommonKey)); - } catch (Exception e1) { - System.out.println("Ignoring " + parent.getFilename() + " :" + e1.getClass().getName() + " " + e1.getMessage()); - continue; - } - } catch (Exception e) { - System.out.println("Ignoring " + parent.getFilename() + " :" + e.getClass().getName() + " " + e.getMessage()); + fdp = new FSTDataProviderNUSTitle(NUSTitleLoaderFST.loadNUSTitle(dp, parent, Settings.devCommonKey)); + } catch (Exception e1) { + System.out.println("Ignoring " + parent.getName() + " :" + e1.getClass().getName() + " " + e1.getMessage()); continue; } - - FSTDataProvider fdpCpy = fdp; - - this.addFuseContainer("[DECRYPTED] [" + dp.getName() + "] " + parent.getFilename(), - new FSTDataProviderContainer(getParent(), fdpCpy)); + } catch (Exception e) { + System.out.println("Ignoring " + parent.getName() + " :" + e.getClass().getName() + " " + e.getMessage()); + continue; } - } + FSTDataProvider fdpCpy = fdp; + + this.addFuseContainer("[DECRYPTED] [" + dp.getName() + "] " + parent.getName(), new FSTDataProviderContainer(getParent(), fdpCpy)); + } } if (dp instanceof HasNUSTitle) { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/NUSTitleEncryptedFuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/NUSTitleEncryptedFuseContainer.java index 3fe9706..5e0bf4b 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/NUSTitleEncryptedFuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/NUSTitleEncryptedFuseContainer.java @@ -7,7 +7,7 @@ import java.util.Optional; import java.util.function.Supplier; import de.mas.wiiu.jnus.NUSTitle; -import de.mas.wiiu.jnus.entities.content.Content; +import de.mas.wiiu.jnus.entities.TMD.Content; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import jnr.ffi.Pointer; diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/RemoteLocalBackupNUSTitleContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/RemoteLocalBackupNUSTitleContainer.java new file mode 100644 index 0000000..c2139f7 --- /dev/null +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/RemoteLocalBackupNUSTitleContainer.java @@ -0,0 +1,62 @@ +package de.mas.wiiu.jnus.fuse_wiiu.implementation; + +import java.io.File; +import java.io.IOException; +import java.util.Optional; + +import de.mas.wiiu.jnus.NUSTitle; +import de.mas.wiiu.jnus.NUSTitleLoaderRemoteLocal; +import de.mas.wiiu.jnus.entities.Ticket; +import de.mas.wiiu.jnus.fuse_wiiu.Settings; +import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; +import de.mas.wiiu.jnus.fuse_wiiu.utils.TicketUtils; +import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; +import de.mas.wiiu.jnus.utils.Utils; + +public class RemoteLocalBackupNUSTitleContainer extends GroupFuseContainer { + + private File folder; + + public RemoteLocalBackupNUSTitleContainer(Optional parent, File folder) { + super(parent); + this.folder = folder; + } + + @Override + protected void doInit() { + File[] wud = folder.listFiles(f -> f.getName().startsWith("tmd.")); + for (File versionF : wud) { + short version = Short.parseShort(versionF.getName().substring(4)); + this.addFuseContainer(String.format("v%d", version), new FSTDataProviderContainer(Optional.of(this), () -> { + long titleID = Utils.StringToLong(folder.getName()); + NUSTitle t = null; + Optional ticketOpt = TicketUtils.getTicket(folder, Settings.titlekeyPath, titleID, Settings.retailCommonKey); + System.out.println(ticketOpt); + if (!ticketOpt.isPresent()) { + + return null; + } + Ticket ticket = ticketOpt.get(); + try { + t = NUSTitleLoaderRemoteLocal.loadNUSTitle(folder.getAbsolutePath(), version, ticket); + } catch (Exception e) { + // Try dev ticket + ticket = Ticket.createTicket(ticket.getEncryptedKey(), titleID, Settings.devCommonKey); + try { + t = NUSTitleLoaderRemoteLocal.loadNUSTitle(folder.getAbsolutePath(), version, ticket); + } catch (Exception e1) { + e.printStackTrace(); + e1.printStackTrace(); + } + } + try { + return new FSTDataProviderNUSTitle(t); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + })); + } + } + +} diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WUDToWUDContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WUDToWUDContainer.java index 939380f..38a61b5 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WUDToWUDContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WUDToWUDContainer.java @@ -8,7 +8,7 @@ import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.fuse_wiiu.utils.WUDUtils; import de.mas.wiiu.jnus.implementations.wud.WUDImage; -import de.mas.wiiu.jnus.implementations.wud.parser.WUDInfo; +import de.mas.wiiu.jnus.implementations.wud.WiiUDisc; import jnr.ffi.Pointer; import ru.serce.jnrfuse.ErrorCodes; import ru.serce.jnrfuse.FuseFillDir; @@ -17,7 +17,7 @@ import ru.serce.jnrfuse.struct.FuseFileInfo; public class WUDToWUDContainer implements FuseContainer { private final String filename; - private final Optional wudInfo; + private final Optional wudInfo; private final Optional parent; public WUDToWUDContainer(Optional parent, File c) { @@ -91,7 +91,7 @@ public class WUDToWUDContainer implements FuseContainer { try { byte[] data; - data = wudInfo.get().getWUDDiscReader().readEncryptedToByteArray(offset, 0, size); + data = wudInfo.get().getReader().get().readEncryptedToByteArray(offset, 0, size); buf.put(0, data, 0, data.length); return data.length; } catch (IOException e) { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WUDFSTDataProviderLoader.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WUDFSTDataProviderLoader.java index 532ab98..203785e 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WUDFSTDataProviderLoader.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WUDFSTDataProviderLoader.java @@ -11,11 +11,11 @@ import de.mas.wiiu.jnus.WUDLoader; import de.mas.wiiu.jnus.fuse_wiiu.Settings; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FSTDataProviderLoader; import de.mas.wiiu.jnus.fuse_wiiu.utils.WUDUtils; -import de.mas.wiiu.jnus.implementations.wud.parser.WUDInfo; +import de.mas.wiiu.jnus.implementations.wud.WiiUDisc; import de.mas.wiiu.jnus.interfaces.FSTDataProvider; import lombok.Getter; -public class WUDFSTDataProviderLoader implements FSTDataProviderLoader { +public class WUDFSTDataProviderLoader implements FSTDataProviderLoader { @Getter private static WUDFSTDataProviderLoader instance = new WUDFSTDataProviderLoader(); @@ -23,7 +23,7 @@ public class WUDFSTDataProviderLoader implements FSTDataProviderLoader } @Override - public List getDataProvider(WUDInfo info) { + public List getDataProvider(WiiUDisc info) { List dps = new ArrayList<>(); try { dps = WUDLoader.getPartitonsAsFSTDataProvider(info, Settings.retailCommonKey); @@ -38,7 +38,7 @@ public class WUDFSTDataProviderLoader implements FSTDataProviderLoader } @Override - public Optional loadInfo(File input) { + public Optional loadInfo(File input) { return WUDUtils.loadWUDInfo(input); } } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java index 858d3c0..9b79920 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java @@ -10,6 +10,7 @@ import de.mas.wiiu.jnus.fuse_wiiu.implementation.LocalBackupNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.LocalNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.MultipleFSTDataProviderFuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.MultipleFSTDataProviderRecursiveFuseContainer; +import de.mas.wiiu.jnus.fuse_wiiu.implementation.RemoteLocalBackupNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDToWUDContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WoomyNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.loader.WUDFSTDataProviderLoader; @@ -25,14 +26,22 @@ public class FuseContainerWrapper { public static Map createFuseContainer(Optional parent, File c) { System.out.println("Mounting " + c.getAbsolutePath()); + Map result = new HashMap<>(); + if (c.exists() && c.isDirectory()) { + File[] tmd = c.listFiles(f -> f.isFile() && f.getName().startsWith("tmd.")); + if (tmd != null && tmd.length > 0) { + result.put(prefix + c.getName(), new RemoteLocalBackupNUSTitleContainer(parent, c)); + return result; + } + } if (c.exists() && c.isDirectory()) { File[] tmd = c.listFiles(f -> f.isFile() && f.getName().equals("title.tmd")); if (tmd != null && tmd.length > 0) { // In case there is a tmd file // Checks if we have the local backup format - File[] versions = c.listFiles(f -> f.isDirectory() && f.getName().startsWith("v")); + File[] versions = c.listFiles(f -> f.getName().startsWith("tmd.")); if (versions != null && versions.length > 0 && c.getName().length() == 16 && Utils.StringToLong(c.getName()) > 0) { result.put(prefix + c.getName(), new LocalBackupNUSTitleContainer(parent, c)); return result; @@ -55,8 +64,7 @@ public class FuseContainerWrapper { return result; } - - + if (checkWUD(result, parent, c)) { return result; } @@ -70,7 +78,7 @@ public class FuseContainerWrapper { } private static boolean checkWUD(Map result, Optional parent, File c) { - if (c.exists() && c.isFile() && (c.getName().endsWith(".wux") || c.getName().endsWith(".wud") || c.getName().endsWith(".ddi"))) { + if (c.exists() && c.isFile() && (c.getName().endsWith(".wux") || c.getName().endsWith(".wud") || c.getName().endsWith(".ddi") || c.getName().endsWith(".wumada"))) { if (c.length() == WUDDiscReaderSplitted.WUD_SPLITTED_FILE_SIZE && !c.getName().endsWith("part1.wud")) { return false; } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java index d22a287..4b29cd6 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java @@ -14,6 +14,9 @@ public class TicketUtils { if (folder != null) { ticketFile = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "title.tik"); } + if (ticketFile == null) { + ticketFile = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "cetk"); + } Ticket ticket = null; if (ticketFile != null && ticketFile.exists()) { try { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/WUDUtils.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/WUDUtils.java index d69fbc5..2d1fe93 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/WUDUtils.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/WUDUtils.java @@ -9,10 +9,10 @@ import org.apache.commons.io.FilenameUtils; import de.mas.wiiu.jnus.WUDLoader; import de.mas.wiiu.jnus.fuse_wiiu.Settings; -import de.mas.wiiu.jnus.implementations.wud.parser.WUDInfo; +import de.mas.wiiu.jnus.implementations.wud.WiiUDisc; public class WUDUtils { - public static Optional loadWUDInfo(File file) { + public static Optional loadWUDInfo(File file) { String FSfilename = file.getName(); String basename = FilenameUtils.getBaseName(FSfilename); File keyFile = new File(file.getParent() + File.separator + basename + ".key");