From c39a5f4c5ba9c6c05875da83c5a84b65b725d268 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Tue, 7 Feb 2023 00:05:13 +0300 Subject: [PATCH] Correct Java 8 related things --- .../java/nsusbloader/Utilities/patches/es/EsPatch.java | 3 ++- .../java/nsusbloader/Utilities/patches/fs/FsPatch.java | 10 +++++++++- .../Utilities/patches/loader/LoaderPatch.java | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/nsusbloader/Utilities/patches/es/EsPatch.java b/src/main/java/nsusbloader/Utilities/patches/es/EsPatch.java index 71d53bd..0a6b426 100644 --- a/src/main/java/nsusbloader/Utilities/patches/es/EsPatch.java +++ b/src/main/java/nsusbloader/Utilities/patches/es/EsPatch.java @@ -32,6 +32,7 @@ import nsusbloader.Utilities.patches.es.finders.HeuristicEsWizard; import java.io.BufferedOutputStream; import java.io.File; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; @@ -118,7 +119,7 @@ public class EsPatch { handyEsPatch.put(FOOTER); byte[] esPatch = new byte[handyEsPatch.position()]; - handyEsPatch.rewind(); + ((Buffer) handyEsPatch).rewind(); handyEsPatch.get(esPatch); try (BufferedOutputStream stream = new BufferedOutputStream( diff --git a/src/main/java/nsusbloader/Utilities/patches/fs/FsPatch.java b/src/main/java/nsusbloader/Utilities/patches/fs/FsPatch.java index 7849f50..0e49699 100644 --- a/src/main/java/nsusbloader/Utilities/patches/fs/FsPatch.java +++ b/src/main/java/nsusbloader/Utilities/patches/fs/FsPatch.java @@ -35,6 +35,7 @@ import nsusbloader.Utilities.patches.BinToAsmPrinter; import nsusbloader.Utilities.patches.fs.finders.HeuristicFsWizard; import java.io.*; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; @@ -87,6 +88,13 @@ public class FsPatch { logPrinter.print(" == Debug information ==\n"+wizard.getDebug(), EMsgType.NULL); } private KIP1Provider getKIP1Provider() throws Exception{ + System.out.println("ncaProvider "+ncaProvider); + System.out.println("CONTENT "+ncaProvider.getNCAContentProvider(0)); + System.out.println("CONTENT "+ncaProvider.getNCAContentProvider(1)); + System.out.println("CONTENT "+ncaProvider.getNCAContentProvider(2)); + System.out.println("CONTENT "+ncaProvider.getNCAContentProvider(3)); + + RomFsProvider romFsProvider = ncaProvider.getNCAContentProvider(0).getRomfs(); FileSystemEntry package2FsEntry = romFsProvider.getRootEntry().getContent() @@ -175,7 +183,7 @@ public class FsPatch { handyFsPatch.put(FOOTER); byte[] fsPatch = new byte[handyFsPatch.position()]; - handyFsPatch.rewind(); + ((Buffer) handyFsPatch).rewind(); handyFsPatch.get(fsPatch); try (BufferedOutputStream stream = new BufferedOutputStream( diff --git a/src/main/java/nsusbloader/Utilities/patches/loader/LoaderPatch.java b/src/main/java/nsusbloader/Utilities/patches/loader/LoaderPatch.java index ad25afd..bd9b03b 100644 --- a/src/main/java/nsusbloader/Utilities/patches/loader/LoaderPatch.java +++ b/src/main/java/nsusbloader/Utilities/patches/loader/LoaderPatch.java @@ -30,6 +30,7 @@ import nsusbloader.Utilities.patches.SimplyFind; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; @@ -110,7 +111,7 @@ public class LoaderPatch { private void writeFile() throws Exception{ String patchFileLocation = saveToLocation + File.separator + - "atmosphere" + File.separator + "kip_patches" + File.separator + "fs_patches" + File.separator + patchName; + "atmosphere" + File.separator + "kip_patches" + File.separator + "loader_patches" + File.separator + patchName; ByteBuffer handyFsPatch = ByteBuffer.allocate(0x100).order(ByteOrder.LITTLE_ENDIAN); handyFsPatch.put(HEADER); @@ -118,7 +119,7 @@ public class LoaderPatch { handyFsPatch.put(FOOTER); byte[] fsPatch = new byte[handyFsPatch.position()]; - handyFsPatch.rewind(); + ((Buffer) handyFsPatch).rewind(); handyFsPatch.get(fsPatch); try (BufferedOutputStream stream = new BufferedOutputStream(