Compare commits
No commits in common. "45247d6d8cd20486dd8f4123f0fed726d5b053bd" and "5838fe3b8980bb9297a1aa28a74ddb3c744a6961" have entirely different histories.
45247d6d8c
...
5838fe3b89
15 changed files with 34 additions and 91 deletions
7
BUILD.md
7
BUILD.md
|
@ -29,13 +29,6 @@ $ javac -h . RcmSmash.java
|
||||||
$ cd 'NS-USBloader/JNI sources/linux'
|
$ cd 'NS-USBloader/JNI sources/linux'
|
||||||
$ make install clean
|
$ make install clean
|
||||||
```
|
```
|
||||||
**Build for Raspberry Pi (Raspberry Pi host):**
|
|
||||||
```
|
|
||||||
$ cd 'NS-USBloader/JNI sources/linux'
|
|
||||||
$ mv Makefile_rapsberry Makefile
|
|
||||||
$ make install clean
|
|
||||||
```
|
|
||||||
|
|
||||||
**Build for Windows (on x86_64 host):**
|
**Build for Windows (on x86_64 host):**
|
||||||
|
|
||||||
[ This part should be updated ]
|
[ This part should be updated ]
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Compiler
|
|
||||||
CC=arm-linux-gnueabihf-gcc
|
|
||||||
# Flags
|
|
||||||
CFLAGS=-O2
|
|
||||||
MKDIR_P = mkdir -p
|
|
||||||
APP_NAME = smashlib.so
|
|
||||||
|
|
||||||
ifeq ($(JAVA_HOME),)
|
|
||||||
JAVA_LIB_PATH := "/usr/lib/jvm/default-java/include"
|
|
||||||
JAVA_LIB_PATH_LINUX := "/usr/lib/jvm/default-java/include/linux"
|
|
||||||
else
|
|
||||||
JAVA_LIB_PATH = ${JAVA_HOME}/include
|
|
||||||
JAVA_LIB_PATH_LINUX = ${JAVA_HOME}/include/linux
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: arm
|
|
||||||
|
|
||||||
arm:
|
|
||||||
test $(JAVA_LIB_PATH)
|
|
||||||
$(MKDIR_P) ./arm
|
|
||||||
$(CC) -c -fPIC -I$(JAVA_LIB_PATH) -I"$(JAVA_LIB_PATH_LINUX)" smashlib.c -o smashlib_arm.o
|
|
||||||
$(CC) ${CFLAGS} -shared -fPIC -o ./arm/${APP_NAME} smashlib_arm.o -lc
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf smashlib_arm.o ./arm
|
|
||||||
|
|
||||||
install: arm
|
|
||||||
install ./arm/${APP_NAME} ../../src/main/resources/native/linux/arm/
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
rm ../../src/main/resources/native/linux/arm/${APP_NAME}
|
|
10
README.md
10
README.md
|
@ -7,7 +7,7 @@
|
||||||
NS-USBloader is:
|
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.
|
* 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**.
|
Replacement for 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).
|
* This application also could be used as RCM payload on Windows, MacOS and Linux (supported arch: x86, x86_64).
|
||||||
* And of course it's a tool for split files!
|
* And of course it's a tool for split files!
|
||||||
* And also for merging split-files into one :)
|
* And also for merging split-files into one :)
|
||||||
|
|
||||||
|
@ -90,14 +90,6 @@ root # udevadm control --reload-rules && udevadm trigger
|
||||||
|
|
||||||
Please note: you may have to change 'plugdev' group from example above to the different one. It's depends on you linux distro.
|
Please note: you may have to change 'plugdev' group from example above to the different one. It's depends on you linux distro.
|
||||||
|
|
||||||
##### Raspberry Pi
|
|
||||||
|
|
||||||
1. Install JDK: `sudo apt install default-jdk`
|
|
||||||
|
|
||||||
2. For UI install JavaFX:
|
|
||||||
|
|
||||||
3. See steps 3 and 4 from 'Linux' section to update 'udev'.
|
|
||||||
|
|
||||||
##### macOS
|
##### macOS
|
||||||
|
|
||||||
Double-click on downloaded .jar file. Follow instructions. Or see 'Linux' section.
|
Double-click on downloaded .jar file. Follow instructions. Or see 'Linux' section.
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
<name>NS-USBloader</name>
|
<name>NS-USBloader</name>
|
||||||
|
|
||||||
<artifactId>ns-usbloader</artifactId>
|
<artifactId>ns-usbloader</artifactId>
|
||||||
<version>4.1-SNAPSHOT</version>
|
<version>4.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<url>https://github.com/developersu/ns-usbloader/</url>
|
<url>https://github.com/developersu/ns-usbloader/</url>
|
||||||
<description>
|
<description>
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.ResourceBundle;
|
||||||
|
|
||||||
public class NSLMain extends Application {
|
public class NSLMain extends Application {
|
||||||
|
|
||||||
public static final String appVersion = "v4.1";
|
public static final String appVersion = "v4.0";
|
||||||
public static boolean isCli;
|
public static boolean isCli;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,9 +43,6 @@ public class JNIRcmLoader {
|
||||||
case "amd64":
|
case "amd64":
|
||||||
osArch = "amd64";
|
osArch = "amd64";
|
||||||
break;
|
break;
|
||||||
case "arm":
|
|
||||||
osArch = "arm";
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,34 +55,34 @@ public class CommandLineInterface {
|
||||||
}
|
}
|
||||||
if (cli.hasOption("n") || cli.hasOption("tfn")){
|
if (cli.hasOption("n") || cli.hasOption("tfn")){
|
||||||
final String[] arguments = cli.getOptionValues("tfn");
|
final String[] arguments = cli.getOptionValues("tfn");
|
||||||
new TinfoilNetCli(arguments);
|
new TinfoilNet(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cli.hasOption("t") || cli.hasOption("tinfoil")){
|
if (cli.hasOption("t") || cli.hasOption("tinfoil")){
|
||||||
final String[] arguments = cli.getOptionValues("tinfoil");
|
final String[] arguments = cli.getOptionValues("tinfoil");
|
||||||
new TinfoilUsbCli(arguments);
|
new TinfoilUsb(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cli.hasOption("g") || cli.hasOption("goldleaf")){
|
if (cli.hasOption("g") || cli.hasOption("goldleaf")){
|
||||||
final String[] arguments = cli.getOptionValues("goldleaf");
|
final String[] arguments = cli.getOptionValues("goldleaf");
|
||||||
new GoldLeafCli(arguments);
|
new GoldLeaf(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (cli.hasOption("x") || cli.hasOption("nxdt")){
|
if (cli.hasOption("x") || cli.hasOption("nxdt")){
|
||||||
final String[] arguments = cli.getOptionValues("nxdt");
|
final String[] arguments = cli.getOptionValues("nxdt");
|
||||||
new NxdtCli(arguments);
|
new NXDT(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if (cli.hasOption("s") || cli.hasOption("split")){
|
if (cli.hasOption("s") || cli.hasOption("split")){
|
||||||
final String[] arguments = cli.getOptionValues("split");
|
final String[] arguments = cli.getOptionValues("split");
|
||||||
new SplitCli(arguments);
|
new Split(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cli.hasOption("m") || cli.hasOption("merge")){
|
if (cli.hasOption("m") || cli.hasOption("merge")){
|
||||||
final String[] arguments = cli.getOptionValues("merge");
|
final String[] arguments = cli.getOptionValues("merge");
|
||||||
new MergeCli(arguments);
|
new Merge(arguments);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class GoldLeafCli {
|
public class GoldLeaf {
|
||||||
|
|
||||||
private final String[] arguments;
|
private final String[] arguments;
|
||||||
private List<File> filesList;
|
private List<File> filesList;
|
||||||
|
@ -34,7 +34,7 @@ public class GoldLeafCli {
|
||||||
|
|
||||||
private int parseFileSince = 1;
|
private int parseFileSince = 1;
|
||||||
|
|
||||||
public GoldLeafCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
public GoldLeaf(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
|
|
||||||
checkArguments();
|
checkArguments();
|
|
@ -25,13 +25,13 @@ import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MergeCli {
|
public class Merge {
|
||||||
|
|
||||||
private String[] arguments;
|
private String[] arguments;
|
||||||
private String saveTo;
|
private String saveTo;
|
||||||
private String[] splitFiles;
|
private String[] splitFiles;
|
||||||
|
|
||||||
MergeCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
Merge(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
checkArguments();
|
checkArguments();
|
||||||
parseArguments();
|
parseArguments();
|
|
@ -22,12 +22,12 @@ import nsusbloader.Utilities.nxdumptool.NxdtTask;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class NxdtCli {
|
public class NXDT {
|
||||||
|
|
||||||
private final String[] arguments;
|
private final String[] arguments;
|
||||||
private String saveTo;
|
private String saveTo;
|
||||||
|
|
||||||
public NxdtCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
public NXDT(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
parseArgument();
|
parseArgument();
|
||||||
runBackend();
|
runBackend();
|
|
@ -1,25 +1,5 @@
|
||||||
/*
|
|
||||||
Copyright 2019-2020 Dmitry Isaenko
|
|
||||||
|
|
||||||
This file is part of NS-USBloader.
|
|
||||||
|
|
||||||
NS-USBloader is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
NS-USBloader is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package nsusbloader.cli;
|
package nsusbloader.cli;
|
||||||
|
|
||||||
import nsusbloader.Utilities.Rcm;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class RcmCli {
|
public class RcmCli {
|
||||||
|
@ -28,7 +8,19 @@ public class RcmCli {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runBackend(String payload) throws InterruptedException{
|
private void runBackend(String payload) throws InterruptedException{
|
||||||
Rcm rcm = new nsusbloader.Utilities.Rcm(payload);
|
/*
|
||||||
|
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);
|
Thread rcmThread = new Thread(rcm);
|
||||||
rcmThread.start();
|
rcmThread.start();
|
||||||
rcmThread.join();
|
rcmThread.join();
|
||||||
|
|
|
@ -25,13 +25,13 @@ import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SplitCli {
|
public class Split {
|
||||||
|
|
||||||
private String[] arguments;
|
private String[] arguments;
|
||||||
private String saveTo;
|
private String saveTo;
|
||||||
private String[] files;
|
private String[] files;
|
||||||
|
|
||||||
SplitCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
Split(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
checkArguments();
|
checkArguments();
|
||||||
parseArguments();
|
parseArguments();
|
|
@ -24,7 +24,7 @@ import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TinfoilNetCli {
|
public class TinfoilNet {
|
||||||
|
|
||||||
private final String[] arguments;
|
private final String[] arguments;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class TinfoilNetCli {
|
||||||
|
|
||||||
private List<File> filesList;
|
private List<File> filesList;
|
||||||
|
|
||||||
TinfoilNetCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
TinfoilNet(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
checkArguments();
|
checkArguments();
|
||||||
parseNsIP();
|
parseNsIP();
|
|
@ -24,12 +24,12 @@ import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TinfoilUsbCli {
|
public class TinfoilUsb {
|
||||||
|
|
||||||
private final String[] arguments;
|
private final String[] arguments;
|
||||||
private List<File> filesList;
|
private List<File> filesList;
|
||||||
|
|
||||||
public TinfoilUsbCli(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
public TinfoilUsb(String[] arguments) throws InterruptedException, IncorrectSetupException{
|
||||||
this.arguments = arguments;
|
this.arguments = arguments;
|
||||||
checkArguments();
|
checkArguments();
|
||||||
parseFilesArguments();
|
parseFilesArguments();
|
Binary file not shown.
Loading…
Reference in a new issue