Skip to content

Commit 5838fe3

Browse files
committed
Fix #64, fix #50
1 parent dfa29ae commit 5838fe3

File tree

10 files changed

+330
-41
lines changed

10 files changed

+330
-41
lines changed

README.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ With GUI and cookies. Works on Windows, macOS and Linux.
1717

1818
Sometimes I add new posts about this project [on my home page](https://developersu.blogspot.com/search/label/NS-USBloader).
1919

20-
![Application screenshot](https://live.staticflickr.com/65535/49513701961_2b41747a9f_o.png)
21-
<img src="https://live.staticflickr.com/65535/49513701841_e09c86b944_o.png" alt="screenshot" width="250"/> <img src="https://live.staticflickr.com/65535/49513701896_c4d0a905c0_o.png" alt="screenshot" width="250"/>
22-
<img src="https://live.staticflickr.com/65535/49513184138_688ee551f8_o.png" alt="screenshot" width="250"/> <img src="https://live.staticflickr.com/65535/49513924407_212988e0e9_o.png" alt="screenshot" width="250"/>
20+
![Application screenshot](screenshots/1.png)
21+
<img src="screenshots/2.png" alt="screenshot" width="250"/> <img src="screenshots/3.png" alt="screenshot" width="250"/>
22+
<img src="screenshots/4.png" alt="screenshot" width="250"/> <img src="screenshots/5.png" alt="screenshot" width="250"/>
2323

2424
#### License
2525

@@ -49,7 +49,7 @@ Sometimes I add new posts about this project [on my home page](https://developer
4949

5050
### System requirements
5151

52-
JRE/JDK 8u60 or higher.
52+
JRE/JDK 8u60 or higher
5353

5454
### Supported GoldLeaf versions
5555
| 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.
114114

115115
There are three tabs. First one is main.
116116

117-
##### 'List' tab.
117+
##### 'Gamepad' tab.
118118

119119
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).
120120

@@ -151,29 +151,57 @@ Also here you can:
151151
That's where all logs dropped. Verbose information about transmissions comes here.
152152

153153

154-
155154
##### CLI (command line interface)
156155

156+
To get help run ``$ java -jar ns-usbloader-4.0.jar --help``
157+
157158
```
158-
-c, --clean Remove/reset settings and exit
159-
-v, --version Show application version
160-
-h, --help Shows this message
159+
-c,--clean Remove/reset settings and exit
160+
-g,--goldleaf <...> Install via GoldLeaf mode. Check '-g help' for information.
161+
-h,--help Show this help
162+
-m,--merge <...> Merge files. Check '-m help' for information.
163+
-n,--tfn <...> Install via Tinfoil/Awoo Network mode. Check '-n help' for information.
164+
-r,--rcm <[PATH/]payload.bin> Send payload
165+
-s,--split <...> Split files. Check '-s help' for information.
166+
-t,--tinfoil <FILE...> Install via Tinfoil/Awoo USB mode.
167+
-v,--version Show application version
161168
```
162169

163-
### Known bugs
164-
* 'NET' once started it never ends:
170+
For more complex commands help use help argument after the fists key. For example:
165171

166-
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.
172+
```
173+
$ java -jar ns-usbloader-4.0.jar -n help
167174
168-
* Unable to interrupt transmission when network transmission started and nothing received from NS.
175+
Usage:
176+
ns-usbloader -n nsip=<arg1> [hostip=<arg2>] FILE1 ...
177+
ns-usbloader --tfn nsip=<arg1> [hostip=<arg2>] FILE1 ...
178+
179+
Options:
180+
nsip=<ip> Define NS IP address (mandatory)
181+
hostip=<ip[:port]> Define this host IP address. Will be obtained automatically if not set.
182+
```
183+
184+
Usage examples:
185+
186+
```
187+
Send RCM payload:
188+
$ java -jar ns-usbloader-4.0.jar -r C:\Users\Superhero\hekate.bin
189+
Send files to Awoo Installer via Net-install:
190+
$ java -jar ns-usbloader-4.0.jar -n nsip=192.168.0.1 ./file.nsz ./file.nsp ~/*.xci
191+
Send files to GoldLeaf v0.8:
192+
$ java -jar ns-usbloader-4.0.jar -g ver=v0.8 ./*
193+
Split files:
194+
$ java -jar ns-usbloader-4.0.jar -s /tmp/ ~/*.nsp
195+
Merge files:
196+
$ java -jar ns-usbloader-4.0.jar -m /tmp/ ~/*.nsp
197+
```
169198

170199
### Other notes
171-
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.
172200

173201
'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.
174202
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.
175203

176-
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.
204+
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.
177205

178206
### Translators!
179207
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
184212

185213
#### TODO (maybe):
186214
- [x] [Android support](https://github.com/developersu/ns-usbloader-mobile)
187-
- [ ] File order sort (non-critical)
188-
- [ ] More deep file analyze before uploading.
189215

190216
## Support this app
191217

screenshots/1.png

51.2 KB
Loading

screenshots/2.png

42 KB
Loading

screenshots/3.png

31.2 KB
Loading

screenshots/4.png

34.5 KB
Loading

screenshots/5.png

48.3 KB
Loading

screenshots/ApplicationLogo.svg

Lines changed: 258 additions & 0 deletions
Loading

src/main/java/nsusbloader/Utilities/nxdumptool/NxdtUsbAbi1.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,8 @@ private void dumpFileOnWindowsTen(File file, long size) throws Exception{
285285

286286
while (received < size){
287287
readBuffer = readUsbFile();
288-
289288
bos.write(readBuffer);
290289
fd.sync(); // Fixes flushing under Windows (unharmful for other OS)
291-
292290
bufferSize = readBuffer.length;
293291
received += bufferSize;
294292

src/main/java/nsusbloader/cli/CommandLineInterface.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
package nsusbloader.cli;
2020

2121
import nsusbloader.NSLMain;
22-
import nsusbloader.Utilities.Rcm;
2322
import org.apache.commons.cli.*;
2423

25-
import java.io.File;
26-
2724
import java.util.prefs.Preferences;
2825

2926
public class CommandLineInterface {
@@ -49,7 +46,7 @@ public CommandLineInterface(String[] args) {
4946
}
5047
if (cli.hasOption('r') || cli.hasOption("rcm")){
5148
final String payloadArgument = cli.getOptionValue("rcm");
52-
handleRcm(payloadArgument);
49+
new RcmCli(payloadArgument);
5350
return;
5451
}
5552
if (cli.hasOption("c") || cli.hasOption("clean")){
@@ -78,7 +75,6 @@ public CommandLineInterface(String[] args) {
7875
return;
7976
}
8077
*/
81-
8278
if (cli.hasOption("s") || cli.hasOption("split")){
8379
final String[] arguments = cli.getOptionValues("split");
8480
new Split(arguments);
@@ -208,23 +204,6 @@ private void handleSettingClean() throws Exception {
208204
else
209205
System.out.println("There are no settings in system to remove");
210206
}
211-
private void handleRcm(String payload) throws InterruptedException{
212-
boolean isWindows = System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows");
213-
214-
if (isWindows) {
215-
if (! payload.matches("^.:\\\\.*$"))
216-
payload = System.getProperty("user.dir") + File.separator + payload;
217-
}
218-
else {
219-
if (! payload.startsWith("/"))
220-
payload = System.getProperty("user.dir") + File.separator + payload;
221-
}
222-
223-
Rcm rcm = new Rcm(payload);
224-
Thread rcmThread = new Thread(rcm);
225-
rcmThread.start();
226-
rcmThread.join();
227-
}
228207
private void handleHelp(Options cliOptions){
229208
new HelpFormatter().printHelp(
230209
120,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package nsusbloader.cli;
2+
3+
import java.io.File;
4+
5+
public class RcmCli {
6+
RcmCli(String argument) throws InterruptedException, IncorrectSetupException{
7+
runBackend(argument);
8+
}
9+
10+
private void runBackend(String payload) throws InterruptedException{
11+
/*
12+
boolean isWindows = System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows");
13+
14+
if (isWindows) {
15+
if (! payload.matches("^.:\\\\.*$"))
16+
payload = System.getProperty("user.dir") + File.separator + payload;
17+
}
18+
else {
19+
if (! payload.startsWith("/"))
20+
payload = System.getProperty("user.dir") + File.separator + payload;
21+
}
22+
*/
23+
nsusbloader.Utilities.Rcm rcm = new nsusbloader.Utilities.Rcm(payload);
24+
Thread rcmThread = new Thread(rcm);
25+
rcmThread.start();
26+
rcmThread.join();
27+
}
28+
}

0 commit comments

Comments
 (0)