Fix POM, update package name a bit, update NXDT-related part
This commit is contained in:
parent
8771d551a4
commit
98822de559
30 changed files with 299 additions and 108 deletions
11
pom.xml
11
pom.xml
|
@ -172,6 +172,17 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<!-- Junit5 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
|
|
@ -30,8 +30,8 @@ import javafx.scene.layout.Region;
|
||||||
import javafx.stage.DirectoryChooser;
|
import javafx.stage.DirectoryChooser;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import nsusbloader.AppPreferences;
|
import nsusbloader.AppPreferences;
|
||||||
import nsusbloader.COM.NET.NETCommunications;
|
import nsusbloader.com.net.NETCommunications;
|
||||||
import nsusbloader.COM.USB.UsbCommunications;
|
import nsusbloader.com.usb.UsbCommunications;
|
||||||
import nsusbloader.FilesHelper;
|
import nsusbloader.FilesHelper;
|
||||||
import nsusbloader.MediatorControl;
|
import nsusbloader.MediatorControl;
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
*/
|
*/
|
||||||
package nsusbloader.Utilities;
|
package nsusbloader.Utilities;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.UsbConnect;
|
import nsusbloader.com.usb.UsbConnect;
|
||||||
import nsusbloader.COM.USB.UsbErrorCodes;
|
import nsusbloader.com.usb.UsbErrorCodes;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.ModelControllers.Log;
|
import nsusbloader.ModelControllers.Log;
|
||||||
import nsusbloader.NSLDataTypes.EModule;
|
import nsusbloader.NSLDataTypes.EModule;
|
||||||
|
@ -39,14 +39,12 @@ import java.util.Arrays;
|
||||||
|
|
||||||
public class Rcm implements Runnable{
|
public class Rcm implements Runnable{
|
||||||
|
|
||||||
private boolean status = false;
|
|
||||||
|
|
||||||
private enum ECurrentOS {
|
private enum ECurrentOS {
|
||||||
win, lin, mac, unsupported
|
win, lin, mac, unsupported
|
||||||
}
|
}
|
||||||
|
|
||||||
private ILogPrinter logPrinter;
|
private final ILogPrinter logPrinter;
|
||||||
private String filePath;
|
private final String filePath;
|
||||||
|
|
||||||
private DeviceHandle handler;
|
private DeviceHandle handler;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
Copyright 2019-2020 Dmitry Isaenko, DarkMatterCore
|
||||||
|
|
||||||
|
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.Utilities.nxdumptool;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.RandomAccessFile;
|
||||||
|
|
||||||
|
public class NxdtNspFile {
|
||||||
|
private final String name;
|
||||||
|
private final int headerSize;
|
||||||
|
private final long fullSize;
|
||||||
|
private long nspRemainingSize;
|
||||||
|
private final File file;
|
||||||
|
|
||||||
|
NxdtNspFile(String name, int headerSize, long fullSize, File file) throws Exception{
|
||||||
|
this.name = name;
|
||||||
|
this.headerSize = headerSize;
|
||||||
|
this.fullSize = fullSize;
|
||||||
|
this.file = file;
|
||||||
|
this.nspRemainingSize = fullSize - headerSize;
|
||||||
|
|
||||||
|
removeIfExists();
|
||||||
|
createHeaderFiller();
|
||||||
|
}
|
||||||
|
private void removeIfExists() throws Exception{
|
||||||
|
if (! file.exists())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (file.delete())
|
||||||
|
return;
|
||||||
|
|
||||||
|
throw new Exception("Unable to delete leftovers of the NSP file: "+name);
|
||||||
|
}
|
||||||
|
private void createHeaderFiller() throws Exception {
|
||||||
|
try (RandomAccessFile raf = new RandomAccessFile(file, "rw")){
|
||||||
|
raf.setLength(headerSize);
|
||||||
|
}
|
||||||
|
catch (IOException e){
|
||||||
|
throw new Exception("Unable to reserve space for NSP file's header: "+e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() { return name; }
|
||||||
|
public int getHeaderSize() { return headerSize; }
|
||||||
|
public long getFullSize() { return fullSize; }
|
||||||
|
public File getFile() { return file; }
|
||||||
|
public long getNspRemainingSize() { return nspRemainingSize; }
|
||||||
|
|
||||||
|
public void setNspRemainingSize(long nspRemainingSize) { this.nspRemainingSize = nspRemainingSize; }
|
||||||
|
}
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package nsusbloader.Utilities.nxdumptool;
|
package nsusbloader.Utilities.nxdumptool;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.UsbConnect;
|
import nsusbloader.com.usb.UsbConnect;
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.ModelControllers.Log;
|
import nsusbloader.ModelControllers.Log;
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package nsusbloader.Utilities.nxdumptool;
|
package nsusbloader.Utilities.nxdumptool;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.UsbErrorCodes;
|
import nsusbloader.com.usb.UsbErrorCodes;
|
||||||
import nsusbloader.COM.USB.common.DeviceInformation;
|
import nsusbloader.com.usb.common.DeviceInformation;
|
||||||
import nsusbloader.COM.USB.common.NsUsbEndpointDescriptor;
|
import nsusbloader.com.usb.common.NsUsbEndpointDescriptor;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
|
@ -31,7 +31,11 @@ import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
import java.nio.IntBuffer;
|
import java.nio.IntBuffer;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
class NxdtUsbAbi1 {
|
class NxdtUsbAbi1 {
|
||||||
private final ILogPrinter logPrinter;
|
private final ILogPrinter logPrinter;
|
||||||
|
@ -51,6 +55,7 @@ class NxdtUsbAbi1 {
|
||||||
|
|
||||||
private static final int CMD_HANDSHAKE = 0;
|
private static final int CMD_HANDSHAKE = 0;
|
||||||
private static final int CMD_SEND_FILE_PROPERTIES = 1;
|
private static final int CMD_SEND_FILE_PROPERTIES = 1;
|
||||||
|
private static final int CMD_SEND_NSP_HEADER = 2;
|
||||||
private static final int CMD_ENDSESSION = 3;
|
private static final int CMD_ENDSESSION = 3;
|
||||||
|
|
||||||
// Standard set of possible replies
|
// Standard set of possible replies
|
||||||
|
@ -79,19 +84,19 @@ class NxdtUsbAbi1 {
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00 };
|
0x00, 0x00, 0x00, 0x00 };
|
||||||
|
|
||||||
private short endpointMaxPacketSize;
|
|
||||||
|
|
||||||
private static final int NXDT_USB_TIMEOUT = 5000;
|
private static final int NXDT_USB_TIMEOUT = 5000;
|
||||||
|
|
||||||
|
private HashMap<String, NxdtNspFile> nspFiles;
|
||||||
|
|
||||||
public NxdtUsbAbi1(DeviceHandle handler,
|
public NxdtUsbAbi1(DeviceHandle handler,
|
||||||
ILogPrinter logPrinter,
|
ILogPrinter logPrinter,
|
||||||
String saveToPath,
|
String saveToPath,
|
||||||
NxdtTask parent
|
NxdtTask parent
|
||||||
)throws Exception{
|
)throws Exception{
|
||||||
this.handlerNS = handler;
|
this.handlerNS = handler;
|
||||||
//this.endpointMaxPacketSize = wMaxPacketSize;
|
|
||||||
this.logPrinter = logPrinter;
|
this.logPrinter = logPrinter;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
this.nspFiles = new HashMap<>();
|
||||||
this.isWindows = System.getProperty("os.name").toLowerCase().contains("windows");
|
this.isWindows = System.getProperty("os.name").toLowerCase().contains("windows");
|
||||||
|
|
||||||
if (isWindows)
|
if (isWindows)
|
||||||
|
@ -110,7 +115,10 @@ class NxdtUsbAbi1 {
|
||||||
private void resolveEndpointMaxPacketSize() throws Exception{
|
private void resolveEndpointMaxPacketSize() throws Exception{
|
||||||
DeviceInformation deviceInformation = DeviceInformation.build(handlerNS);
|
DeviceInformation deviceInformation = DeviceInformation.build(handlerNS);
|
||||||
NsUsbEndpointDescriptor endpointInDescriptor = deviceInformation.getSimplifiedDefaultEndpointDescriptorIn();
|
NsUsbEndpointDescriptor endpointInDescriptor = deviceInformation.getSimplifiedDefaultEndpointDescriptorIn();
|
||||||
this.endpointMaxPacketSize = endpointInDescriptor.getwMaxPacketSize();
|
short endpointMaxPacketSize = endpointInDescriptor.getwMaxPacketSize();
|
||||||
|
|
||||||
|
USBSTATUS_SUCCESS[8] = (byte)(endpointMaxPacketSize & 0xFF);
|
||||||
|
USBSTATUS_SUCCESS[9] = (byte)((endpointMaxPacketSize >> 8) & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readLoop(){
|
private void readLoop(){
|
||||||
|
@ -134,6 +142,9 @@ class NxdtUsbAbi1 {
|
||||||
case CMD_SEND_FILE_PROPERTIES:
|
case CMD_SEND_FILE_PROPERTIES:
|
||||||
handleSendFileProperties(directive);
|
handleSendFileProperties(directive);
|
||||||
break;
|
break;
|
||||||
|
case CMD_SEND_NSP_HEADER:
|
||||||
|
handleSendNspHeader(directive);
|
||||||
|
break;
|
||||||
case CMD_ENDSESSION:
|
case CMD_ENDSESSION:
|
||||||
logPrinter.print("Session successfully ended.", EMsgType.PASS);
|
logPrinter.print("Session successfully ended.", EMsgType.PASS);
|
||||||
return;
|
return;
|
||||||
|
@ -187,70 +198,112 @@ class NxdtUsbAbi1 {
|
||||||
writeUsb(USBSTATUS_UNSUPPORTED_ABI);
|
writeUsb(USBSTATUS_UNSUPPORTED_ABI);
|
||||||
throw new Exception("ABI v"+versionABI+" is not supported in current version.");
|
throw new Exception("ABI v"+versionABI+" is not supported in current version.");
|
||||||
}
|
}
|
||||||
replyToHandshake();
|
|
||||||
}
|
|
||||||
private void replyToHandshake() throws Exception{
|
|
||||||
// Send status response + endpoint max packet size
|
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(USBSTATUS_SUCCESS.length + 2).order(ByteOrder.LITTLE_ENDIAN);
|
|
||||||
buffer.put(USBSTATUS_SUCCESS);
|
|
||||||
buffer.putShort(endpointMaxPacketSize);
|
|
||||||
byte[] response = buffer.array();
|
|
||||||
|
|
||||||
writeUsb(response);
|
writeUsb(USBSTATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSendFileProperties(byte[] message) throws Exception{
|
private void handleSendFileProperties(byte[] message) throws Exception{
|
||||||
final long fileSize = getLElong(message, 0x10);
|
final long fullSize = getLElong(message, 0x10);
|
||||||
final int fileNameLen = getLEint(message, 0x18);
|
final int fileNameLen = getLEint(message, 0x18);
|
||||||
String filename = new String(message, 0x20, fileNameLen, StandardCharsets.UTF_8);
|
final int headerSize = getLEint(message, 0x1C);
|
||||||
|
|
||||||
if (fileNameLen <= 0 || fileNameLen > NXDT_FILE_PROPERTIES_MAX_NAME_LENGTH){
|
if (checkFileNameLen(fileNameLen)) // In case of negative value we should better handle it before String constructor throws error
|
||||||
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
|
||||||
logPrinter.print("Invalid filename length!", EMsgType.FAIL);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
// TODO: Note, in case of a big amount of small files performace decreses dramatically. It's better to handle this only in case of 1-big-file-transfer
|
|
||||||
logPrinter.print("Receiving: '"+filename+"' ("+fileSize+" b)", EMsgType.INFO);
|
|
||||||
// If RomFs related
|
|
||||||
if (isRomFs(filename)) {
|
|
||||||
if (isWindows)
|
|
||||||
filename = saveToPath + filename.replaceAll("/", "\\\\");
|
|
||||||
else
|
|
||||||
filename = saveToPath + filename;
|
|
||||||
|
|
||||||
createPath(filename);
|
String filename = new String(message, 0x20, fileNameLen, StandardCharsets.UTF_8);
|
||||||
|
String absoluteFilePath = getAbsoluteFilePath(filename);
|
||||||
|
File fileToDump = new File(absoluteFilePath);
|
||||||
|
NxdtNspFile nspFile = nspFiles.get(filename); // it could be null, but it's not a problem.
|
||||||
|
boolean nspTransferMode = false;
|
||||||
|
|
||||||
|
if (checkSizes(fullSize, headerSize))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (createPath(absoluteFilePath))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if (checkFileSystem(fileToDump, fullSize))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (headerSize > 0){ // if NSP
|
||||||
|
logPrinter.print("Receiving NSP file entry: '"+filename+"' ("+fullSize+" b)", EMsgType.INFO);
|
||||||
|
if (nspFiles.containsKey(filename)){
|
||||||
|
nspTransferMode = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//logPrinter.print("Receiving: '"+filename+"' ("+fileSize+" b)", EMsgType.INFO); // TODO: see above
|
createNewNsp(filename, headerSize, fullSize, fileToDump);
|
||||||
filename = saveToPath + filename;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// TODO: Note, in case of a big amount of small files performance decreases dramatically. It's better to handle this only in case of 1-big-file-transfer
|
||||||
|
logPrinter.print("Receiving: '"+filename+"' ("+fullSize+" b)", EMsgType.INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
File fileToDump = new File(filename);
|
writeUsb(USBSTATUS_SUCCESS);
|
||||||
|
|
||||||
|
if (fullSize == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (nspTransferMode)
|
||||||
|
dumpNspFile(nspFile, fullSize);
|
||||||
|
else
|
||||||
|
dumpFile(fileToDump, fullSize);
|
||||||
|
|
||||||
|
writeUsb(USBSTATUS_SUCCESS);
|
||||||
|
|
||||||
|
}
|
||||||
|
private boolean checkFileNameLen(int fileNameLen) throws Exception{
|
||||||
|
if (fileNameLen <= 0 || fileNameLen > NXDT_FILE_PROPERTIES_MAX_NAME_LENGTH){
|
||||||
|
logPrinter.print("Invalid filename length!", EMsgType.FAIL);
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
private boolean checkSizes(long fileSize, int headerSize) throws Exception{
|
||||||
|
if (fileSize >= headerSize){
|
||||||
|
logPrinter.print("File size should not be equal to header size for NSP files!", EMsgType.FAIL);
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (fileSize < 0){ // It's possible to have files of zero-length, so only less is the problem
|
||||||
|
logPrinter.print("File size should not be less then zero!", EMsgType.FAIL);
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkFileSystem(File fileToDump, long fileSize) throws Exception{
|
||||||
// Check if enough space
|
// Check if enough space
|
||||||
if (fileToDump.getParentFile().getFreeSpace() <= fileSize){
|
if (fileToDump.getParentFile().getFreeSpace() <= fileSize){
|
||||||
writeUsb(USBSTATUS_HOSTIOERROR);
|
writeUsb(USBSTATUS_HOSTIOERROR);
|
||||||
logPrinter.print("Not enough space on selected volume. Need: "+fileSize+
|
logPrinter.print("Not enough space on selected volume. Need: "+fileSize+
|
||||||
" while available: "+fileToDump.getParentFile().getFreeSpace(), EMsgType.FAIL);
|
" while available: "+fileToDump.getParentFile().getFreeSpace(), EMsgType.FAIL);
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
// Check if FS is NOT read-only
|
// Check if FS is NOT read-only
|
||||||
if (! (fileToDump.canWrite() || fileToDump.createNewFile()) ){
|
if (! (fileToDump.canWrite() || fileToDump.createNewFile()) ){
|
||||||
writeUsb(USBSTATUS_HOSTIOERROR);
|
writeUsb(USBSTATUS_HOSTIOERROR);
|
||||||
logPrinter.print("Unable to write into selected volume: "+fileToDump.getAbsolutePath(), EMsgType.FAIL);
|
logPrinter.print("Unable to write into selected volume: "+fileToDump.getAbsolutePath(), EMsgType.FAIL);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
private void createNewNsp(String filename, int headerSize, long fileSize, File fileToDump) throws Exception{
|
||||||
|
try {
|
||||||
|
NxdtNspFile nsp = new NxdtNspFile(filename, headerSize, fileSize, fileToDump);
|
||||||
|
nspFiles.putIfAbsent(filename, nsp);
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
logPrinter.print(e.getMessage(), EMsgType.FAIL);
|
||||||
|
writeUsb(USBSTATUS_HOSTIOERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeUsb(USBSTATUS_SUCCESS);
|
writeUsb(USBSTATUS_SUCCESS);
|
||||||
|
|
||||||
if (fileSize == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
dumpFile(fileToDump, fileSize);
|
|
||||||
|
|
||||||
writeUsb(USBSTATUS_SUCCESS);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getLEint(byte[] bytes, int fromOffset){
|
private int getLEint(byte[] bytes, int fromOffset){
|
||||||
return ByteBuffer.wrap(bytes, fromOffset, 0x4).order(ByteOrder.LITTLE_ENDIAN).getInt();
|
return ByteBuffer.wrap(bytes, fromOffset, 0x4).order(ByteOrder.LITTLE_ENDIAN).getInt();
|
||||||
}
|
}
|
||||||
|
@ -259,23 +312,29 @@ class NxdtUsbAbi1 {
|
||||||
return ByteBuffer.wrap(bytes, fromOffset, 0x8).order(ByteOrder.LITTLE_ENDIAN).getLong();
|
return ByteBuffer.wrap(bytes, fromOffset, 0x8).order(ByteOrder.LITTLE_ENDIAN).getLong();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getAbsoluteFilePath(String filename) throws Exception{
|
||||||
|
if (isRomFs(filename) && isWindows) // Since RomFS entry starts from '/' it should be replaced to '\'.
|
||||||
|
return saveToPath + filename.replaceAll("/", "\\\\");
|
||||||
|
return saveToPath + filename;
|
||||||
|
}
|
||||||
private boolean isRomFs(String filename){
|
private boolean isRomFs(String filename){
|
||||||
return filename.startsWith("/");
|
return filename.startsWith("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createPath(String path) throws Exception{
|
private boolean createPath(String path) throws Exception{
|
||||||
File resultingFile = new File(path);
|
try {
|
||||||
File folderForTheFile = resultingFile.getParentFile();
|
Path folderForTheFile = Paths.get(path).getParent();
|
||||||
|
Files.createDirectories(folderForTheFile);
|
||||||
if (folderForTheFile.exists())
|
return false;
|
||||||
return;
|
|
||||||
|
|
||||||
if (folderForTheFile.mkdirs())
|
|
||||||
return;
|
|
||||||
|
|
||||||
writeUsb(USBSTATUS_HOSTIOERROR);
|
|
||||||
throw new Exception("Unable to create dir(s) for file in "+folderForTheFile);
|
|
||||||
}
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
logPrinter.print("Unable to create dir(s) for file "+path, EMsgType.FAIL);
|
||||||
|
writeUsb(USBSTATUS_HOSTIOERROR);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @see https://bugs.openjdk.java.net/browse/JDK-8146538
|
// @see https://bugs.openjdk.java.net/browse/JDK-8146538
|
||||||
private void dumpFile(File file, long size) throws Exception{
|
private void dumpFile(File file, long size) throws Exception{
|
||||||
|
@ -295,7 +354,6 @@ class NxdtUsbAbi1 {
|
||||||
fd.sync();
|
fd.sync();
|
||||||
bufferSize = readBuffer.length;
|
bufferSize = readBuffer.length;
|
||||||
received += bufferSize;
|
received += bufferSize;
|
||||||
|
|
||||||
logPrinter.updateProgress((double)received / (double)size);
|
logPrinter.updateProgress((double)received / (double)size);
|
||||||
}
|
}
|
||||||
int lastChunkSize = (int)(size - received) + 1;
|
int lastChunkSize = (int)(size - received) + 1;
|
||||||
|
@ -303,15 +361,77 @@ class NxdtUsbAbi1 {
|
||||||
bos.write(readBuffer);
|
bos.write(readBuffer);
|
||||||
if (isWindows10)
|
if (isWindows10)
|
||||||
fd.sync();
|
fd.sync();
|
||||||
} finally {
|
}
|
||||||
|
finally {
|
||||||
logPrinter.updateProgress(1.0);
|
logPrinter.updateProgress(1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Handle Zero-length terminator
|
|
||||||
private boolean isAligned(long size){
|
private void dumpNspFile(NxdtNspFile nsp, long size) throws Exception{
|
||||||
return ((size & (endpointMaxPacketSize - 1)) == 0);
|
FileOutputStream fos = new FileOutputStream(nsp.getFile(), true);
|
||||||
|
long nspSize = nsp.getFullSize();
|
||||||
|
long nspRemainingSize = nsp.getNspRemainingSize();
|
||||||
|
|
||||||
|
try (BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||||
|
FileDescriptor fd = fos.getFD();
|
||||||
|
byte[] readBuffer;
|
||||||
|
long received = 0;
|
||||||
|
int bufferSize;
|
||||||
|
|
||||||
|
while (received+NXDT_FILE_CHUNK_SIZE < size) {
|
||||||
|
//readBuffer = readUsbFile();
|
||||||
|
readBuffer = readUsbFileDebug(NXDT_FILE_CHUNK_SIZE);
|
||||||
|
bos.write(readBuffer);
|
||||||
|
if (isWindows10)
|
||||||
|
fd.sync();
|
||||||
|
bufferSize = readBuffer.length;
|
||||||
|
received += bufferSize;
|
||||||
|
|
||||||
|
nspRemainingSize -= bufferSize;
|
||||||
|
logPrinter.updateProgress((double)(nspSize - nspRemainingSize) / (double)nspSize);
|
||||||
|
}
|
||||||
|
int lastChunkSize = (int)(size - received) + 1;
|
||||||
|
readBuffer = readUsbFileDebug(lastChunkSize);
|
||||||
|
bos.write(readBuffer);
|
||||||
|
if (isWindows10)
|
||||||
|
fd.sync();
|
||||||
|
nspRemainingSize -= (lastChunkSize - 1);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
nsp.setNspRemainingSize(nspRemainingSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleSendNspHeader(byte[] message) throws Exception{
|
||||||
|
final int headerSize = getLEint(message, 0x8);
|
||||||
|
NxdtNspFile nsp = nspFiles.remove( null ); // <---------------------- //TODO: PLEASE PUT FILENAME HERE
|
||||||
|
|
||||||
|
if (nsp == null) {
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
logPrinter.print("Received NSP send header request outside of known NSPs!", EMsgType.FAIL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nsp.getNspRemainingSize() > 0) {
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
logPrinter.print("Received NSP send header request without receiving all NSP file entry data!", EMsgType.FAIL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (headerSize != nsp.getHeaderSize()) {
|
||||||
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
|
logPrinter.print("Received NSP header size mismatch! "+headerSize+" != "+nsp.getHeaderSize(), EMsgType.FAIL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try (RandomAccessFile raf = new RandomAccessFile(nsp.getFile(), "rw")) {
|
||||||
|
byte[] headerData = Arrays.copyOfRange(message, 0x10, headerSize + 0x10);
|
||||||
|
raf.seek(0);
|
||||||
|
raf.write(headerData);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeUsb(USBSTATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/** Sending any byte array to USB device **/
|
/** Sending any byte array to USB device **/
|
||||||
private void writeUsb(byte[] message) throws Exception{
|
private void writeUsb(byte[] message) throws Exception{
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
package nsusbloader.cli;
|
package nsusbloader.cli;
|
||||||
|
|
||||||
import nsusbloader.AppPreferences;
|
import nsusbloader.AppPreferences;
|
||||||
import nsusbloader.COM.USB.UsbCommunications;
|
import nsusbloader.com.usb.UsbCommunications;
|
||||||
import nsusbloader.Controllers.SettingsController;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package nsusbloader.cli;
|
package nsusbloader.cli;
|
||||||
|
|
||||||
import nsusbloader.COM.NET.NETCommunications;
|
import nsusbloader.com.net.NETCommunications;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package nsusbloader.cli;
|
package nsusbloader.cli;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.UsbCommunications;
|
import nsusbloader.com.usb.UsbCommunications;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.Helpers;
|
package nsusbloader.com.helpers;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.NET;
|
package nsusbloader.com.net;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
|
@ -24,7 +24,7 @@ import nsusbloader.NSLDataTypes.EFileStatus;
|
||||||
import nsusbloader.ModelControllers.Log;
|
import nsusbloader.ModelControllers.Log;
|
||||||
import nsusbloader.NSLDataTypes.EModule;
|
import nsusbloader.NSLDataTypes.EModule;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import nsusbloader.COM.Helpers.NSSplitReader;
|
import nsusbloader.com.helpers.NSSplitReader;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.NET;
|
package nsusbloader.com.net;
|
||||||
|
|
||||||
import nsusbloader.NSLMain;
|
import nsusbloader.NSLMain;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.NET;
|
package nsusbloader.com.net;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.NET;
|
package nsusbloader.com.net;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import nsusbloader.COM.Helpers.NSSplitReader;
|
import nsusbloader.com.helpers.NSSplitReader;
|
||||||
import nsusbloader.COM.USB.PFS.PFSProvider;
|
import nsusbloader.com.usb.PFS.PFSProvider;
|
||||||
import org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
import org.usb4java.LibUsb;
|
import org.usb4java.LibUsb;
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import nsusbloader.COM.Helpers.NSSplitReader;
|
import nsusbloader.com.helpers.NSSplitReader;
|
||||||
import nsusbloader.MediatorControl;
|
import nsusbloader.MediatorControl;
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
|
@ -24,7 +24,7 @@ import nsusbloader.MediatorControl;
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import nsusbloader.COM.Helpers.NSSplitReader;
|
import nsusbloader.com.helpers.NSSplitReader;
|
||||||
import org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
import org.usb4java.LibUsb;
|
import org.usb4java.LibUsb;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.PFS;
|
package nsusbloader.com.usb.PFS;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.PFS;
|
package nsusbloader.com.usb.PFS;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
|
@ -16,13 +16,13 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import nsusbloader.COM.Helpers.NSSplitReader;
|
import nsusbloader.com.helpers.NSSplitReader;
|
||||||
import org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
import org.usb4java.LibUsb;
|
import org.usb4java.LibUsb;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
|
@ -16,9 +16,8 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.common.DeviceInformation;
|
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
||||||
import nsusbloader.NSLDataTypes.EMsgType;
|
import nsusbloader.NSLDataTypes.EMsgType;
|
||||||
import org.usb4java.*;
|
import org.usb4java.*;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import org.usb4java.LibUsb;
|
import org.usb4java.LibUsb;
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.common;
|
package nsusbloader.com.usb.common;
|
||||||
|
|
||||||
import nsusbloader.COM.USB.UsbErrorCodes;
|
import nsusbloader.com.usb.UsbErrorCodes;
|
||||||
import org.usb4java.*;
|
import org.usb4java.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.common;
|
package nsusbloader.com.usb.common;
|
||||||
|
|
||||||
import org.usb4java.EndpointDescriptor;
|
import org.usb4java.EndpointDescriptor;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.common;
|
package nsusbloader.com.usb.common;
|
||||||
|
|
||||||
import org.usb4java.EndpointDescriptor;
|
import org.usb4java.EndpointDescriptor;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.common;
|
package nsusbloader.com.usb.common;
|
||||||
|
|
||||||
import org.usb4java.Interface;
|
import org.usb4java.Interface;
|
||||||
import org.usb4java.InterfaceDescriptor;
|
import org.usb4java.InterfaceDescriptor;
|
|
@ -16,13 +16,10 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
along with NS-USBloader. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package nsusbloader.COM.USB.common;
|
package nsusbloader.com.usb.common;
|
||||||
|
|
||||||
import org.usb4java.EndpointDescriptor;
|
|
||||||
import org.usb4java.InterfaceDescriptor;
|
import org.usb4java.InterfaceDescriptor;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
public class NsUsbInterfaceDescriptor {
|
public class NsUsbInterfaceDescriptor {
|
||||||
private final byte bLength;
|
private final byte bLength;
|
||||||
private final byte bDescriptorType;
|
private final byte bDescriptorType;
|
|
@ -1,4 +1,4 @@
|
||||||
package nsusbloader.COM.USB;
|
package nsusbloader.com.usb;
|
||||||
|
|
||||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||||
import nsusbloader.ModelControllers.ILogPrinter;
|
import nsusbloader.ModelControllers.ILogPrinter;
|
Loading…
Reference in a new issue