Skip to content

Commit

Permalink
Using idea from #90: Replace 'Tinfoil' by 'Awoo' everywhere on the fr…
Browse files Browse the repository at this point in the history
…ont 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)
  • Loading branch information
developersu committed Aug 10, 2021
1 parent 86c867a commit b02bc7e
Show file tree
Hide file tree
Showing 24 changed files with 164 additions and 145 deletions.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
[Support author](#support-this-app)

NS-USBloader is:
* 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.
Replacement for default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**.
* 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.
Alternative to default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**.
* This application also could be used as RCM payload on Windows, MacOS and Linux (supported arch: x86, x86_64 and Raspberry Pi).
* And of course it's a tool for split files!
* And also for merging split-files into one :)
* It's a tool for creating split files!
* Also you can use it for merging split-files into one :)


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

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

### System requirements

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

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

### Awoo Installer support
### Awoo Installer and compatible applications support

Awoo Installer uses the same command-set (or 'protocol') to [Adubbz/Tinfoil](https://github.com/Adubbz/Tinfoil/).

Awoo Installer uses the same command-set (or 'protocol') to TinFoil. So just select 'TinFoil' in case you're going to use Awoo.
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.

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!
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!

### Usage
##### Linux:
Expand Down Expand Up @@ -121,9 +125,9 @@ Set 'Security & Privacy' settings if needed.

#### And how to use it?

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

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

#### In details

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

Table.

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.~~
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.~~

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.

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

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

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

##### 'Gears' tab.

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

Also here you can:
* Set 'Auto-check for updates' for checking for updates when application starts, or click button to verify if new version released immediately.
Expand All @@ -175,10 +179,10 @@ To get help run ``$ java -jar ns-usbloader-4.0.jar --help``
-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.
-n,--tfn <...> Install via 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 <FILE...> Install via Tinfoil/Awoo USB mode.
-t,--tinfoil <FILE...> Install via Awoo USB mode.
-v,--version Show application version
```

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

'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.
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.

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.

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.

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/)

#### TODO (maybe):
- [x] [Android support](https://github.com/developersu/ns-usbloader-mobile)

## Support this app


If you like this app, just give a star.

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

<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>

[Yandex.Money](https://money.yandex.ru/to/410014301951665)
[yoomoney](https://yoomoney.ru/to/410014301951665)

* Please note: this is non-commercial application.
*Please note: this is non-commercial application.

Thanks

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<url>https://github.com/developersu/ns-usbloader/</url>
<description>
NSP USB loader for TinFoil (USB and Network) and GoldLeaf
NSP USB loader for Awoo Installer and compatible (USB and Network) and GoldLeaf
</description>
<inceptionYear>2019</inceptionYear>
<organization>
Expand Down Expand Up @@ -257,7 +257,7 @@
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>TinFoil and GoldLeaf installer for your NS</fileDescription>
<fileDescription>Awoo and GoldLeaf installer for your NS</fileDescription>
<copyright>GNU General Public License v3, 2019 ${project.organization.name}. Russia/LPR.</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/nsusbloader/AppPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ public String getTheme(){
theme = "/res/app_dark.css";
return theme;
}
public String getProtocol(){
String protocol = preferences.get("PROTOCOL", "TinFoil"); // Don't let user to change settings manually
if (!protocol.matches("(^TinFoil$)|(^GoldLeaf$)"))
protocol = "TinFoil";
return protocol;
public int getProtocol(){
int protocolIndex = preferences.getInt("protocol_index", 0); // Don't let user to change settings manually
if (protocolIndex < 0 || protocolIndex > 1)
protocolIndex = 0;
return protocolIndex;
}
public void setProtocol(int protocolIndex){ preferences.putInt("protocol_index", protocolIndex); }

public String getNetUsb(){
String netUsb = preferences.get("NETUSB", "USB"); // Don't let user to change settings manually
if (!netUsb.matches("(^USB$)|(^NET$)"))
Expand All @@ -55,7 +57,7 @@ public String getNetUsb(){
}

public void setTheme(String theme){ preferences.put("THEME", theme); }
public void setProtocol(String protocol){ preferences.put("PROTOCOL", protocol); }

public void setNetUsb(String netUsb){ preferences.put("NETUSB", netUsb); }

public void setNsIp(String ip){preferences.put("NSIP", ip);}
Expand Down
41 changes: 22 additions & 19 deletions src/main/java/nsusbloader/Controllers/GamesController.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
this.resourceBundle = resourceBundle;
AppPreferences preferences = AppPreferences.getInstance();

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

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

ObservableList<String> choiceNetUsbList = FXCollections.observableArrayList("USB", "NET");
choiceNetUsb.setItems(choiceNetUsbList);
choiceNetUsb.getSelectionModel().select(preferences.getNetUsb());
if (getSelectedProtocol().equals("GoldLeaf")) {
if (isGoldLeaf()) {
choiceNetUsb.setDisable(true);
choiceNetUsb.getSelectionModel().select("USB");
}
Expand All @@ -121,7 +121,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
});
// Set and configure NS IP field behavior
nsIpTextField.setText(preferences.getNsIp());
if (getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("NET")){
if (isTinfoil() && getSelectedNetUsb().equals("NET")){
nsIpLbl.setVisible(true);
nsIpTextField.setVisible(true);
}
Expand All @@ -145,7 +145,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
selectSplitNspBtn.getStyleClass().add("buttonSelect");

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

this.btnUpStopImage = new Region();
btnUpStopImage.getStyleClass().add("regionUpload");
Expand Down Expand Up @@ -174,30 +174,33 @@ private void switchTheme(){
AppPreferences.getInstance().setTheme(styleSheets.get(0));
}
/**
* Get selected protocol (GL/TF)
* Get selected protocol index (GL/Awoo)
* */
String getSelectedProtocol(){
private int getSelectedProtocolByIndex(){
return choiceProtocol.getSelectionModel().getSelectedIndex();
}
private String getSelectedProtocolByName(){
return choiceProtocol.getSelectionModel().getSelectedItem();
}
/**
* Get selected protocol (USB/NET)
* */
String getSelectedNetUsb(){
private String getSelectedNetUsb(){
return choiceNetUsb.getSelectionModel().getSelectedItem();
}
/**
* Get NS IP address
* */
String getNsIp(){
private String getNsIp(){
return nsIpTextField.getText();
}

private boolean isGoldLeaf() {
return getSelectedProtocol().equals("GoldLeaf");
return getSelectedProtocolByName().equals("GoldLeaf");
}

private boolean isTinfoil() {
return getSelectedProtocol().equals("TinFoil");
return getSelectedProtocolByName().equals("Awoo");
}

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

private void collectFiles(List<File> storage,
File startFolder,
Expand Down Expand Up @@ -353,7 +356,7 @@ private void uploadBtnAction(){

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

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

SettingsController settings = MediatorControl.getInstance().getSettingsController();
// If USB selected
if (getSelectedProtocol().equals("GoldLeaf") ){
if (isGoldLeaf()){
final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
}
else if (( getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("USB") )){
else if (( isTinfoil() && getSelectedNetUsb().equals("USB") )){
usbNetCommunications = new UsbCommunications(nspToUpload, "TinFoil", false);
}
else { // NET INSTALL OVER TINFOIL
Expand Down Expand Up @@ -477,7 +480,7 @@ public void notifyThreadStarted(boolean isActive, EModule type){
* Crunch. This function called from NSTableViewController
* */
public void disableUploadStopBtn(boolean disable){
if (getSelectedProtocol().equals("TinFoil"))
if (isTinfoil())
uploadStopBtn.setDisable(disable);
else
uploadStopBtn.setDisable(false);
Expand Down Expand Up @@ -522,7 +525,7 @@ public String getRecentPath(){
public void updatePreferencesOnExit(){
AppPreferences preferences = AppPreferences.getInstance();

preferences.setProtocol(getSelectedProtocol());
preferences.setProtocol(getSelectedProtocolByIndex());
preferences.setRecent(getRecentPath());
preferences.setNetUsb(getSelectedNetUsb());
preferences.setNsIp(getNsIp());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/nsusbloader/cli/CommandLineInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ private Options createCliOptions(){
/* Tinfoil network mode options */
final Option tinfoilNetOption = Option.builder("n")
.longOpt("tfn")
.desc("Install via Tinfoil/Awoo Network mode. Check '-n help' for information.")
.desc("Install via Awoo Network mode. Check '-n help' for information.")
.hasArgs()
.argName("...")
.build();
/* Tinfoil/Awoo USB */
final Option tinfoilOption = Option.builder("t")
.longOpt("tinfoil")
.desc("Install via Tinfoil/Awoo USB mode.")
.desc("Install via Awoo USB mode.")
.hasArgs()
.argName("FILE...")
.build();
Expand Down
Loading

0 comments on commit b02bc7e

Please sign in to comment.