diff --git a/README.md b/README.md index ded4dd9..de367d9 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,26 @@ Sometimes I add new posts about this project [on my home page](https://developer ![Screenshot](https://farm8.staticflickr.com/7809/46703921964_53f60f04ed_o.png) -### License +#### License [GNU General Public License v3](https://github.com/developersu/ns-usbloader/blob/master/LICENSE) -### Used libraries & resources +#### Used libraries & resources * [OpenJFX](https://wiki.openjdk.java.net/display/OpenJFX/Main) * [usb4java](https://mvnrepository.com/artifact/org.usb4java/usb4java) * Few icons taken from: [materialdesignicons.com](http://materialdesignicons.com/) +#### Thanks for the great work done by our translators! + +* Italian by [unbranched](https://github.com/unbranched) +* Korean by [DDinghoya](https://github.com/DDinghoya) +* Portuguese by [almircanella](https://github.com/almircanella) + ### System requirements JRE/JDK 8u60 or higher. ### Usage -#### How to start it on.. ##### Linux: 1. Install JRE/JDK 8u60 or higher (openJDK is good. Oracle's one is also good). JavaFX not needed (it's embedded). @@ -85,40 +90,30 @@ Why when 'NET' once started it never ends? 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. -### Tips&tricks -#### Linux: Add user to 'udev' rules to use NS not-from-root-account +#### Tips&tricks +##### Linux: Add user to 'udev' rules to use NS not-from-root-account ``` root # vim /etc/udev/rules.d/99-NS.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", GROUP="plugdev" root # udevadm control --reload-rules && udevadm trigger ``` -### Known bugs +#### Known bugs * Unable to interrupt transmission when libusb awaiting for read event (when user sent NSP list but didn't select anything on NS). Sometimes this issue also appears when network transmission started and nothing received from NS. -### Other notes +#### 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. 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. -### Translators! Traductores! Übersetzer! Թարգմանիչներ! +#### 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 (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. NOTE: actually it's not gonna work in real, because we should stay in touch and I'll need you when add something that should be translated =( -### Thanks for great work done by our translators! - -Français by [Stephane Meden (JackFromNice)](https://github.com/JackFromNice) - -Italian by [unbranched](https://github.com/unbranched) - -Korean by [DDinghoya](https://github.com/DDinghoya) - -Portuguese by [almircanella](https://github.com/almircanella) - -#### TODO (maybe): +##### TODO (maybe): - [x] macOS QA v0.1 (Mojave) - [x] macOS QA v0.2.2 (Mojave) - [x] macOS QA v0.2.3-DEV (High Sierra) @@ -133,7 +128,7 @@ Portuguese by [almircanella](https://github.com/almircanella) - [x] 'Check for application updates' functionality -#### Thanks +##### Thanks Appreciate assistance and support of both Vitaliy and Konstantin. Without you all this magic would not have happened. [Konstanin Kelemen](https://github.com/konstantin-kelemen) diff --git a/pom.xml b/pom.xml index 4369ef3..dcaef21 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ NS-USBloader ns-usbloader - 0.4.1-SNAPSHOT + 0.5-SNAPSHOT https://github.com/developersu/ns-usbloader/ diff --git a/src/main/java/nsusbloader/Controllers/SettingsController.java b/src/main/java/nsusbloader/Controllers/SettingsController.java index 96429fa..743278b 100644 --- a/src/main/java/nsusbloader/Controllers/SettingsController.java +++ b/src/main/java/nsusbloader/Controllers/SettingsController.java @@ -13,10 +13,12 @@ import nsusbloader.AppPreferences; import nsusbloader.ServiceWindow; import nsusbloader.ModelControllers.UpdatesChecker; -import javax.security.auth.callback.Callback; import java.io.File; +import java.io.IOException; import java.net.URL; import java.util.*; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; public class SettingsController implements Initializable { @@ -189,15 +191,34 @@ public class SettingsController implements Initializable { tfXciSpprtCb.setSelected(AppPreferences.getInstance().getTfXCI()); // Language settings area - URL resourceURL = this.getClass().getResource("/"); - String[] filesList = new File(resourceURL.getFile()).list(); // Screw it. This WON'T produce NullPointerException - ObservableList langCBObsList = FXCollections.observableArrayList(); langCBObsList.add("eng"); - for (String jarFileName : filesList) - if (jarFileName.startsWith("locale_")) - langCBObsList.add(jarFileName.substring(7, 10)); + File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()); + + if(jarFile.isFile()) { // Run with JAR file + try { + JarFile jar = new JarFile(jarFile); + Enumeration entries = jar.entries(); //gives ALL entries in jar + while (entries.hasMoreElements()) { + String name = entries.nextElement().getName(); + if (name.startsWith("locale_")) + langCBObsList.add(name.substring(7, 10)); + } + jar.close(); + } + catch (IOException ioe){ + ioe.printStackTrace(); // TODO: think about better solution? + } + } + else { // Run within IDE + URL resourceURL = this.getClass().getResource("/"); + String[] filesList = new File(resourceURL.getFile()).list(); // Screw it. This WON'T produce NullPointerException + + for (String jarFileName : filesList) + if (jarFileName.startsWith("locale_")) + langCBObsList.add(jarFileName.substring(7, 10)); + } langCB.setItems(langCBObsList); if (langCBObsList.contains(AppPreferences.getInstance().getLanguage())) diff --git a/src/main/java/nsusbloader/NSLMain.java b/src/main/java/nsusbloader/NSLMain.java index 73b6fcd..56c9a27 100644 --- a/src/main/java/nsusbloader/NSLMain.java +++ b/src/main/java/nsusbloader/NSLMain.java @@ -12,7 +12,7 @@ import java.util.Locale; import java.util.ResourceBundle; public class NSLMain extends Application { - public static final String appVersion = "v0.4.1"; + public static final String appVersion = "v0.5"; @Override public void start(Stage primaryStage) throws Exception{ diff --git a/src/main/resources/SettingsTab.fxml b/src/main/resources/SettingsTab.fxml index 435dc83..4f93bf8 100644 --- a/src/main/resources/SettingsTab.fxml +++ b/src/main/resources/SettingsTab.fxml @@ -87,7 +87,7 @@