diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Main.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Main.java index d646184..c73d424 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Main.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Main.java @@ -1,5 +1,13 @@ package de.mas.wiiu.jnus.fuse_wiiu; +import de.mas.wiiu.jnus.fuse_wiiu.implementation.GroupFuseContainer; +import de.mas.wiiu.jnus.fuse_wiiu.implementation.GroupFuseContainerDefault; +import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; +import de.mas.wiiu.jnus.fuse_wiiu.utils.FuseContainerWrapper; +import de.mas.wiiu.jnus.utils.HashUtil; +import de.mas.wiiu.jnus.utils.Utils; +import org.apache.commons.cli.*; + import java.io.File; import java.io.IOException; import java.nio.charset.Charset; @@ -9,20 +17,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Optional; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -import de.mas.wiiu.jnus.fuse_wiiu.implementation.GroupFuseContainer; -import de.mas.wiiu.jnus.fuse_wiiu.implementation.GroupFuseContainerDefault; -import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; -import de.mas.wiiu.jnus.fuse_wiiu.utils.FuseContainerWrapper; -import de.mas.wiiu.jnus.utils.HashUtil; -import de.mas.wiiu.jnus.utils.Utils; - public class Main { private static final String DEV_COMMON_KEY = "devcommon.key"; private static final String COMMON_KEY = "common.key"; @@ -168,7 +162,7 @@ public class Main { } RootFuseFS stub = new RootFuseFS(root); - try { + try { System.out.println("Mounting " + new File(inputPath).getAbsolutePath() + " to " + mount.getAbsolutePath()); stub.mount(mount.toPath(), true, false); } finally { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Settings.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Settings.java index cf67f15..c7fe5ef 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Settings.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/Settings.java @@ -1,13 +1,13 @@ package de.mas.wiiu.jnus.fuse_wiiu; -import java.io.File; - import de.mas.wiiu.jnus.utils.Utils; +import java.io.File; + public class Settings { - public static File disckeyPath = null; public static final byte[] retailCommonKeyHash = Utils.StringToByteArray("6A0B87FC98B306AE3366F0E0A88D0B06A2813313"); public static final byte[] devCommonKeyHash = Utils.StringToByteArray("E191BFDB1232537D7DADEAD81F2A48FD6F188E02"); + public static File disckeyPath = null; public static File titlekeyPath = null; public static byte[] retailCommonKey = new byte[16]; public static byte[] devCommonKey = new byte[16]; diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSFuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSFuseContainer.java index 535b6db..e2b1da1 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSFuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/FSFuseContainer.java @@ -1,19 +1,14 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.io.File; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.Timer; -import java.util.TimerTask; - 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.FuseContainerWrapper; import lombok.val; +import java.io.File; +import java.util.*; +import java.util.Map.Entry; + /** * Representation of a directory on the OS filesystem. For every children of this directory the FuseContainerWrapper is used to create children if needed. * 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 44229a2..4a3f25a 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 @@ -1,8 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.util.Optional; -import java.util.function.Supplier; - 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; @@ -17,6 +14,9 @@ import ru.serce.jnrfuse.FuseFillDir; import ru.serce.jnrfuse.struct.FileStat; import ru.serce.jnrfuse.struct.FuseFileInfo; +import java.util.Optional; +import java.util.function.Supplier; + /** * FuseContainer implementation based on a FSTDataProvider. * diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainer.java index 0cb7e1e..587d027 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainer.java @@ -1,12 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.Map.Entry; -import java.util.function.BiFunction; -import java.util.stream.Collectors; - import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import jnr.ffi.Pointer; @@ -17,11 +10,17 @@ import ru.serce.jnrfuse.FuseFillDir; import ru.serce.jnrfuse.struct.FileStat; import ru.serce.jnrfuse.struct.FuseFileInfo; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.function.BiFunction; +import java.util.stream.Collectors; + /** * Implementation of an FuseContainer which can hold serveral FuseContainers emulated as directories. - * - * @author Maschell * + * @author Maschell */ public abstract class GroupFuseContainer implements FuseContainer { private final Map containerMap = new HashMap<>(); diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainerDefault.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainerDefault.java index 33047ce..1ac3383 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainerDefault.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/GroupFuseContainerDefault.java @@ -1,13 +1,13 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.util.Optional; - import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; +import java.util.Optional; + /** * Default GroupFuseContainer implementation - * @author Maschell * + * @author Maschell */ public class GroupFuseContainerDefault extends GroupFuseContainer { 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 1495ca8..8dfd645 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 @@ -1,9 +1,5 @@ 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.NUSTitleLoaderLocalBackup; import de.mas.wiiu.jnus.entities.Ticket; @@ -13,6 +9,10 @@ import de.mas.wiiu.jnus.fuse_wiiu.utils.TicketUtils; import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; import de.mas.wiiu.jnus.utils.Utils; +import java.io.File; +import java.io.IOException; +import java.util.Optional; + public class LocalBackupNUSTitleContainer extends GroupFuseContainer { private File folder; 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 8c1f0a2..d8774e0 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 @@ -1,19 +1,19 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; +import de.mas.wiiu.jnus.NUSTitle; +import de.mas.wiiu.jnus.NUSTitleLoaderLocal; +import de.mas.wiiu.jnus.entities.TMD.TitleMetaData; +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 java.io.File; import java.io.IOException; import java.text.ParseException; import java.util.Optional; -import de.mas.wiiu.jnus.NUSTitle; -import de.mas.wiiu.jnus.NUSTitleLoaderLocal; -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; -import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; - public class LocalNUSTitleContainer extends GroupFuseContainer { private File folder; 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 c21c106..e7d85df 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 @@ -1,14 +1,14 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.io.File; -import java.util.List; -import java.util.Optional; - import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FSTDataProviderLoader; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.interfaces.FSTDataProvider; import lombok.val; +import java.io.File; +import java.util.List; +import java.util.Optional; + public class MultipleFSTDataProviderFuseContainer extends GroupFuseContainer { private final File file; private final FSTDataProviderLoader loader; 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 aed4582..d95d885 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 @@ -1,11 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.io.File; -import java.io.IOException; -import java.text.ParseException; -import java.util.List; -import java.util.Optional; - import de.mas.wiiu.jnus.NUSTitleLoaderFST; import de.mas.wiiu.jnus.entities.FST.nodeentry.DirectoryEntry; import de.mas.wiiu.jnus.entities.FST.nodeentry.FileEntry; @@ -17,6 +11,12 @@ import de.mas.wiiu.jnus.interfaces.FSTDataProvider; import de.mas.wiiu.jnus.interfaces.HasNUSTitle; import de.mas.wiiu.jnus.utils.FSTUtils; +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.util.List; +import java.util.Optional; + public class MultipleFSTDataProviderRecursiveFuseContainer extends MultipleFSTDataProviderFuseContainer { public MultipleFSTDataProviderRecursiveFuseContainer(Optional parent, File input, FSTDataProviderLoader loader) { super(parent, input, loader); 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 5e0bf4b..7d68b25 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 @@ -1,11 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.function.Supplier; - import de.mas.wiiu.jnus.NUSTitle; import de.mas.wiiu.jnus.entities.TMD.Content; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; @@ -16,6 +10,12 @@ import ru.serce.jnrfuse.FuseFillDir; import ru.serce.jnrfuse.struct.FileStat; import ru.serce.jnrfuse.struct.FuseFileInfo; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.Supplier; + public class NUSTitleEncryptedFuseContainer implements FuseContainer { private final Optional parent; private final NUSTitle title; 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 index c2139f7..b4cd4af 100644 --- 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 @@ -1,9 +1,5 @@ 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; @@ -13,6 +9,10 @@ import de.mas.wiiu.jnus.fuse_wiiu.utils.TicketUtils; import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; import de.mas.wiiu.jnus.utils.Utils; +import java.io.File; +import java.io.IOException; +import java.util.Optional; + public class RemoteLocalBackupNUSTitleContainer extends GroupFuseContainer { private File folder; 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 38a61b5..d84e0e8 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 @@ -1,9 +1,5 @@ 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.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.fuse_wiiu.utils.WUDUtils; @@ -15,6 +11,10 @@ import ru.serce.jnrfuse.FuseFillDir; import ru.serce.jnrfuse.struct.FileStat; import ru.serce.jnrfuse.struct.FuseFileInfo; +import java.io.File; +import java.io.IOException; +import java.util.Optional; + public class WUDToWUDContainer implements FuseContainer { private final String filename; private final Optional wudInfo; diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java index 81af34b..5c145f1 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java @@ -1,12 +1,12 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation; -import java.io.File; -import java.util.Optional; - import de.mas.wiiu.jnus.NUSTitleLoaderWoomy; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; +import java.io.File; +import java.util.Optional; + public class WoomyNUSTitleContainer extends GroupFuseContainer { private final File file; 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 203785e..d76f84b 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 @@ -1,12 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation.loader; -import java.io.File; -import java.io.IOException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import de.mas.wiiu.jnus.WUDLoader; import de.mas.wiiu.jnus.fuse_wiiu.Settings; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FSTDataProviderLoader; @@ -15,13 +8,20 @@ import de.mas.wiiu.jnus.implementations.wud.WiiUDisc; import de.mas.wiiu.jnus.interfaces.FSTDataProvider; import lombok.Getter; +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + public class WUDFSTDataProviderLoader implements FSTDataProviderLoader { @Getter - private static WUDFSTDataProviderLoader instance = new WUDFSTDataProviderLoader(); - + private static final WUDFSTDataProviderLoader instance = new WUDFSTDataProviderLoader(); + private WUDFSTDataProviderLoader() { } - + @Override public List getDataProvider(WiiUDisc info) { List dps = new ArrayList<>(); diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WumadFSTDataProviderLoader.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WumadFSTDataProviderLoader.java index f85a83d..620a406 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WumadFSTDataProviderLoader.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/loader/WumadFSTDataProviderLoader.java @@ -1,12 +1,5 @@ package de.mas.wiiu.jnus.fuse_wiiu.implementation.loader; -import java.io.File; -import java.io.IOException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import de.mas.wiiu.jnus.WumadLoader; import de.mas.wiiu.jnus.fuse_wiiu.Settings; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FSTDataProviderLoader; @@ -14,13 +7,20 @@ import de.mas.wiiu.jnus.implementations.wud.wumad.WumadInfo; import de.mas.wiiu.jnus.interfaces.FSTDataProvider; import lombok.Getter; +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + public class WumadFSTDataProviderLoader implements FSTDataProviderLoader { @Getter - private static WumadFSTDataProviderLoader instance = new WumadFSTDataProviderLoader(); - + private static final WumadFSTDataProviderLoader instance = new WumadFSTDataProviderLoader(); + private WumadFSTDataProviderLoader() { } - + @Override public Optional loadInfo(File input) { if (input != null && input.exists()) { diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FSTDataProviderLoader.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FSTDataProviderLoader.java index 142ba6f..50ac084 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FSTDataProviderLoader.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FSTDataProviderLoader.java @@ -1,13 +1,13 @@ package de.mas.wiiu.jnus.fuse_wiiu.interfaces; +import de.mas.wiiu.jnus.interfaces.FSTDataProvider; + import java.io.File; import java.util.List; import java.util.Optional; -import de.mas.wiiu.jnus.interfaces.FSTDataProvider; - public interface FSTDataProviderLoader { - public Optional loadInfo(File input); + Optional loadInfo(File input); - public List getDataProvider(T info); + List getDataProvider(T info); } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseContainer.java index 90101ab..e699c5c 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseContainer.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseContainer.java @@ -9,26 +9,26 @@ import ru.serce.jnrfuse.struct.FuseFileInfo; /** * Simplified version of the FuseFS interface. - * - * @author Maschell * + * @author Maschell */ public interface FuseContainer extends FuseDirectory { /** * Wrapper for the getattr function of the FuseFS interface. * When this function is called, the path will be relative to this FuseContainer - * + *

* Get file attributes. *

* Similar to stat(). The 'st_dev' and 'st_blksize' fields are * ignored. The 'st_ino' field is ignored except if the 'use_ino' * mount option is given. */ - public int getattr(String path, FileStat stat); + int getattr(String path, FileStat stat); + /** * Wrapper for the getattr function of the FuseFS interface. * When this function is called, the path will be relative to this FuseContainer - * + *

* File open operation *

* No creation (O_CREAT, O_EXCL) and by default also no @@ -46,12 +46,12 @@ public interface FuseContainer extends FuseDirectory { * * @see jnr.constants.platform.OpenFlags */ - public int open(String path, FuseFileInfo fi); + int open(String path, FuseFileInfo fi); /** * Wrapper for the readdir function of the FuseFS interface. * When this function is called, the path will be relative to this FuseContainer - * + *

* Read directory *

* This supersedes the old getdir() interface. New applications @@ -71,12 +71,12 @@ public interface FuseContainer extends FuseDirectory { * is full (or an error happens) the filler function will return * '1'. */ - public int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi); + int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi); /** * Wrapper for the getattr function of the FuseFS interface. * When this function is called, the path will be relative to this FuseContainer - * + *

* Read data from an open file *

* Read should return exactly the number of bytes requested except @@ -86,17 +86,17 @@ public interface FuseContainer extends FuseDirectory { * value of the read system call will reflect the return value of * this operation. */ - public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi); + int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi); /** * This function will be called when ever the FuseContainer needs to update it's children. */ - public void init(); + void init(); /** * This function will be called right before this FuseContainer won't be used anymore. */ - public void deinit(); + void deinit(); + - } diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseDirectory.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseDirectory.java index 5276874..2448235 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseDirectory.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/interfaces/FuseDirectory.java @@ -4,16 +4,15 @@ import java.util.Optional; /** * Representation of a directory. - * - * @author Maschell * + * @author Maschell */ public interface FuseDirectory { /** * Returns the parent of this FuseDirectory. - * + * * @return parent */ - public Optional getParent(); + Optional getParent(); } 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 58c8a59..8223efe 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 @@ -1,18 +1,6 @@ package de.mas.wiiu.jnus.fuse_wiiu.utils; -import java.io.File; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import de.mas.wiiu.jnus.fuse_wiiu.implementation.FSFuseContainer; -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.*; import de.mas.wiiu.jnus.fuse_wiiu.implementation.loader.WUDFSTDataProviderLoader; import de.mas.wiiu.jnus.fuse_wiiu.implementation.loader.WumadFSTDataProviderLoader; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; @@ -20,6 +8,11 @@ import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.implementations.wud.reader.WUDDiscReaderSplitted; import de.mas.wiiu.jnus.utils.Utils; +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + public class FuseContainerWrapper { private final static String prefix = "[EMULATED] "; @@ -45,19 +38,19 @@ public class FuseContainerWrapper { return result; } } - - if (c.exists() && c.getName().endsWith(".woomy")) { + + if (c.exists() && c.getName().endsWith(".woomy")) { result.put(prefix + c.getName(), new WoomyNUSTitleContainer(parent, c)); return result; } - + if (c.exists() && c.getName().endsWith(".wumad")) { result.put(prefix + c.getName(), new MultipleFSTDataProviderFuseContainer<>(parent, c, WumadFSTDataProviderLoader.getInstance())); result.put(prefix + "[EXTRA] " + c.getName(), new MultipleFSTDataProviderRecursiveFuseContainer<>(parent, c, WumadFSTDataProviderLoader.getInstance())); - + return result; } - + if (checkWUD(result, parent, c)) { return result; } 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 4b29cd6..d9083ed 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 @@ -1,13 +1,13 @@ package de.mas.wiiu.jnus.fuse_wiiu.utils; +import de.mas.wiiu.jnus.entities.Ticket; +import de.mas.wiiu.jnus.utils.FileUtils; + import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.Optional; -import de.mas.wiiu.jnus.entities.Ticket; -import de.mas.wiiu.jnus.utils.FileUtils; - public class TicketUtils { public static Optional getTicket(File folder, File keyFolder, long titleID, byte[] commonKey) { File ticketFile = null; 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 2d1fe93..70d371d 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 @@ -1,16 +1,15 @@ package de.mas.wiiu.jnus.fuse_wiiu.utils; +import de.mas.wiiu.jnus.WUDLoader; +import de.mas.wiiu.jnus.fuse_wiiu.Settings; +import de.mas.wiiu.jnus.implementations.wud.WiiUDisc; +import org.apache.commons.io.FilenameUtils; + import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Optional; -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.WiiUDisc; - public class WUDUtils { public static Optional loadWUDInfo(File file) { String FSfilename = file.getName();