diff --git a/README.md b/README.md index 77d8eca..e0f62b0 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ With GUI and cookies. Works on Windows, macOS and Linux. Sometimes I add new posts about this project [on my home page](https://developersu.blogspot.com/search/label/NS-USBloader). -![Application screenshot](https://live.staticflickr.com/65535/49513701961_2b41747a9f_o.png) -screenshot screenshot -screenshot screenshot +![Application screenshot](screenshots/1.png) +screenshot screenshot +screenshot screenshot #### License @@ -49,7 +49,7 @@ Sometimes I add new posts about this project [on my home page](https://developer ### System requirements -JRE/JDK 8u60 or higher. +JRE/JDK 8u60 or higher ### Supported GoldLeaf versions | GoldLeaf version | NS-USBloader version | @@ -114,7 +114,7 @@ Take a look on app, find where is the option to install from USB and/or Network. There are three tabs. First one is main. -##### 'List' tab. +##### 'Gamepad' tab. At the top of you selecting from drop-down application and protocol that you're going to use. For GoldLeaf only USB is available. Lamp icon stands for switching themes (light or dark). @@ -151,29 +151,57 @@ Also here you can: That's where all logs dropped. Verbose information about transmissions comes here. - ##### CLI (command line interface) +To get help run ``$ java -jar ns-usbloader-4.0.jar --help`` + ``` --c, --clean Remove/reset settings and exit --v, --version Show application version --h, --help Shows this message + -c,--clean Remove/reset settings and exit + -g,--goldleaf <...> Install via GoldLeaf mode. Check '-g help' for information. + -h,--help Show this help + -m,--merge <...> Merge files. Check '-m help' for information. + -n,--tfn <...> Install via Tinfoil/Awoo Network mode. Check '-n help' for information. + -r,--rcm <[PATH/]payload.bin> Send payload + -s,--split <...> Split files. Check '-s help' for information. + -t,--tinfoil Install via Tinfoil/Awoo USB mode. + -v,--version Show application version ``` -### Known bugs -* 'NET' once started it never ends: +For more complex commands help use help argument after the fists key. For example: -It happens because there is HTTP server inside of application. It can't determine the moment when all transmissions finishes (unless they failed). So you have to look on your NS screen and 'Interrupt' it once done. +``` +$ java -jar ns-usbloader-4.0.jar -n help -* Unable to interrupt transmission when network transmission started and nothing received from NS. +Usage: + ns-usbloader -n nsip= [hostip=] FILE1 ... + ns-usbloader --tfn nsip= [hostip=] FILE1 ... + +Options: + nsip= Define NS IP address (mandatory) + hostip= Define this host IP address. Will be obtained automatically if not set. +``` + +Usage examples: + +``` +Send RCM payload: +$ java -jar ns-usbloader-4.0.jar -r C:\Users\Superhero\hekate.bin +Send files to Awoo Installer via Net-install: +$ java -jar ns-usbloader-4.0.jar -n nsip=192.168.0.1 ./file.nsz ./file.nsp ~/*.xci +Send files to GoldLeaf v0.8: +$ java -jar ns-usbloader-4.0.jar -g ver=v0.8 ./* +Split files: +$ java -jar ns-usbloader-4.0.jar -s /tmp/ ~/*.nsp +Merge files: +$ java -jar ns-usbloader-4.0.jar -m /tmp/ ~/*.nsp +``` ### Other notes -Alternative build for Windows 10 is recommended for all Windows 10 users. It also works well on Linux and any other Windows PC and even on macOS Mojave, but doesn't work on all previous versions of macOS. 'Status' = 'Uploaded' that appears in the table does not mean that file has been installed. It means that it has been sent to NS without any issues! That's what this app about. Handling successful/failed installation is a purpose of the other side application: TinFoil or GoldLeaf. And they don't provide any feedback interfaces so I can't detect success/failure. -usb4java since NS-USBloader-v0.2.3 switched to 1.2.0 instead of 1.3.0. This should not impact anyone except users of macOS High Sierra (and Sierra, and El Capitan) where previous versions of NS-USBloader didn't work. +usb4java since NS-USBloader-v0.2.3 switched to 1.2.0 instead of 1.3.0. This should not impact anyone except users of macOS High Sierra (and Sierra, and El Capitan) where previous versions of NS-USBloader didn't work. Now builds with usb4java-1.2.0 marked as '-legacy' and builds with usb4java-1.3.0 doesn't have postfixes. ### Translators! If you want to see this app translated to your language, go grab [this file](https://github.com/developersu/ns-usbloader/blob/master/src/main/resources/locale.properties) and translate it. @@ -184,8 +212,6 @@ To convert files of any locale to readable format (and vise-versa) you can use t #### TODO (maybe): - [x] [Android support](https://github.com/developersu/ns-usbloader-mobile) -- [ ] File order sort (non-critical) -- [ ] More deep file analyze before uploading. ## Support this app diff --git a/screenshots/1.png b/screenshots/1.png new file mode 100644 index 0000000..dfa03c6 Binary files /dev/null and b/screenshots/1.png differ diff --git a/screenshots/2.png b/screenshots/2.png new file mode 100644 index 0000000..daf33ba Binary files /dev/null and b/screenshots/2.png differ diff --git a/screenshots/3.png b/screenshots/3.png new file mode 100644 index 0000000..a884984 Binary files /dev/null and b/screenshots/3.png differ diff --git a/screenshots/4.png b/screenshots/4.png new file mode 100644 index 0000000..011b544 Binary files /dev/null and b/screenshots/4.png differ diff --git a/screenshots/5.png b/screenshots/5.png new file mode 100644 index 0000000..5b52199 Binary files /dev/null and b/screenshots/5.png differ diff --git a/screenshots/ApplicationLogo.svg b/screenshots/ApplicationLogo.svg new file mode 100644 index 0000000..222de82 --- /dev/null +++ b/screenshots/ApplicationLogo.svg @@ -0,0 +1,258 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + NS-USBloader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dmitry Isaenko + diff --git a/src/main/java/nsusbloader/Utilities/nxdumptool/NxdtUsbAbi1.java b/src/main/java/nsusbloader/Utilities/nxdumptool/NxdtUsbAbi1.java index 95b9e0d..054f03a 100644 --- a/src/main/java/nsusbloader/Utilities/nxdumptool/NxdtUsbAbi1.java +++ b/src/main/java/nsusbloader/Utilities/nxdumptool/NxdtUsbAbi1.java @@ -285,10 +285,8 @@ class NxdtUsbAbi1 { while (received < size){ readBuffer = readUsbFile(); - bos.write(readBuffer); fd.sync(); // Fixes flushing under Windows (unharmful for other OS) - bufferSize = readBuffer.length; received += bufferSize; diff --git a/src/main/java/nsusbloader/cli/CommandLineInterface.java b/src/main/java/nsusbloader/cli/CommandLineInterface.java index 3d41958..0779821 100644 --- a/src/main/java/nsusbloader/cli/CommandLineInterface.java +++ b/src/main/java/nsusbloader/cli/CommandLineInterface.java @@ -19,11 +19,8 @@ package nsusbloader.cli; import nsusbloader.NSLMain; -import nsusbloader.Utilities.Rcm; import org.apache.commons.cli.*; -import java.io.File; - import java.util.prefs.Preferences; public class CommandLineInterface { @@ -49,7 +46,7 @@ public class CommandLineInterface { } if (cli.hasOption('r') || cli.hasOption("rcm")){ final String payloadArgument = cli.getOptionValue("rcm"); - handleRcm(payloadArgument); + new RcmCli(payloadArgument); return; } if (cli.hasOption("c") || cli.hasOption("clean")){ @@ -78,7 +75,6 @@ public class CommandLineInterface { return; } */ - if (cli.hasOption("s") || cli.hasOption("split")){ final String[] arguments = cli.getOptionValues("split"); new Split(arguments); @@ -208,23 +204,6 @@ public class CommandLineInterface { else System.out.println("There are no settings in system to remove"); } - private void handleRcm(String payload) throws InterruptedException{ - boolean isWindows = System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows"); - - if (isWindows) { - if (! payload.matches("^.:\\\\.*$")) - payload = System.getProperty("user.dir") + File.separator + payload; - } - else { - if (! payload.startsWith("/")) - payload = System.getProperty("user.dir") + File.separator + payload; - } - - Rcm rcm = new Rcm(payload); - Thread rcmThread = new Thread(rcm); - rcmThread.start(); - rcmThread.join(); - } private void handleHelp(Options cliOptions){ new HelpFormatter().printHelp( 120, diff --git a/src/main/java/nsusbloader/cli/RcmCli.java b/src/main/java/nsusbloader/cli/RcmCli.java new file mode 100644 index 0000000..a245904 --- /dev/null +++ b/src/main/java/nsusbloader/cli/RcmCli.java @@ -0,0 +1,28 @@ +package nsusbloader.cli; + +import java.io.File; + +public class RcmCli { + RcmCli(String argument) throws InterruptedException, IncorrectSetupException{ + runBackend(argument); + } + + private void runBackend(String payload) throws InterruptedException{ + /* + boolean isWindows = System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows"); + + if (isWindows) { + if (! payload.matches("^.:\\\\.*$")) + payload = System.getProperty("user.dir") + File.separator + payload; + } + else { + if (! payload.startsWith("/")) + payload = System.getProperty("user.dir") + File.separator + payload; + } + */ + nsusbloader.Utilities.Rcm rcm = new nsusbloader.Utilities.Rcm(payload); + Thread rcmThread = new Thread(rcm); + rcmThread.start(); + rcmThread.join(); + } +}