This commit is contained in:
parent
c8efebfcff
commit
db7855765f
13 changed files with 275 additions and 1392 deletions
|
@ -79,7 +79,8 @@ Sometimes I add new posts about this project [on my blog page](https://developer
|
||||||
| v0.7 - 0.7.3 | v0.7+ |
|
| v0.7 - 0.7.3 | v0.7+ |
|
||||||
| v0.8 - 0.9 | v1.0+ |
|
| v0.8 - 0.9 | v1.0+ |
|
||||||
| v0.10 - 1.0.0 | v6.0+ |
|
| v0.10 - 1.0.0 | v6.0+ |
|
||||||
| v1.0.0 | v7.3+ |
|
| v1.1.0 | none |
|
||||||
|
| v1.1.1 | v7.3+ |
|
||||||
|
|
||||||
where '+' means 'any next NS-USBloader version'.
|
where '+' means 'any next NS-USBloader version'.
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class AppPreferences {
|
||||||
|
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final Locale locale;
|
private final Locale locale;
|
||||||
public static final String[] GOLDLEAF_SUPPORTED_VERSIONS = {"v0.5", "v0.7.x", "v0.8-0.9", "v0.10-1.0.0", "v1.1.0+"};
|
public static final String[] GOLDLEAF_SUPPORTED_VERSIONS = {"v0.5", "v0.7.x", "v0.8-0.9", "v0.10-1.0.0", "v1.1.1"};
|
||||||
private static final Font DEFAULT_FONT = Font.getDefault();
|
private static final Font DEFAULT_FONT = Font.getDefault();
|
||||||
|
|
||||||
private AppPreferences(){
|
private AppPreferences(){
|
||||||
|
|
|
@ -395,7 +395,7 @@ public class GamesController implements Initializable, ISubscriber {
|
||||||
// If USB selected
|
// If USB selected
|
||||||
if (isGoldLeaf()){
|
if (isGoldLeaf()){
|
||||||
final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
|
final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
|
||||||
usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
|
usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf " + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (getSelectedNetUsb().equals("USB")){
|
if (getSelectedNetUsb().equals("USB")){
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class GoldLeafCli {
|
||||||
|
|
||||||
private void runGoldLeafBackend() throws InterruptedException {
|
private void runGoldLeafBackend() throws InterruptedException {
|
||||||
Runnable task = new UsbCommunications(filesList,
|
Runnable task = new UsbCommunications(filesList,
|
||||||
"GoldLeaf"+goldLeafVersion,
|
"GoldLeaf "+goldLeafVersion,
|
||||||
filterForNsp);
|
filterForNsp);
|
||||||
Thread thread = new Thread(task);
|
Thread thread = new Thread(task);
|
||||||
thread.setDaemon(true);
|
thread.setDaemon(true);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -68,16 +68,16 @@ public class UsbCommunications extends CancellableRunnable {
|
||||||
case "TinFoil":
|
case "TinFoil":
|
||||||
module = new TinFoil(handler, nspMap, this, logPrinter);
|
module = new TinFoil(handler, nspMap, this, logPrinter);
|
||||||
break;
|
break;
|
||||||
case "GoldLeafv1.1.0+":
|
case "GoldLeaf v1.1.1":
|
||||||
module = new GoldLeaf_111(handler, nspMap, this, logPrinter, nspFilterForGl);
|
module = new GoldLeaf_111(handler, nspMap, this, logPrinter, nspFilterForGl);
|
||||||
break;
|
break;
|
||||||
case "GoldLeafv0.10-1.0.0":
|
case "GoldLeaf v0.10-1.0.0":
|
||||||
module = new GoldLeaf_010(handler, nspMap, this, logPrinter, nspFilterForGl);
|
module = new GoldLeaf_010(handler, nspMap, this, logPrinter, nspFilterForGl);
|
||||||
break;
|
break;
|
||||||
case "GoldLeafv0.8-0.9":
|
case "GoldLeaf v0.8-0.9":
|
||||||
module = new GoldLeaf_08(handler, nspMap, this, logPrinter, nspFilterForGl);
|
module = new GoldLeaf_08(handler, nspMap, this, logPrinter, nspFilterForGl);
|
||||||
break;
|
break;
|
||||||
case "GoldLeafv0.7.x":
|
case "GoldLeaf v0.7.x":
|
||||||
module = new GoldLeaf_07(handler, nspMap, this, logPrinter, nspFilterForGl);
|
module = new GoldLeaf_07(handler, nspMap, this, logPrinter, nspFilterForGl);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
23
src/main/java/nsusbloader/com/usb/gl/GlString.java
Normal file
23
src/main/java/nsusbloader/com/usb/gl/GlString.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
Copyright 2019-2025 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.com.usb.gl;
|
||||||
|
|
||||||
|
public interface GlString {
|
||||||
|
int length();
|
||||||
|
}
|
44
src/main/java/nsusbloader/com/usb/gl/GlString010.java
Normal file
44
src/main/java/nsusbloader/com/usb/gl/GlString010.java
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
Copyright 2019-2025 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.com.usb.gl;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import static nsusbloader.com.usb.gl.Converters.arrToIntLE;
|
||||||
|
|
||||||
|
/* Separated from interface for easier fixes/replacement in future */
|
||||||
|
public class GlString010 implements GlString {
|
||||||
|
|
||||||
|
private final int length;
|
||||||
|
private final String string;
|
||||||
|
|
||||||
|
public GlString010(byte[] inputBytes, int startPosition){
|
||||||
|
this.length = arrToIntLE(inputBytes, startPosition);
|
||||||
|
this.string = new String(inputBytes, startPosition+4, length, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int length(){
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,14 +20,12 @@ package nsusbloader.com.usb.gl;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import libKonogonka.RainbowDump;
|
|
||||||
import nsusbloader.MediatorControl;
|
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 nsusbloader.com.usb.TransferModule;
|
import nsusbloader.com.usb.TransferModule;
|
||||||
import nsusbloader.com.usb.UsbErrorCodes;
|
|
||||||
import org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
import org.usb4java.LibUsb;
|
import org.usb4java.LibUsb;
|
||||||
|
|
||||||
|
@ -73,11 +71,11 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
protected NSSplitReader splitReader;
|
protected NSSplitReader splitReader;
|
||||||
|
|
||||||
private final HashMap<String, BufferedOutputStream> writeFilesMap = new HashMap<>();
|
private final HashMap<String, BufferedOutputStream> writeFilesMap = new HashMap<>();
|
||||||
private long virtDriveSize;
|
protected long virtDriveSize;
|
||||||
private final HashMap<String, Long> splitFileSize = new HashMap<>();
|
private final HashMap<String, Long> splitFileSize = new HashMap<>();
|
||||||
|
|
||||||
private final boolean isWindows = System.getProperty("os.name").contains("Windows");
|
private final boolean isWindows = System.getProperty("os.name").contains("Windows");
|
||||||
private final String homePath = System.getProperty("user.home");
|
protected final String homePath = System.getProperty("user.home");
|
||||||
// For using in CMD_SelectFile with SPEC:/ prefix
|
// For using in CMD_SelectFile with SPEC:/ prefix
|
||||||
protected File selectedFile;
|
protected File selectedFile;
|
||||||
|
|
||||||
|
@ -90,9 +88,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
|
|
||||||
this.nspFilter = nspFilter;
|
this.nspFilter = nspFilter;
|
||||||
|
|
||||||
print("=========== GoldLeaf v0.10-1.0.0 ===========\n\t" +
|
printWelcomeMessage();
|
||||||
"VIRT:/ equals files added into the application\n\t" +
|
|
||||||
"HOME:/ equals " + homePath, EMsgType.INFO);
|
|
||||||
|
|
||||||
// Let's collect file names to the array (simplifies flow)
|
// Let's collect file names to the array (simplifies flow)
|
||||||
nspMapKeySetIndexes = nspMap.keySet().toArray(new String[0]);
|
nspMapKeySetIndexes = nspMap.keySet().toArray(new String[0]);
|
||||||
|
@ -113,106 +109,8 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go parse commands
|
// Go parse commands
|
||||||
main_loop:
|
if (workLoop())
|
||||||
while (true) { // Till user interrupted process.
|
return;
|
||||||
int someLength1, someLength2;
|
|
||||||
var readByte = readGL();
|
|
||||||
|
|
||||||
if (readByte == null) // Issue @ readFromUsbGL method
|
|
||||||
return;
|
|
||||||
|
|
||||||
//RainbowDump.hexDumpUTF8(readByte); // DEBUG
|
|
||||||
System.out.println("\t→ "+ GoldleafCmd.get(readByte[4]));
|
|
||||||
|
|
||||||
if (notGLCI(readByte))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
switch (GoldleafCmd.get(readByte[4])) {
|
|
||||||
case GetDriveCount:
|
|
||||||
if (getDriveCount())
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetDriveInfo:
|
|
||||||
if (getDriveInfo(arrToIntLE(readByte,8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetSpecialPathCount:
|
|
||||||
if (getSpecialPathCount())
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetSpecialPath:
|
|
||||||
if (getSpecialPath(arrToIntLE(readByte,8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetDirectoryCount:
|
|
||||||
RainbowDump.hexDumpUTF8(readByte); // DEBUG
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (getDirectoryOrFileCount(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), true))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetFileCount:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (getDirectoryOrFileCount(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), false))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetDirectory:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (getDirectory(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), arrToIntLE(readByte, someLength1+12)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case GetFile:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (getFile(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), arrToIntLE(readByte, someLength1+12)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case StatPath:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (statPath(new String(readByte, 12, someLength1, StandardCharsets.UTF_8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case Rename:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
someLength2 = arrToIntLE(readByte, 12+someLength1);
|
|
||||||
if (rename(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), // 8+4=12
|
|
||||||
new String(readByte, 12+someLength1+4, someLength2, StandardCharsets.UTF_8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case Delete:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (delete(new String(readByte, 12, someLength1, StandardCharsets.UTF_8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case Create:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (create(new String(readByte, 12, someLength1, StandardCharsets.UTF_8), readByte[8]))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case ReadFile:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (readFile(new String(readByte, 12, someLength1, StandardCharsets.UTF_8),
|
|
||||||
arrToLongLE(readByte, 12+someLength1),
|
|
||||||
arrToLongLE(readByte, 12+someLength1+8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case WriteFile:
|
|
||||||
someLength1 = arrToIntLE(readByte, 8);
|
|
||||||
if (writeFile(new String(readByte, 12, someLength1, StandardCharsets.UTF_8)))
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case SelectFile:
|
|
||||||
if (selectFile())
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case StartFile:
|
|
||||||
case EndFile:
|
|
||||||
if (startOrEndFile())
|
|
||||||
break main_loop;
|
|
||||||
break;
|
|
||||||
case CMD_UNKNOWN:
|
|
||||||
default:
|
|
||||||
writeGL_FAIL(EXCEPTION_CAUGHT, "GL Unknown command: "+readByte[4]+" [it's a very bad sign]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Close (and flush) all opened streams.
|
// Close (and flush) all opened streams.
|
||||||
for (var bufferedOutputStream: writeFilesMap.values()){
|
for (var bufferedOutputStream: writeFilesMap.values()){
|
||||||
try{
|
try{
|
||||||
|
@ -221,7 +119,112 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
}
|
}
|
||||||
closeOpenedReadFilesGl();
|
closeOpenedReadFilesGl();
|
||||||
}
|
}
|
||||||
private boolean notGLCI(byte[] inputBytes){
|
|
||||||
|
protected void printWelcomeMessage(){
|
||||||
|
print("=========== GoldLeaf v0.10-1.0.0 ===========\n\t" +
|
||||||
|
"VIRT:/ equals files added into the application\n\t" +
|
||||||
|
"HOME:/ equals " + homePath, EMsgType.INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean workLoop(){
|
||||||
|
while (true) { // Till user interrupted process.
|
||||||
|
GlString glString1;
|
||||||
|
var readByte = readGL();
|
||||||
|
|
||||||
|
if (readByte == null) // Issue @ readFromUsbGL method
|
||||||
|
return true;
|
||||||
|
|
||||||
|
//RainbowDump.hexDumpUTF8(readByte); // DEBUG
|
||||||
|
//print("\t→ "+ GoldleafCmd.get(readByte[4]), EMsgType.INFO);
|
||||||
|
|
||||||
|
if (notGLCI(readByte))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
switch (GoldleafCmd.get(readByte[4])) {
|
||||||
|
case GetDriveCount:
|
||||||
|
if (getDriveCount())
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetDriveInfo:
|
||||||
|
if (getDriveInfo(arrToIntLE(readByte,8)))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetSpecialPathCount:
|
||||||
|
if (getSpecialPathCount())
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetSpecialPath:
|
||||||
|
if (getSpecialPath(arrToIntLE(readByte,8)))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetDirectoryCount:
|
||||||
|
if (getDirectoryOrFileCount(readString(readByte, 8).toString(), true))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetFileCount:
|
||||||
|
if (getDirectoryOrFileCount(readString(readByte, 8).toString(), false))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetDirectory:
|
||||||
|
glString1 = readString(readByte, 8);
|
||||||
|
if (getDirectory(glString1.toString(), arrToIntLE(readByte, glString1.length()+12)))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GetFile:
|
||||||
|
glString1 = readString(readByte, 8);
|
||||||
|
if (getFile(glString1.toString(), arrToIntLE(readByte, glString1.length()+12)))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case StatPath:
|
||||||
|
if (statPath(readString(readByte, 8).toString()))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case Rename:
|
||||||
|
glString1 = readString(readByte, 8);
|
||||||
|
var glString2 = readString(readByte, 12+glString1.length());
|
||||||
|
if (rename(glString1.toString(), glString2.toString()))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case Delete:
|
||||||
|
if (delete(readString(readByte, 8).toString()))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case Create:
|
||||||
|
if (create(readString(readByte, 8).toString(), readByte[8]))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case ReadFile:
|
||||||
|
glString1 = readString(readByte, 8);
|
||||||
|
if (readFile(glString1.toString(),
|
||||||
|
arrToLongLE(readByte, 12+glString1.length()),
|
||||||
|
arrToLongLE(readByte, 12+glString1.length()+8)))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case WriteFile:
|
||||||
|
if (writeFile(readString(readByte, 8).toString()))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case SelectFile:
|
||||||
|
if (selectFile())
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case StartFile:
|
||||||
|
case EndFile:
|
||||||
|
if (startOrEndFile())
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case CMD_UNKNOWN:
|
||||||
|
default:
|
||||||
|
writeGL_FAIL(EXCEPTION_CAUGHT, "GL Unknown command: "+readByte[4]+" [it's a very bad sign]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GlString readString(byte[] readByte, int startPosition){
|
||||||
|
return new GlString010(readByte, startPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean notGLCI(byte[] inputBytes){
|
||||||
return ! "GLCI".equals(new String(inputBytes, 0, 4, StandardCharsets.US_ASCII));
|
return ! "GLCI".equals(new String(inputBytes, 0, 4, StandardCharsets.US_ASCII));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +233,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* NOTE: It's something internal for GL and used somehow by GL-PC-app, so just ignore this, at least for v0.8.
|
* NOTE: It's something internal for GL and used somehow by GL-PC-app, so just ignore this, at least for v0.8.
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean startOrEndFile(){
|
protected boolean startOrEndFile(){
|
||||||
return writeGL_PASS("GL Handle 'StartFile' command");
|
return writeGL_PASS("GL Handle 'StartFile' command");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -238,14 +241,14 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* 2 drives declared in current implementation
|
* 2 drives declared in current implementation
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
*/
|
*/
|
||||||
private boolean getDriveCount(){
|
protected boolean getDriveCount(){
|
||||||
return writeGL_PASS(intToArrLE(2),"GL Handle 'ListDrives' command");
|
return writeGL_PASS(intToArrLE(2),"GL Handle 'ListDrives' command");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handle GetDriveInfo
|
* Handle GetDriveInfo
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
*/
|
*/
|
||||||
private boolean getDriveInfo(int driveNo){
|
protected boolean getDriveInfo(int driveNo){
|
||||||
if (driveNo < 0 || driveNo > 1)
|
if (driveNo < 0 || driveNo > 1)
|
||||||
return writeGL_FAIL(INVALID_INDEX, "GL Handle 'GetDriveInfo' command [no such drive]");
|
return writeGL_FAIL(INVALID_INDEX, "GL Handle 'GetDriveInfo' command [no such drive]");
|
||||||
|
|
||||||
|
@ -290,21 +293,21 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Let's declare nothing. Write count of special paths
|
* Let's declare nothing. Write count of special paths
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean getSpecialPathCount(){
|
protected boolean getSpecialPathCount(){
|
||||||
return writeGL_PASS(intToArrLE(0), "GL Handle 'SpecialPathCount' command");
|
return writeGL_PASS(intToArrLE(0), "GL Handle 'SpecialPathCount' command");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handle SpecialPath
|
* Handle SpecialPath
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean getSpecialPath(int specialPathNo){
|
protected boolean getSpecialPath(int specialPathNo){
|
||||||
return writeGL_FAIL(INVALID_INDEX, "GL Handle 'SpecialPath' command [not supported]");
|
return writeGL_FAIL(INVALID_INDEX, "GL Handle 'SpecialPath' command [not supported]");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handle GetDirectoryCount & GetFileCount
|
* Handle GetDirectoryCount & GetFileCount
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean getDirectoryOrFileCount(String glFileName, boolean isGetDirectoryCount) {
|
protected boolean getDirectoryOrFileCount(String glFileName, boolean isGetDirectoryCount) {
|
||||||
if (glFileName.equals("VIRT:/")) {
|
if (glFileName.equals("VIRT:/")) {
|
||||||
return isGetDirectoryCount ?
|
return isGetDirectoryCount ?
|
||||||
writeGL_PASS("GL Handle 'GetDirectoryCount' command") :
|
writeGL_PASS("GL Handle 'GetDirectoryCount' command") :
|
||||||
|
@ -350,7 +353,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle GetDirectory
|
* Handle GetDirectory
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean getDirectory(String dirName, int subDirNo){
|
protected boolean getDirectory(String dirName, int subDirNo){
|
||||||
if (dirName.startsWith("HOME:/")) {
|
if (dirName.startsWith("HOME:/")) {
|
||||||
dirName = decodeGlPath(dirName);
|
dirName = decodeGlPath(dirName);
|
||||||
|
|
||||||
|
@ -388,7 +391,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle GetFile
|
* Handle GetFile
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean getFile(String glDirName, int subDirNo){
|
protected boolean getFile(String glDirName, int subDirNo){
|
||||||
var command = new LinkedList<byte[]>();
|
var command = new LinkedList<byte[]>();
|
||||||
|
|
||||||
if (glDirName.startsWith("HOME:/")) {
|
if (glDirName.startsWith("HOME:/")) {
|
||||||
|
@ -436,7 +439,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle StatPath
|
* Handle StatPath
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean statPath(String glFileName){
|
protected boolean statPath(String glFileName){
|
||||||
var command = new ArrayList<byte[]>();
|
var command = new ArrayList<byte[]>();
|
||||||
|
|
||||||
if (glFileName.startsWith("HOME:/")){
|
if (glFileName.startsWith("HOME:/")){
|
||||||
|
@ -478,7 +481,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle 'Rename' that is actually 'mv'
|
* Handle 'Rename' that is actually 'mv'
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean rename(String glFileName, String glNewFileName){
|
protected boolean rename(String glFileName, String glNewFileName){
|
||||||
if (glFileName.startsWith("HOME:/")){
|
if (glFileName.startsWith("HOME:/")){
|
||||||
// Prevent GL failures
|
// Prevent GL failures
|
||||||
this.recentPath = null;
|
this.recentPath = null;
|
||||||
|
@ -505,7 +508,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle 'Delete'
|
* Handle 'Delete'
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean delete(String glFileName) {
|
protected boolean delete(String glFileName) {
|
||||||
if (! glFileName.startsWith("HOME:/"))
|
if (! glFileName.startsWith("HOME:/"))
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'Delete' command [not supported for virtual drive/wrong drive/read-only directory] "+glFileName);
|
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'Delete' command [not supported for virtual drive/wrong drive/read-only directory] "+glFileName);
|
||||||
|
|
||||||
|
@ -524,7 +527,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* @param glFileName full path including new file name in the end
|
* @param glFileName full path including new file name in the end
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean create(String glFileName, byte type) {
|
protected boolean create(String glFileName, byte type) {
|
||||||
if (! glFileName.startsWith("HOME:/")) // For VIRT:/ and others we don't serve requests
|
if (! glFileName.startsWith("HOME:/")) // For VIRT:/ and others we don't serve requests
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'Create' command [not supported for virtual drive/wrong drive/read-only directory]"+glFileName);
|
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'Create' command [not supported for virtual drive/wrong drive/read-only directory]"+glFileName);
|
||||||
|
|
||||||
|
@ -553,7 +556,6 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* */
|
* */
|
||||||
protected boolean readFile(String glFileName, long offset, long size) {
|
protected boolean readFile(String glFileName, long offset, long size) {
|
||||||
var fileName = glFileName.replaceFirst("^.*?:/", "");
|
var fileName = glFileName.replaceFirst("^.*?:/", "");
|
||||||
System.out.println(fileName+" readFile "+glFileName+"\t"+offset+"\t"+size+"\n");
|
|
||||||
if (glFileName.startsWith("VIRT:/")){ // Could have split-file
|
if (glFileName.startsWith("VIRT:/")){ // Could have split-file
|
||||||
// Let's find out which file requested
|
// Let's find out which file requested
|
||||||
var fNamePath = nspMap.get(fileName).getAbsolutePath(); // NOTE: 6 = "VIRT:/".length
|
var fNamePath = nspMap.get(fileName).getAbsolutePath(); // NOTE: 6 = "VIRT:/".length
|
||||||
|
@ -623,16 +625,12 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
"\n Requested: " + size +
|
"\n Requested: " + size +
|
||||||
"\n Received: " + bytesRead);
|
"\n Received: " + bytesRead);
|
||||||
if (writeGL_PASS(longToArrLE(size), "GL Handle 'ReadFile' command [CMD]")) { // Reporting result
|
if (writeGL_PASS(longToArrLE(size), "GL Handle 'ReadFile' command [CMD]")) { // Reporting result
|
||||||
System.out.println("SENT 1 -");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
System.out.println("SENT 1");
|
|
||||||
if (writeToUsb(chunk)) { // Bypassing bytes we read total // FIXME: move failure message into method
|
if (writeToUsb(chunk)) { // Bypassing bytes we read total // FIXME: move failure message into method
|
||||||
print("GL Handle 'ReadFile' command", EMsgType.FAIL);
|
print("GL Handle 'ReadFile' command", EMsgType.FAIL);
|
||||||
System.out.println("SENT 2 -");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
System.out.println("SENT 2");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception ioe){
|
catch (Exception ioe){
|
||||||
|
@ -645,7 +643,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* @param glFileName full path including new file name in the end
|
* @param glFileName full path including new file name in the end
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean writeFile(String glFileName) {
|
boolean writeFile(String glFileName) {
|
||||||
if (glFileName.startsWith("VIRT:/"))
|
if (glFileName.startsWith("VIRT:/"))
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'WriteFile' command [not supported for virtual drive]");
|
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'WriteFile' command [not supported for virtual drive]");
|
||||||
|
|
||||||
|
@ -680,7 +678,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
* Handle 'SelectFile'
|
* Handle 'SelectFile'
|
||||||
* @return true - failed, false - passed
|
* @return true - failed, false - passed
|
||||||
* */
|
* */
|
||||||
private boolean selectFile(){
|
protected boolean selectFile(){
|
||||||
var selectedFile = CompletableFuture.supplyAsync(() -> {
|
var selectedFile = CompletableFuture.supplyAsync(() -> {
|
||||||
var fChooser = new FileChooser();
|
var fChooser = new FileChooser();
|
||||||
fChooser.setTitle(MediatorControl.INSTANCE.getResourceBundle().getString("btn_OpenFile")); // TODO: FIX BAD IMPLEMENTATION
|
fChooser.setTitle(MediatorControl.INSTANCE.getResourceBundle().getString("btn_OpenFile")); // TODO: FIX BAD IMPLEMENTATION
|
||||||
|
@ -768,7 +766,7 @@ public class GoldLeaf_010 extends TransferModule {
|
||||||
/* GL READ/WRITE USB SPECIFIC */
|
/* GL READ/WRITE USB SPECIFIC */
|
||||||
/*----------------------------------------------------*/
|
/*----------------------------------------------------*/
|
||||||
|
|
||||||
private byte[] readGL(){
|
protected byte[] readGL(){
|
||||||
var readBuffer = ByteBuffer.allocateDirect(PACKET_SIZE);
|
var readBuffer = ByteBuffer.allocateDirect(PACKET_SIZE);
|
||||||
var readBufTransferred = IntBuffer.allocate(1);
|
var readBufTransferred = IntBuffer.allocate(1);
|
||||||
|
|
||||||
|
|
|
@ -21,22 +21,19 @@ package nsusbloader.com.usb.gl;
|
||||||
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 org.usb4java.DeviceHandle;
|
import org.usb4java.DeviceHandle;
|
||||||
import org.usb4java.LibUsb;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.IntBuffer;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static nsusbloader.com.usb.gl.Converters.longToArrLE;
|
import static nsusbloader.com.usb.gl.Converters.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GoldLeaf 1.1.1 processing
|
* GoldLeaf 1.1.1 processing
|
||||||
*/
|
*/
|
||||||
public class GoldLeaf_111 extends GoldLeaf_010{
|
public class GoldLeaf_111 extends GoldLeaf_010{
|
||||||
|
|
||||||
public GoldLeaf_111(DeviceHandle handler, LinkedHashMap<String, File> nspMap,
|
public GoldLeaf_111(DeviceHandle handler, LinkedHashMap<String, File> nspMap,
|
||||||
CancellableRunnable task,
|
CancellableRunnable task,
|
||||||
ILogPrinter logPrinter,
|
ILogPrinter logPrinter,
|
||||||
|
@ -45,127 +42,77 @@ public class GoldLeaf_111 extends GoldLeaf_010{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean readFile(String glFileName, long offset, long size) {
|
protected void printWelcomeMessage(){
|
||||||
var fileName = glFileName.replaceFirst("^.*?:/", "");
|
print("=========== GoldLeaf v1.1.1 ===========\n\t" +
|
||||||
System.out.println(fileName+" readFile "+glFileName+"\t"+offset+"\t"+size+"\n");
|
"VIRT:/ equals files added into the application\n\t" +
|
||||||
if (glFileName.startsWith("VIRT:/")){ // Could have split-file
|
"HOME:/ equals " + homePath + "\n\t" +
|
||||||
// Let's find out which file requested
|
"BE CAREFUL!\n\t" +
|
||||||
var fNamePath = nspMap.get(fileName).getAbsolutePath(); // NOTE: 6 = "VIRT:/".length
|
"Due to some strange behaviour with Goldleaf v1.1.1, you will see last menu entry " +
|
||||||
// If we don't have this file opened, let's open it
|
"'Do not click (crashes Atmosphere)'\n\t" +
|
||||||
if (openReadFileNameAndPath == null || (! openReadFileNameAndPath.equals(fNamePath))) {
|
"You should better not clicking on it", EMsgType.INFO);
|
||||||
if (openReadFileNameAndPath != null) // (Try to) close what opened
|
|
||||||
closeRAFandSplitReader();
|
|
||||||
try{ // And open the rest
|
|
||||||
var tempFile = nspMap.get(fileName);
|
|
||||||
if (tempFile.isDirectory()) {
|
|
||||||
randAccessFile = null;
|
|
||||||
splitReader = new NSSplitReader(tempFile, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
splitReader = null;
|
|
||||||
randAccessFile = new RandomAccessFile(tempFile, "r");
|
|
||||||
}
|
|
||||||
openReadFileNameAndPath = fNamePath;
|
|
||||||
}
|
|
||||||
catch (IOException | NullPointerException ioe){
|
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'ReadFile' command\n\t"+ioe.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // SPEC:/ & HOME:/
|
|
||||||
String filePath;
|
|
||||||
|
|
||||||
if (glFileName.startsWith("SPEC:/")) {
|
|
||||||
if (! fileName.equals(selectedFile.getName())) {
|
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'ReadFile' command\n\trequested != selected:\n\t"
|
|
||||||
+ glFileName + "\n\t" + selectedFile);
|
|
||||||
}
|
|
||||||
filePath = selectedFile.getAbsolutePath();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
filePath = decodeGlPath(glFileName); // What requested?
|
|
||||||
}
|
|
||||||
// If we don't have this file opened, let's open it
|
|
||||||
if (openReadFileNameAndPath == null || (! openReadFileNameAndPath.equals(filePath))) {
|
|
||||||
if (openReadFileNameAndPath != null) // Try close what opened
|
|
||||||
closeRAF();
|
|
||||||
try{ // Open what has to be opened
|
|
||||||
randAccessFile = new RandomAccessFile(filePath, "r");
|
|
||||||
openReadFileNameAndPath = filePath;
|
|
||||||
}catch (IOException | NullPointerException ioe){
|
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'ReadFile' command\n\t"+ioe.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//----------------------- Actual transfer chain ------------------------
|
|
||||||
try{
|
|
||||||
var chunk = new byte[(int)size];
|
|
||||||
int bytesRead;
|
|
||||||
|
|
||||||
if (randAccessFile == null){
|
|
||||||
splitReader.seek(offset);
|
|
||||||
bytesRead = splitReader.read(chunk); // How many bytes we got?
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
randAccessFile.seek(offset);
|
|
||||||
bytesRead = randAccessFile.read(chunk); // How many bytes we got?
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bytesRead != (int) size) // Let's check that we read expected size
|
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'ReadFile' command [CMD]" +
|
|
||||||
"\n At offset: " + offset +
|
|
||||||
"\n Requested: " + size +
|
|
||||||
"\n Received: " + bytesRead);
|
|
||||||
if (writeGL_PASS(longToArrLE(size), "GL Handle 'ReadFile' command [CMD]")) { // Reporting result
|
|
||||||
System.out.println("+SENT 1 -");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
System.out.println("+SENT 1");
|
|
||||||
if (writeToUsbV100(chunk)) { // Bypassing bytes we read total // FIXME: move failure message into method
|
|
||||||
print("GL Handle 'ReadFile' command", EMsgType.FAIL);
|
|
||||||
System.out.println("+SENT 2 -");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
System.out.println("+SENT 2");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch (Exception ioe){
|
|
||||||
closeOpenedReadFilesGl();
|
|
||||||
return writeGL_FAIL(EXCEPTION_CAUGHT, "GL Handle 'ReadFile' transfer chain\n\t"+ioe.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean writeToUsbV100(byte[] message) {
|
/**
|
||||||
var writeBufTransferred = IntBuffer.allocate(1);
|
* Fixes issues with incorrect request for 'Home' & 'Virtual'. Forces both to return 'HOME:/'
|
||||||
|
* v1.1.1 specific fix
|
||||||
|
* Otherwise v.1.1.1 returns 'HOME:/' once 'Virtual' requested and ':/' once requested 'Home'
|
||||||
|
* */
|
||||||
|
|
||||||
while (! task.isCancelled()) {
|
@Override
|
||||||
int result = LibUsb.bulkTransfer(handlerNS,
|
protected boolean getDriveCount(){
|
||||||
OUT_EP,
|
return writeGL_PASS(intToArrLE(3),"GL Handle 'ListDrives' command");
|
||||||
ByteBuffer.allocateDirect(message.length)
|
}
|
||||||
.order(ByteOrder.LITTLE_ENDIAN)
|
|
||||||
.put(message),
|
|
||||||
writeBufTransferred,
|
|
||||||
1000);
|
|
||||||
|
|
||||||
switch (result){
|
@Override
|
||||||
case LibUsb.SUCCESS:
|
protected boolean getDriveInfo(int driveNo){
|
||||||
if (writeBufTransferred.get() == message.length)
|
if (driveNo < 0 || driveNo > 2)
|
||||||
return false;
|
return writeGL_FAIL(INVALID_INDEX, "GL Handle 'GetDriveInfo' command [no such drive]");
|
||||||
print("GL Data transfer issue [write]\n Requested: " +
|
|
||||||
message.length +
|
byte[] driveLabel,
|
||||||
"\n Transferred: "+writeBufTransferred.get(), EMsgType.FAIL);
|
driveLabelLen,
|
||||||
return true;
|
driveLetter,
|
||||||
case LibUsb.ERROR_TIMEOUT:
|
driveLetterLen,
|
||||||
print("GL Data transfer issue [write]", EMsgType.WARNING);
|
totalFreeSpace;
|
||||||
continue;
|
long totalSizeLong;
|
||||||
default:
|
|
||||||
print("GL Data transfer issue [write]\n Returned: " +
|
switch (driveNo){
|
||||||
LibUsb.errorName(result) +
|
case 0:
|
||||||
"\n GL Execution stopped", EMsgType.FAIL);
|
driveLabel = "Home".getBytes(StandardCharsets.UTF_8); // yes, it's hotfix
|
||||||
return true;
|
driveLabelLen = intToArrLE(driveLabel.length);
|
||||||
}
|
driveLetter = "VIRT".getBytes(StandardCharsets.UTF_8); // and this is fine
|
||||||
|
driveLetterLen = intToArrLE(driveLetter.length);
|
||||||
|
totalFreeSpace = new byte[4];
|
||||||
|
totalSizeLong = virtDriveSize;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
driveLabel = "Virtual".getBytes(StandardCharsets.UTF_8); // here as well
|
||||||
|
driveLabelLen = intToArrLE(driveLabel.length);
|
||||||
|
driveLetter = "HOME".getBytes(StandardCharsets.UTF_8); // and here
|
||||||
|
driveLetterLen = intToArrLE(driveLetter.length);
|
||||||
|
var userHomeDir = new File(System.getProperty("user.home"));
|
||||||
|
totalFreeSpace = Arrays.copyOfRange(longToArrLE(userHomeDir.getFreeSpace()), 0, 4);;
|
||||||
|
totalSizeLong = userHomeDir.getTotalSpace();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
driveLabel = "Do not click (crashes Atmosphere)".getBytes(StandardCharsets.UTF_8); // and this one is necessary too
|
||||||
|
driveLabelLen = intToArrLE(driveLabel.length);
|
||||||
|
driveLetter = "VIRT".getBytes(StandardCharsets.UTF_8);
|
||||||
|
driveLetterLen = intToArrLE(driveLetter.length);
|
||||||
|
totalFreeSpace = new byte[4];
|
||||||
|
totalSizeLong = virtDriveSize;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
print("GL Execution interrupted", EMsgType.INFO);
|
|
||||||
return true;
|
var totalSize = Arrays.copyOfRange(longToArrLE(totalSizeLong), 0, 4);
|
||||||
|
|
||||||
|
var command = Arrays.asList(
|
||||||
|
driveLabelLen,
|
||||||
|
driveLabel,
|
||||||
|
driveLetterLen,
|
||||||
|
driveLetter,
|
||||||
|
totalFreeSpace,
|
||||||
|
totalSize);
|
||||||
|
|
||||||
|
return writeGL_PASS(command, "GL Handle 'GetDriveInfo' command");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.junit.jupiter.api.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
//@Disabled
|
@Disabled
|
||||||
public class EsIntegrationTest {
|
public class EsIntegrationTest {
|
||||||
static String pathToFirmware;
|
static String pathToFirmware;
|
||||||
static String pathToFirmwares;
|
static String pathToFirmwares;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
//@Disabled
|
@Disabled
|
||||||
public class FsIntegrationTest {
|
public class FsIntegrationTest {
|
||||||
static String pathToFirmware;
|
static String pathToFirmware;
|
||||||
static String pathToFirmwares;
|
static String pathToFirmwares;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
//@Disabled
|
@Disabled
|
||||||
public class LoaderIntegrationTest {
|
public class LoaderIntegrationTest {
|
||||||
static String pathToAtmo;
|
static String pathToAtmo;
|
||||||
static String saveTo;
|
static String saveTo;
|
||||||
|
|
Loading…
Reference in a new issue