mirror of
https://github.com/Maschell/fuse-wiiu.git
synced 2024-11-22 06:39:14 +01:00
Formatting, optimize imports
This commit is contained in:
parent
2793c02246
commit
a3f9dcb648
@ -1,5 +1,13 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu;
|
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.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
@ -9,20 +17,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Optional;
|
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 {
|
public class Main {
|
||||||
private static final String DEV_COMMON_KEY = "devcommon.key";
|
private static final String DEV_COMMON_KEY = "devcommon.key";
|
||||||
private static final String COMMON_KEY = "common.key";
|
private static final String COMMON_KEY = "common.key";
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu;
|
package de.mas.wiiu.jnus.fuse_wiiu;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import de.mas.wiiu.jnus.utils.Utils;
|
import de.mas.wiiu.jnus.utils.Utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class Settings {
|
public class Settings {
|
||||||
public static File disckeyPath = null;
|
|
||||||
public static final byte[] retailCommonKeyHash = Utils.StringToByteArray("6A0B87FC98B306AE3366F0E0A88D0B06A2813313");
|
public static final byte[] retailCommonKeyHash = Utils.StringToByteArray("6A0B87FC98B306AE3366F0E0A88D0B06A2813313");
|
||||||
public static final byte[] devCommonKeyHash = Utils.StringToByteArray("E191BFDB1232537D7DADEAD81F2A48FD6F188E02");
|
public static final byte[] devCommonKeyHash = Utils.StringToByteArray("E191BFDB1232537D7DADEAD81F2A48FD6F188E02");
|
||||||
|
public static File disckeyPath = null;
|
||||||
public static File titlekeyPath = null;
|
public static File titlekeyPath = null;
|
||||||
public static byte[] retailCommonKey = new byte[16];
|
public static byte[] retailCommonKey = new byte[16];
|
||||||
public static byte[] devCommonKey = new byte[16];
|
public static byte[] devCommonKey = new byte[16];
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.FuseContainer;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.utils.FuseContainerWrapper;
|
import de.mas.wiiu.jnus.fuse_wiiu.utils.FuseContainerWrapper;
|
||||||
import lombok.val;
|
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.
|
* Representation of a directory on the OS filesystem. For every children of this directory the FuseContainerWrapper is used to create children if needed.
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.DirectoryEntry;
|
||||||
import de.mas.wiiu.jnus.entities.FST.nodeentry.FileEntry;
|
import de.mas.wiiu.jnus.entities.FST.nodeentry.FileEntry;
|
||||||
import de.mas.wiiu.jnus.entities.FST.nodeentry.NodeEntry;
|
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.FileStat;
|
||||||
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FuseContainer implementation based on a FSTDataProvider.
|
* FuseContainer implementation based on a FSTDataProvider.
|
||||||
*
|
*
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.FuseContainer;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
import jnr.ffi.Pointer;
|
import jnr.ffi.Pointer;
|
||||||
@ -17,11 +10,17 @@ import ru.serce.jnrfuse.FuseFillDir;
|
|||||||
import ru.serce.jnrfuse.struct.FileStat;
|
import ru.serce.jnrfuse.struct.FileStat;
|
||||||
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
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.
|
* Implementation of an FuseContainer which can hold serveral FuseContainers emulated as directories.
|
||||||
*
|
*
|
||||||
* @author Maschell
|
* @author Maschell
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class GroupFuseContainer implements FuseContainer {
|
public abstract class GroupFuseContainer implements FuseContainer {
|
||||||
private final Map<String, FuseContainer> containerMap = new HashMap<>();
|
private final Map<String, FuseContainer> containerMap = new HashMap<>();
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default GroupFuseContainer implementation
|
* Default GroupFuseContainer implementation
|
||||||
* @author Maschell
|
|
||||||
*
|
*
|
||||||
|
* @author Maschell
|
||||||
*/
|
*/
|
||||||
public class GroupFuseContainerDefault extends GroupFuseContainer {
|
public class GroupFuseContainerDefault extends GroupFuseContainer {
|
||||||
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.NUSTitle;
|
||||||
import de.mas.wiiu.jnus.NUSTitleLoaderLocalBackup;
|
import de.mas.wiiu.jnus.NUSTitleLoaderLocalBackup;
|
||||||
import de.mas.wiiu.jnus.entities.Ticket;
|
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.implementations.FSTDataProviderNUSTitle;
|
||||||
import de.mas.wiiu.jnus.utils.Utils;
|
import de.mas.wiiu.jnus.utils.Utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class LocalBackupNUSTitleContainer extends GroupFuseContainer {
|
public class LocalBackupNUSTitleContainer extends GroupFuseContainer {
|
||||||
|
|
||||||
private File folder;
|
private File folder;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Optional;
|
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 {
|
public class LocalNUSTitleContainer extends GroupFuseContainer {
|
||||||
|
|
||||||
private File folder;
|
private File folder;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.FSTDataProviderLoader;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class MultipleFSTDataProviderFuseContainer<T> extends GroupFuseContainer {
|
public class MultipleFSTDataProviderFuseContainer<T> extends GroupFuseContainer {
|
||||||
private final File file;
|
private final File file;
|
||||||
private final FSTDataProviderLoader<T> loader;
|
private final FSTDataProviderLoader<T> loader;
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.NUSTitleLoaderFST;
|
||||||
import de.mas.wiiu.jnus.entities.FST.nodeentry.DirectoryEntry;
|
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.FileEntry;
|
||||||
@ -17,6 +11,12 @@ import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
|||||||
import de.mas.wiiu.jnus.interfaces.HasNUSTitle;
|
import de.mas.wiiu.jnus.interfaces.HasNUSTitle;
|
||||||
import de.mas.wiiu.jnus.utils.FSTUtils;
|
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<T> extends MultipleFSTDataProviderFuseContainer<T> {
|
public class MultipleFSTDataProviderRecursiveFuseContainer<T> extends MultipleFSTDataProviderFuseContainer<T> {
|
||||||
public MultipleFSTDataProviderRecursiveFuseContainer(Optional<FuseDirectory> parent, File input, FSTDataProviderLoader<T> loader) {
|
public MultipleFSTDataProviderRecursiveFuseContainer(Optional<FuseDirectory> parent, File input, FSTDataProviderLoader<T> loader) {
|
||||||
super(parent, input, loader);
|
super(parent, input, loader);
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.NUSTitle;
|
||||||
import de.mas.wiiu.jnus.entities.TMD.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.FuseContainer;
|
||||||
@ -16,6 +10,12 @@ import ru.serce.jnrfuse.FuseFillDir;
|
|||||||
import ru.serce.jnrfuse.struct.FileStat;
|
import ru.serce.jnrfuse.struct.FileStat;
|
||||||
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
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 {
|
public class NUSTitleEncryptedFuseContainer implements FuseContainer {
|
||||||
private final Optional<FuseDirectory> parent;
|
private final Optional<FuseDirectory> parent;
|
||||||
private final NUSTitle title;
|
private final NUSTitle title;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.NUSTitle;
|
||||||
import de.mas.wiiu.jnus.NUSTitleLoaderRemoteLocal;
|
import de.mas.wiiu.jnus.NUSTitleLoaderRemoteLocal;
|
||||||
import de.mas.wiiu.jnus.entities.Ticket;
|
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.implementations.FSTDataProviderNUSTitle;
|
||||||
import de.mas.wiiu.jnus.utils.Utils;
|
import de.mas.wiiu.jnus.utils.Utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class RemoteLocalBackupNUSTitleContainer extends GroupFuseContainer {
|
public class RemoteLocalBackupNUSTitleContainer extends GroupFuseContainer {
|
||||||
|
|
||||||
private File folder;
|
private File folder;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.FuseContainer;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.utils.WUDUtils;
|
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.FileStat;
|
||||||
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
import ru.serce.jnrfuse.struct.FuseFileInfo;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class WUDToWUDContainer implements FuseContainer {
|
public class WUDToWUDContainer implements FuseContainer {
|
||||||
private final String filename;
|
private final String filename;
|
||||||
private final Optional<WiiUDisc> wudInfo;
|
private final Optional<WiiUDisc> wudInfo;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation;
|
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.NUSTitleLoaderWoomy;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory;
|
||||||
import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle;
|
import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class WoomyNUSTitleContainer extends GroupFuseContainer {
|
public class WoomyNUSTitleContainer extends GroupFuseContainer {
|
||||||
private final File file;
|
private final File file;
|
||||||
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation.loader;
|
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.WUDLoader;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.Settings;
|
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.FSTDataProviderLoader;
|
||||||
@ -15,9 +8,16 @@ import de.mas.wiiu.jnus.implementations.wud.WiiUDisc;
|
|||||||
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
||||||
import lombok.Getter;
|
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<WiiUDisc> {
|
public class WUDFSTDataProviderLoader implements FSTDataProviderLoader<WiiUDisc> {
|
||||||
@Getter
|
@Getter
|
||||||
private static WUDFSTDataProviderLoader instance = new WUDFSTDataProviderLoader();
|
private static final WUDFSTDataProviderLoader instance = new WUDFSTDataProviderLoader();
|
||||||
|
|
||||||
private WUDFSTDataProviderLoader() {
|
private WUDFSTDataProviderLoader() {
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.implementation.loader;
|
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.WumadLoader;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.Settings;
|
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.FSTDataProviderLoader;
|
||||||
@ -14,9 +7,16 @@ import de.mas.wiiu.jnus.implementations.wud.wumad.WumadInfo;
|
|||||||
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
||||||
import lombok.Getter;
|
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<WumadInfo> {
|
public class WumadFSTDataProviderLoader implements FSTDataProviderLoader<WumadInfo> {
|
||||||
@Getter
|
@Getter
|
||||||
private static WumadFSTDataProviderLoader instance = new WumadFSTDataProviderLoader();
|
private static final WumadFSTDataProviderLoader instance = new WumadFSTDataProviderLoader();
|
||||||
|
|
||||||
private WumadFSTDataProviderLoader() {
|
private WumadFSTDataProviderLoader() {
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.interfaces;
|
package de.mas.wiiu.jnus.fuse_wiiu.interfaces;
|
||||||
|
|
||||||
|
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import de.mas.wiiu.jnus.interfaces.FSTDataProvider;
|
|
||||||
|
|
||||||
public interface FSTDataProviderLoader<T> {
|
public interface FSTDataProviderLoader<T> {
|
||||||
public Optional<T> loadInfo(File input);
|
Optional<T> loadInfo(File input);
|
||||||
|
|
||||||
public List<FSTDataProvider> getDataProvider(T info);
|
List<FSTDataProvider> getDataProvider(T info);
|
||||||
}
|
}
|
||||||
|
@ -11,24 +11,24 @@ import ru.serce.jnrfuse.struct.FuseFileInfo;
|
|||||||
* Simplified version of the FuseFS interface.
|
* Simplified version of the FuseFS interface.
|
||||||
*
|
*
|
||||||
* @author Maschell
|
* @author Maschell
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface FuseContainer extends FuseDirectory {
|
public interface FuseContainer extends FuseDirectory {
|
||||||
/**
|
/**
|
||||||
* Wrapper for the getattr function of the FuseFS interface.
|
* Wrapper for the getattr function of the FuseFS interface.
|
||||||
* When this function is called, the path will be relative to this FuseContainer
|
* When this function is called, the path will be relative to this FuseContainer
|
||||||
*
|
* <p>
|
||||||
* Get file attributes.
|
* Get file attributes.
|
||||||
* <p>
|
* <p>
|
||||||
* Similar to stat(). The 'st_dev' and 'st_blksize' fields are
|
* Similar to stat(). The 'st_dev' and 'st_blksize' fields are
|
||||||
* ignored. The 'st_ino' field is ignored except if the 'use_ino'
|
* ignored. The 'st_ino' field is ignored except if the 'use_ino'
|
||||||
* mount option is given.
|
* 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.
|
* Wrapper for the getattr function of the FuseFS interface.
|
||||||
* When this function is called, the path will be relative to this FuseContainer
|
* When this function is called, the path will be relative to this FuseContainer
|
||||||
*
|
* <p>
|
||||||
* File open operation
|
* File open operation
|
||||||
* <p>
|
* <p>
|
||||||
* No creation (O_CREAT, O_EXCL) and by default also no
|
* 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
|
* @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.
|
* Wrapper for the readdir function of the FuseFS interface.
|
||||||
* When this function is called, the path will be relative to this FuseContainer
|
* When this function is called, the path will be relative to this FuseContainer
|
||||||
*
|
* <p>
|
||||||
* Read directory
|
* Read directory
|
||||||
* <p>
|
* <p>
|
||||||
* This supersedes the old getdir() interface. New applications
|
* 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
|
* is full (or an error happens) the filler function will return
|
||||||
* '1'.
|
* '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.
|
* Wrapper for the getattr function of the FuseFS interface.
|
||||||
* When this function is called, the path will be relative to this FuseContainer
|
* When this function is called, the path will be relative to this FuseContainer
|
||||||
*
|
* <p>
|
||||||
* Read data from an open file
|
* Read data from an open file
|
||||||
* <p>
|
* <p>
|
||||||
* Read should return exactly the number of bytes requested except
|
* 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
|
* value of the read system call will reflect the return value of
|
||||||
* this operation.
|
* 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.
|
* 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.
|
* This function will be called right before this FuseContainer won't be used anymore.
|
||||||
*/
|
*/
|
||||||
public void deinit();
|
void deinit();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import java.util.Optional;
|
|||||||
* Representation of a directory.
|
* Representation of a directory.
|
||||||
*
|
*
|
||||||
* @author Maschell
|
* @author Maschell
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface FuseDirectory {
|
public interface FuseDirectory {
|
||||||
|
|
||||||
@ -15,5 +14,5 @@ public interface FuseDirectory {
|
|||||||
*
|
*
|
||||||
* @return parent
|
* @return parent
|
||||||
*/
|
*/
|
||||||
public Optional<FuseDirectory> getParent();
|
Optional<FuseDirectory> getParent();
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,6 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.utils;
|
package de.mas.wiiu.jnus.fuse_wiiu.utils;
|
||||||
|
|
||||||
import java.io.File;
|
import de.mas.wiiu.jnus.fuse_wiiu.implementation.*;
|
||||||
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.loader.WUDFSTDataProviderLoader;
|
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.implementation.loader.WumadFSTDataProviderLoader;
|
||||||
import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer;
|
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.implementations.wud.reader.WUDDiscReaderSplitted;
|
||||||
import de.mas.wiiu.jnus.utils.Utils;
|
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 {
|
public class FuseContainerWrapper {
|
||||||
|
|
||||||
private final static String prefix = "[EMULATED] ";
|
private final static String prefix = "[EMULATED] ";
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.utils;
|
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.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import de.mas.wiiu.jnus.entities.Ticket;
|
|
||||||
import de.mas.wiiu.jnus.utils.FileUtils;
|
|
||||||
|
|
||||||
public class TicketUtils {
|
public class TicketUtils {
|
||||||
public static Optional<Ticket> getTicket(File folder, File keyFolder, long titleID, byte[] commonKey) {
|
public static Optional<Ticket> getTicket(File folder, File keyFolder, long titleID, byte[] commonKey) {
|
||||||
File ticketFile = null;
|
File ticketFile = null;
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
package de.mas.wiiu.jnus.fuse_wiiu.utils;
|
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.File;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Optional;
|
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 class WUDUtils {
|
||||||
public static Optional<WiiUDisc> loadWUDInfo(File file) {
|
public static Optional<WiiUDisc> loadWUDInfo(File file) {
|
||||||
String FSfilename = file.getName();
|
String FSfilename = file.getName();
|
||||||
|
Loading…
Reference in New Issue
Block a user