Solve - #87. Break LogPrinterGui

This commit is contained in:
Dmitry Isaenko 2021-08-09 22:47:52 +03:00
parent 79c519b1f3
commit 1176ad9e83
32 changed files with 1348 additions and 738 deletions

View file

@ -38,8 +38,8 @@ public class NxdtTask extends CancellableRunnable {
@Override
public void run() {
logPrinter.print("Save to location: "+ saveToLocation, EMsgType.INFO);
logPrinter.print("=============== nxdumptool ===============", EMsgType.INFO);
print("Save to location: "+ saveToLocation, EMsgType.INFO);
print("=============== nxdumptool ===============", EMsgType.INFO);
UsbConnect usbConnect = UsbConnect.connectHomebrewMode(logPrinter);
@ -54,13 +54,22 @@ public class NxdtTask extends CancellableRunnable {
new NxdtUsbAbi1(handler, logPrinter, saveToLocation, this);
}
catch (Exception e){
logPrinter.print(e.getMessage(), EMsgType.FAIL);
print(e.getMessage(), EMsgType.FAIL);
}
logPrinter.print(".:: Complete ::.", EMsgType.PASS);
print(".:: Complete ::.", EMsgType.PASS);
usbConnect.close();
logPrinter.updateOneLinerStatus(true);
logPrinter.close();
}
private void print(String message, EMsgType type){
try {
logPrinter.print(message, type);
}
catch (InterruptedException ie){
ie.printStackTrace();
}
}
}

View file

@ -119,7 +119,7 @@ class NxdtUsbAbi1 {
USBSTATUS_SUCCESS[9] = (byte)((endpointMaxPacketSize >> 8) & 0xFF);
}
private void readLoop(){
private void readLoop() throws InterruptedException{
logPrinter.print("Awaiting for handshake", EMsgType.INFO);
try {
byte[] directive;
@ -292,7 +292,7 @@ class NxdtUsbAbi1 {
return nspFile != null;
}
private String getAbsoluteFilePath(String filename) throws Exception{
private String getAbsoluteFilePath(String filename) {
if (isRomFs(filename) && isWindows) // Since RomFS entry starts from '/' it should be replaced to '\'.
return saveToPath + filename.replaceAll("/", "\\\\");
return saveToPath + filename;