mirror of
https://github.com/Maschell/fuse-wiiu.git
synced 2024-11-22 06:39:14 +01:00
Fix bugs in TicketUtils class
This commit is contained in:
parent
962ebf68a9
commit
f3a1457518
@ -10,8 +10,10 @@ 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 = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "title.tik");
|
File ticketFile = null;
|
||||||
|
if (folder != null) {
|
||||||
|
ticketFile = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "title.tik");
|
||||||
|
}
|
||||||
Ticket ticket = null;
|
Ticket ticket = null;
|
||||||
if (ticketFile != null && ticketFile.exists()) {
|
if (ticketFile != null && ticketFile.exists()) {
|
||||||
try {
|
try {
|
||||||
@ -19,9 +21,10 @@ public class TicketUtils {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticket == null && keyFolder != null) {
|
if (ticket == null && keyFolder != null) {
|
||||||
File keyFile = FileUtils.getFileIgnoringFilenameCases(keyFolder.getAbsolutePath(), String.format("%016X", titleID) + ".key");
|
File keyFile = FileUtils.getFileIgnoringFilenameCases(keyFolder.getAbsolutePath(), String.format("%016X", titleID) + ".key");
|
||||||
if (keyFile.exists()) {
|
if (keyFile != null && keyFile.exists()) {
|
||||||
byte[] key;
|
byte[] key;
|
||||||
try {
|
try {
|
||||||
key = Files.readAllBytes(keyFile.toPath());
|
key = Files.readAllBytes(keyFile.toPath());
|
||||||
|
Loading…
Reference in New Issue
Block a user