Skip to content

Commit b02bc7e

Browse files
committed
Using idea from #90: Replace 'Tinfoil' by 'Awoo' everywhere on the front end. Also touched translation files (hope didn't broke it, but could be)
Add 'Fusee Geelee' and 'RCM' labels used on 'RCM' tab to 'properties' files in case someone wants to translate it.. I don't think if someone should but there is an option. (note: CLI arguments remains the same while only description updated)
1 parent 86c867a commit b02bc7e

24 files changed

+164
-145
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
[Support author](#support-this-app)
66

77
NS-USBloader is:
8-
* A PC-side installer for **[Adubbz/TinFoil (v0.2.1)](https://github.com/Adubbz/Tinfoil/)**, **[Huntereb/Awoo-Installer](https://github.com/Huntereb/Awoo-Installer)** (USB and Network supported) and **[XorTroll/GoldLeaf](https://github.com/XorTroll/Goldleaf)** (USB) NSP installer.
9-
Replacement for default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**.
8+
* A PC-side installer for **[Huntereb/Awoo-Installer](https://github.com/Huntereb/Awoo-Installer)** / other compatible installers (USB and Network supported) and **[XorTroll/GoldLeaf](https://github.com/XorTroll/Goldleaf)** (USB) NSP installer.
9+
Alternative to default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**.
1010
* This application also could be used as RCM payload on Windows, MacOS and Linux (supported arch: x86, x86_64 and Raspberry Pi).
11-
* And of course it's a tool for split files!
12-
* And also for merging split-files into one :)
11+
* It's a tool for creating split files!
12+
* Also you can use it for merging split-files into one :)
13+
1314

1415
[Click here for Android version ;)](https://github.com/developersu/ns-usbloader-mobile)
1516

@@ -49,6 +50,7 @@ Sometimes I add new posts about this project [on my home page](https://developer
4950
* Czech by [Spenaat](https://github.com/spenaat)
5051
* Chinese (Traditional) by [qazrfv1234](https://github.com/qazrfv1234)
5152
* Arabic by [eslamabdel](https://github.com/eslamabdel)
53+
* Romanian by [Călin Ilie](https://github.com/calini)
5254

5355
### System requirements
5456

@@ -67,11 +69,13 @@ JDK 11 for MacOS and Linux
6769

6870
where '+' means 'any next NS-USBloader version'.
6971

70-
### Awoo Installer support
72+
### Awoo Installer and compatible applications support
73+
74+
Awoo Installer uses the same command-set (or 'protocol') to [Adubbz/Tinfoil](https://github.com/Adubbz/Tinfoil/).
7175

72-
Awoo Installer uses the same command-set (or 'protocol') to TinFoil. So just select 'TinFoil' in case you're going to use Awoo.
76+
A lot of other forks/apps uses the same command-set. To stop speculating about the name it's now called 'Awoo'. It WAS called 'TinFoil' before. Not any more.
7377

74-
Also, please go to 'Settings' tab of NS-USBloader after first installation and check 'Allow XCI / NSZ / XCZ files selection for TinFoil' option. This installer can install not only NSPs but a way more formats!
78+
Also, please go to 'Settings' tab of NS-USBloader after first installation and check 'Allow XCI / NSZ / XCZ files selection for Awoo' option. This installer can install not only NSPs but a way more formats!
7579

7680
### Usage
7781
##### Linux:
@@ -121,9 +125,9 @@ Set 'Security & Privacy' settings if needed.
121125

122126
#### And how to use it?
123127

124-
The first thing you should do it install TinFoil ([Adubbz](https://github.com/Adubbz/Tinfoil/)), GoldLeaf ([XorTroll](https://github.com/XorTroll/Goldleaf)) or Awoo ([Huntereb](https://github.com/Huntereb/Awoo-Installer)) on your NS.
128+
The first thing you should do it install Awoo ([Huntereb](https://github.com/Huntereb/Awoo-Installer)) or GoldLeaf ([XorTroll](https://github.com/XorTroll/Goldleaf)) on your NS.
125129

126-
Take a look on app, find where is the option to install from USB and/or Network. Maybe [this article (about TinFoil)](https://developersu.blogspot.com/2019/02/ns-usbloader-en.html) will be helpful.
130+
Take a look on app, find where is the option to install from USB and/or Network. Maybe (very old) [this article (about TinFoil)](https://developersu.blogspot.com/2019/02/ns-usbloader-en.html) will be helpful.
127131

128132
#### In details
129133

@@ -137,7 +141,7 @@ Then you may drag-n-drop files (split-files aka folders) to application or use '
137141

138142
Table.
139143

140-
There you can select checkbox for files that will be send to application (TF/GL). ~~Since GoldLeaf allow you only one file transmission per time, only one file is available for selection.~~
144+
There you can select checkbox for files that will be sent to application (AW/GL). ~~Since GoldLeaf v0.5 allow you only one file transmission per time, only one file is available for selection.~~
141145

142146
Also you can use space to select/un-select files and 'delete' button for deleting. By right-mouse-click you can see context menu where you can delete one OR all items from the table.
143147

@@ -151,11 +155,11 @@ On this tab you can select payloader like Hekate or LockPick_RCM and send it to
151155

152156
##### 'Folder with arrows and zeroes' tab
153157

154-
On this tab you can split and merge files. Select 'Split' or 'Merge' and split (or merge).
158+
On this tab you can split and merge files. Select 'Split' or 'Merge' and split (or merge). BTW Drag-n-drop supported.
155159

156160
##### 'Gears' tab.
157161

158-
Here you can configure settings for network file transmission. Usually you shouldn't change anything. But it you're cool hacker, go ahead! The most interesting option here is 'Don't serve requests'. Architecture of the TinFoil's NET part is working interesting way. When you select in TF network NSP transfer, application will wait at port 2000 for the information about where should it take files from. Like '192.168.1.5:6060/my file.nsp'. Usually NS-USBloader serves requests by implementing simplified HTTP server and bringing it up and so on. But if this option selected, you can define path to remote location of the files. For example if you set in settings '192.168.4.2:80/ROMS/NS/' and add in table file 'my file.nsp' then NS-USBloader will simply tell TinFoil "Hey, go take files from '192.168.4.2:80/ROMS/NS/my%20file.nsp' ". Of course you have to bring '192.168.4.2' host up and make file accessible from such address (just go install nginx). As I said, this feature is interesting, but I guess won't be popular.
162+
Here you can configure settings for network file transmission. Usually you shouldn't change anything. But it you're cool hacker, go ahead! The most interesting option here is 'Don't serve requests'. Architecture of the Awoo's NET part is working interesting way. When you select in Awoo network NSP transfer, application will wait at port 2000 for the information about where should it take files from. Like '192.168.1.5:6060/my file.nsp'. Usually NS-USBloader serves requests by implementing simplified HTTP server and bringing it up and so on. But if this option selected, you can define path to remote location of the files. For example if you set in settings '192.168.4.2:80/ROMS/NS/' and add in table file 'my file.nsp' then NS-USBloader will simply tell Awoo "Hey, go take files from '192.168.4.2:80/ROMS/NS/my%20file.nsp' ". Of course you have to bring '192.168.4.2' host up and make file accessible from such address (just go install nginx). As I said, this feature is interesting, but I guess won't be popular.
159163

160164
Also here you can:
161165
* Set 'Auto-check for updates' for checking for updates when application starts, or click button to verify if new version released immediately.
@@ -175,10 +179,10 @@ To get help run ``$ java -jar ns-usbloader-4.0.jar --help``
175179
-g,--goldleaf <...> Install via GoldLeaf mode. Check '-g help' for information.
176180
-h,--help Show this help
177181
-m,--merge <...> Merge files. Check '-m help' for information.
178-
-n,--tfn <...> Install via Tinfoil/Awoo Network mode. Check '-n help' for information.
182+
-n,--tfn <...> Install via Awoo Network mode. Check '-n help' for information.
179183
-r,--rcm <[PATH/]payload.bin> Send payload
180184
-s,--split <...> Split files. Check '-s help' for information.
181-
-t,--tinfoil <FILE...> Install via Tinfoil/Awoo USB mode.
185+
-t,--tinfoil <FILE...> Install via Awoo USB mode.
182186
-v,--version Show application version
183187
```
184188

@@ -214,23 +218,20 @@ $ java -jar ns-usbloader-4.0.jar -m /tmp/ ~/*.nsp
214218
### Other notes
215219

216220
'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.
217-
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.
221+
Handling successful/failed installation is a purpose of the other side application: Awoo/Awoo-like or GoldLeaf. And they don't provide any feedback interfaces so I can't detect success/failure.
218222

219223
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.
220224

221225
### Translators!
226+
222227
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.
223228

224229
Upload somewhere (create PR, use pastebin/google drive/whatever else). [Create new issue](https://github.com/developersu/ns-usbloader/issues) and post a link. I'll grab it and add.
225230

226231
To convert files of any locale to readable format (and vise-versa) you can use this site [https://itpro.cz/juniconv/](https://itpro.cz/juniconv/)
227232

228-
#### TODO (maybe):
229-
- [x] [Android support](https://github.com/developersu/ns-usbloader-mobile)
230-
231233
## Support this app
232234

233-
234235
If you like this app, just give a star.
235236

236237
If you want to make a donation*, please see below:
@@ -239,9 +240,9 @@ If you want to make a donation*, please see below:
239240

240241
<a href="https://paypal.me/developersu" title="PayPal"><img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" border="0" alt="PayPal Logo" /></a>
241242

242-
[Yandex.Money](https://money.yandex.ru/to/410014301951665)
243+
[yoomoney](https://yoomoney.ru/to/410014301951665)
243244

244-
* Please note: this is non-commercial application.
245+
*Please note: this is non-commercial application.
245246

246247
Thanks
247248

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<url>https://github.com/developersu/ns-usbloader/</url>
1414
<description>
15-
NSP USB loader for TinFoil (USB and Network) and GoldLeaf
15+
NSP USB loader for Awoo Installer and compatible (USB and Network) and GoldLeaf
1616
</description>
1717
<inceptionYear>2019</inceptionYear>
1818
<organization>
@@ -257,7 +257,7 @@
257257
<versionInfo>
258258
<fileVersion>1.0.0.0</fileVersion>
259259
<txtFileVersion>${project.version}</txtFileVersion>
260-
<fileDescription>TinFoil and GoldLeaf installer for your NS</fileDescription>
260+
<fileDescription>Awoo and GoldLeaf installer for your NS</fileDescription>
261261
<copyright>GNU General Public License v3, 2019 ${project.organization.name}. Russia/LPR.</copyright>
262262
<productVersion>1.0.0.0</productVersion>
263263
<txtProductVersion>${project.version}</txtProductVersion>

src/main/java/nsusbloader/AppPreferences.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ public String getTheme(){
4141
theme = "/res/app_dark.css";
4242
return theme;
4343
}
44-
public String getProtocol(){
45-
String protocol = preferences.get("PROTOCOL", "TinFoil"); // Don't let user to change settings manually
46-
if (!protocol.matches("(^TinFoil$)|(^GoldLeaf$)"))
47-
protocol = "TinFoil";
48-
return protocol;
44+
public int getProtocol(){
45+
int protocolIndex = preferences.getInt("protocol_index", 0); // Don't let user to change settings manually
46+
if (protocolIndex < 0 || protocolIndex > 1)
47+
protocolIndex = 0;
48+
return protocolIndex;
4949
}
50+
public void setProtocol(int protocolIndex){ preferences.putInt("protocol_index", protocolIndex); }
51+
5052
public String getNetUsb(){
5153
String netUsb = preferences.get("NETUSB", "USB"); // Don't let user to change settings manually
5254
if (!netUsb.matches("(^USB$)|(^NET$)"))
@@ -55,7 +57,7 @@ public String getNetUsb(){
5557
}
5658

5759
public void setTheme(String theme){ preferences.put("THEME", theme); }
58-
public void setProtocol(String protocol){ preferences.put("PROTOCOL", protocol); }
60+
5961
public void setNetUsb(String netUsb){ preferences.put("NETUSB", netUsb); }
6062

6163
public void setNsIp(String ip){preferences.put("NSIP", ip);}

src/main/java/nsusbloader/Controllers/GamesController.java

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
7878
this.resourceBundle = resourceBundle;
7979
AppPreferences preferences = AppPreferences.getInstance();
8080

81-
ObservableList<String> choiceProtocolList = FXCollections.observableArrayList("TinFoil", "GoldLeaf");
81+
ObservableList<String> choiceProtocolList = FXCollections.observableArrayList("Awoo", "GoldLeaf");
8282

8383
choiceProtocol.setItems(choiceProtocolList);
8484
choiceProtocol.getSelectionModel().select(preferences.getProtocol());
8585
choiceProtocol.setOnAction(e-> {
86-
tableFilesListController.setNewProtocol(getSelectedProtocol());
87-
if (getSelectedProtocol().equals("GoldLeaf")) {
86+
tableFilesListController.setNewProtocol(getSelectedProtocolByName());
87+
if (isGoldLeaf()) {
8888
choiceNetUsb.setDisable(true);
8989
choiceNetUsb.getSelectionModel().select("USB");
9090
nsIpLbl.setVisible(false);
@@ -100,12 +100,12 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
100100
// Really bad disable-enable upload button function
101101
disableUploadStopBtn(tableFilesListController.isFilesForUploadListEmpty());
102102
}); // Add listener to notify tableView controller
103-
tableFilesListController.setNewProtocol(getSelectedProtocol()); // Notify tableView controller
103+
tableFilesListController.setNewProtocol(getSelectedProtocolByName()); // Notify tableView controller
104104

105105
ObservableList<String> choiceNetUsbList = FXCollections.observableArrayList("USB", "NET");
106106
choiceNetUsb.setItems(choiceNetUsbList);
107107
choiceNetUsb.getSelectionModel().select(preferences.getNetUsb());
108-
if (getSelectedProtocol().equals("GoldLeaf")) {
108+
if (isGoldLeaf()) {
109109
choiceNetUsb.setDisable(true);
110110
choiceNetUsb.getSelectionModel().select("USB");
111111
}
@@ -121,7 +121,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
121121
});
122122
// Set and configure NS IP field behavior
123123
nsIpTextField.setText(preferences.getNsIp());
124-
if (getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("NET")){
124+
if (isTinfoil() && getSelectedNetUsb().equals("NET")){
125125
nsIpLbl.setVisible(true);
126126
nsIpTextField.setVisible(true);
127127
}
@@ -145,7 +145,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
145145
selectSplitNspBtn.getStyleClass().add("buttonSelect");
146146

147147
uploadStopBtn.setOnAction(e-> uploadBtnAction());
148-
uploadStopBtn.setDisable(getSelectedProtocol().equals("TinFoil"));
148+
uploadStopBtn.setDisable(isTinfoil());
149149

150150
this.btnUpStopImage = new Region();
151151
btnUpStopImage.getStyleClass().add("regionUpload");
@@ -174,30 +174,33 @@ private void switchTheme(){
174174
AppPreferences.getInstance().setTheme(styleSheets.get(0));
175175
}
176176
/**
177-
* Get selected protocol (GL/TF)
177+
* Get selected protocol index (GL/Awoo)
178178
* */
179-
String getSelectedProtocol(){
179+
private int getSelectedProtocolByIndex(){
180+
return choiceProtocol.getSelectionModel().getSelectedIndex();
181+
}
182+
private String getSelectedProtocolByName(){
180183
return choiceProtocol.getSelectionModel().getSelectedItem();
181184
}
182185
/**
183186
* Get selected protocol (USB/NET)
184187
* */
185-
String getSelectedNetUsb(){
188+
private String getSelectedNetUsb(){
186189
return choiceNetUsb.getSelectionModel().getSelectedItem();
187190
}
188191
/**
189192
* Get NS IP address
190193
* */
191-
String getNsIp(){
194+
private String getNsIp(){
192195
return nsIpTextField.getText();
193196
}
194197

195198
private boolean isGoldLeaf() {
196-
return getSelectedProtocol().equals("GoldLeaf");
199+
return getSelectedProtocolByName().equals("GoldLeaf");
197200
}
198201

199202
private boolean isTinfoil() {
200-
return getSelectedProtocol().equals("TinFoil");
203+
return getSelectedProtocolByName().equals("Awoo");
201204
}
202205

203206
private boolean isAllFiletypesAllowedForGL() {
@@ -290,7 +293,7 @@ private void selectFoldersBtnAction() {
290293
* @param startFolder where to start
291294
* @param filesRegex for filenames
292295
*/
293-
// TODO: Too sophisticated. Should be moved to simple class to keep things simplier
296+
// TODO: Too sophisticated. Should be moved to simple class to keep things simpler
294297

295298
private void collectFiles(List<File> storage,
296299
File startFolder,
@@ -353,7 +356,7 @@ private void uploadBtnAction(){
353356

354357
TextArea logArea = MediatorControl.getInstance().getContoller().logArea;
355358

356-
if (getSelectedProtocol().equals("TinFoil") && tableFilesListController.getFilesForUpload() == null) {
359+
if (isTinfoil() && tableFilesListController.getFilesForUpload() == null) {
357360
logArea.setText(resourceBundle.getString("tab3_Txt_NoFolderOrFileSelected"));
358361
return;
359362
}
@@ -369,11 +372,11 @@ private void uploadBtnAction(){
369372

370373
SettingsController settings = MediatorControl.getInstance().getSettingsController();
371374
// If USB selected
372-
if (getSelectedProtocol().equals("GoldLeaf") ){
375+
if (isGoldLeaf()){
373376
final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
374377
usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
375378
}
376-
else if (( getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("USB") )){
379+
else if (( isTinfoil() && getSelectedNetUsb().equals("USB") )){
377380
usbNetCommunications = new UsbCommunications(nspToUpload, "TinFoil", false);
378381
}
379382
else { // NET INSTALL OVER TINFOIL
@@ -477,7 +480,7 @@ public void notifyThreadStarted(boolean isActive, EModule type){
477480
* Crunch. This function called from NSTableViewController
478481
* */
479482
public void disableUploadStopBtn(boolean disable){
480-
if (getSelectedProtocol().equals("TinFoil"))
483+
if (isTinfoil())
481484
uploadStopBtn.setDisable(disable);
482485
else
483486
uploadStopBtn.setDisable(false);
@@ -522,7 +525,7 @@ public String getRecentPath(){
522525
public void updatePreferencesOnExit(){
523526
AppPreferences preferences = AppPreferences.getInstance();
524527

525-
preferences.setProtocol(getSelectedProtocol());
528+
preferences.setProtocol(getSelectedProtocolByIndex());
526529
preferences.setRecent(getRecentPath());
527530
preferences.setNetUsb(getSelectedNetUsb());
528531
preferences.setNsIp(getNsIp());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ private Options createCliOptions(){
136136
/* Tinfoil network mode options */
137137
final Option tinfoilNetOption = Option.builder("n")
138138
.longOpt("tfn")
139-
.desc("Install via Tinfoil/Awoo Network mode. Check '-n help' for information.")
139+
.desc("Install via Awoo Network mode. Check '-n help' for information.")
140140
.hasArgs()
141141
.argName("...")
142142
.build();
143143
/* Tinfoil/Awoo USB */
144144
final Option tinfoilOption = Option.builder("t")
145145
.longOpt("tinfoil")
146-
.desc("Install via Tinfoil/Awoo USB mode.")
146+
.desc("Install via Awoo USB mode.")
147147
.hasArgs()
148148
.argName("FILE...")
149149
.build();

0 commit comments

Comments
 (0)