diff --git a/.gitignore b/.gitignore index 5cadfda..a2a5f14 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,6 @@ bin /tmp* UpdateGrabber.java updatetitles.csv -src/de/mas/jnustool/StarterPRIATE.java jar/tmp* -src/de/mas/jnustool/XMLGEN.java \ No newline at end of file +src/de/mas/jnustool/gui/UpdateChooserSpecial.java +src/de/mas/jnustool/StarterSpecial.java \ No newline at end of file diff --git a/jar/JNUSTool.jar b/jar/JNUSTool.jar index 52f7b47..f182849 100644 Binary files a/jar/JNUSTool.jar and b/jar/JNUSTool.jar differ diff --git a/jar/updatetitles.csv b/jar/updatetitles.csv index af59b9c..9604979 100644 --- a/jar/updatetitles.csv +++ b/jar/updatetitles.csv @@ -168,7 +168,7 @@ 0005000E-1014CF00;2;WUP;00HL;WUP-U-WCDE;WCDEHL;Coaster Crazy Deluxe;16,32 0005000E-1014D100;4;WUP;00CS;WUP-U-WKTP;WKTPCS;Scram Kitty and his Buddy on Rails;17,32 0005000E-1014D900;1;WUP;008P;WUP-P-APTJ;APTJ8P;PUYOPUYOTETRIS;16,32 -0005000E-1014DA00;1;WUP;0008;WUP-U-AMFJ;AMFJ08;Monster Hunter Frontier G;80,96,112,128,144,160,176,192,208,224,240,256,288,304,320,336,352,368,400,432,448,464,480,496,512,528,544,560,576,592,608,624,640,656,672,688,704,720,736,752,768,784,800,816,832,848,864,880,896,912,928,944,960,976,992,1008,1024,1040,1056,1072,1088,1104,1120,1136,1152,1168,1184,1200,1216,1232,1248,1264,1280,1296,1312,1328,1344,1360,1376,1392,1408,1424,1440,1456,1472,1488,1504,1520,1536,1552 +0005000E-1014DA00;1;WUP;0008;WUP-U-AMFJ;AMFJ08;Monster Hunter Frontier G;80,96,112,128,144,160,176,192,208,224,240,256,288,304,320,336,352,368,400,432,448,464,480,496,512,528,544,560,576,592,608,624,640,656,672,688,704,720,736,752,768,784,800,816,832,848,864,880,896,912,928,944,960,976,992,1008,1024,1040,1056,1072,1088,1104,1120,1136,1152,1168,1184,1200,1216,1232,1248,1264,1280,1296,1312,1328,1344,1360,1376,1392,1408,1424,1440,1456,1472,1488,1504,1520,1536,1552,1568,1584 0005000E-1014DE00;2;WUP;00WR;WUP-U-ALAE;ALAEWR;The LEGO® Movie Videogame;16 0005000E-1014E000;4;WUP;00WR;WUP-U-ALAP;ALAPWR;The LEGO® Movie Videogame;18 0005000E-1014E100;4;WUP;00AF;WUP-U-ADVP;ADVPAF;Adventure Time: Explore the Dungeon Because I Don't Know!;16 @@ -303,11 +303,11 @@ 0005000E-101B9000;2;WUP;0041;WUP-P-AJ6E;AJ6E41;JUST DANCE® 2016;16,32 0005000E-101B9800;4;WUP;0041;WUP-P-AJ6P;AJ6P41;JUST DANCE® 2016;16,32 0005000E-101B9900;4;WUP;00AF;WUP-P-APHP;APHPAF;LOST REAVERS;16 -0005000E-101BA400;2;WUP;0052;WUP-P-AGNE;AGNE52;Guitar Hero Live;16,32,48,64,80 +0005000E-101BA400;2;WUP;0052;WUP-P-AGNE;AGNE52;Guitar Hero Live;16,32,48,64,80,96 0005000E-101BAA00;2;WUP;010C;WUP-U-ATTE;ATTE0C;Totem Topple;16,33 0005000E-101BB300;4;WUP;008V;WUP-P-WLSP;WLSP8V;ZaciSa: Defense of the Crayon Dimension!;16 0005000E-101BB800;4;WUP;011A;WUP-P-BEQP;BEQP1A;Elliot Quest;16,32,48,64,80,97 -0005000E-101BC600;4;WUP;0052;WUP-P-AGNP;AGNP52;Guitar Hero Live;18,32,48,64,80 +0005000E-101BC600;4;WUP;0052;WUP-P-AGNP;AGNP52;Guitar Hero Live;18,32,48,64,80,96 0005000E-101BE900;4;WUP;00WR;WUP-P-ALRP;ALRPWR;LEGO® MARVEL's Avengers;16,33,48,64 0005000E-101BEC00;2;WUP;0001;WUP-U-BWFE;BWFE01;Star Fox Guard;16 0005000E-101BED00;4;WUP;0001;WUP-U-BWFP;BWFP01;Star Fox Guard;16 @@ -372,4 +372,4 @@ 0005000E-101EA100;1;WUP;00WR;WUP-P-ALRJ;ALRJWR;LEGO® MARVEL's Avengers;18 0005000E-101ED800;2;WUP;0001;WUP-U-ASEE;ASEE01;Tokyo Mirage Sessions #FE;16 0005000E-101F2700;4;WUP;017P;WUP-P-BY2P;BY2P7P;Star Sky 2;16 -0005000E-101F7700;4;WUP;017D;WUP-P-AHYP;AHYP7D;PixelMaker;16 +0005000E-101F7700;4;WUP;017D;WUP-P-AHYP;AHYP7D;PixelMaker;16,32 diff --git a/release.zip b/release.zip index e161b42..70d63ae 100644 Binary files a/release.zip and b/release.zip differ diff --git a/src/de/mas/jnustool/FEntry.java b/src/de/mas/jnustool/FEntry.java index 1b0b0dc..037b1e4 100644 --- a/src/de/mas/jnustool/FEntry.java +++ b/src/de/mas/jnustool/FEntry.java @@ -195,7 +195,13 @@ public class FEntry implements IHasName{ } } Logger.log("Downloading: " + String.format("%8.2f MB ", getFileLength()/1024.0/1024.0) + getFullPath()); - Downloader.getInstance().downloadAndDecrypt(this,progress,false); + try{ + Downloader.getInstance().downloadAndDecrypt(this,progress,false); + }catch(Exception e){ + e.printStackTrace(); + System.err.println(this.fst.getTmd().getNUSTitle().getLongNameFolder() + " connection failed."); + } + } catch (IOException e) { diff --git a/src/de/mas/jnustool/NUSTitle.java b/src/de/mas/jnustool/NUSTitle.java index 9e804d1..6fd5deb 100644 --- a/src/de/mas/jnustool/NUSTitle.java +++ b/src/de/mas/jnustool/NUSTitle.java @@ -25,7 +25,7 @@ import de.mas.jnustool.util.NUSTitleInformation; import de.mas.jnustool.util.Settings; import de.mas.jnustool.util.Util; -public class NUSTitle { +public class NUSTitle { private TitleMetaData tmd; private TIK ticket; private FST fst; @@ -43,7 +43,7 @@ public class NUSTitle { return result; } - public NUSTitle(long titleId,int version, String key) { + public NUSTitle(long titleId,int version, String key) { setVersion(version); setTitleID(titleId); if(version != -1){ @@ -90,7 +90,14 @@ public class NUSTitle { if(tmd == null){ if(Settings.downloadWhenCachedFilesMissingOrBroken){ if(Settings.useCachedFiles) Logger.log("Getting missing tmd from Server!"); - tmd = new TitleMetaData(Downloader.getInstance().downloadTMDToByteArray(titleId,this.version)); + try{ + tmd = new TitleMetaData(Downloader.getInstance().downloadTMDToByteArray(titleId,this.version)); + }catch(IllegalArgumentException e){ + Logger.log("TMD wrong. Title not found"); + setTitleID(0); + return; + } + }else{ Logger.log("Downloading of missing files is not enabled. Exiting"); System.exit(2); @@ -180,14 +187,20 @@ public class NUSTitle { if(fst != null && fst.metaFENtry != null){ byte[] metaxml = fst.metaFENtry.downloadAsByteArray(); if(metaxml != null){ - InputStream bis = new ByteArrayInputStream(metaxml); - NUSTitleInformation nusinfo = readMeta(bis); - //String folder = nusinfo.getLongnameEN().replaceAll("[^\\x20-\\x7E]", "") + " [" + nusinfo.getID6() + "]"; - String folder = nusinfo.getLongnameEN() + " [" + nusinfo.getID6() + "]"; - String subfolder = ""; - if(tmd.isUpdate()) subfolder = "/" + "updates" + "/" + "v" + tmd.titleVersion; - setTargetPath(folder + subfolder); - setLongNameFolder(folder); + try{ + InputStream bis = new ByteArrayInputStream(metaxml); + NUSTitleInformation nusinfo = readMeta(bis); + if(nusinfo != null){ + //String folder = nusinfo.getLongnameEN().replaceAll("[^\\x20-\\x7E]", "") + " [" + nusinfo.getID6() + "]"; + String folder = nusinfo.getLongnameEN() + " [" + nusinfo.getID6() + "]"; + String subfolder = ""; + if(tmd.isUpdate()) subfolder = "/" + "updates" + "/" + "v" + tmd.titleVersion; + setTargetPath(folder + subfolder); + setLongNameFolder(folder); + } + }catch(Exception e){ + e.printStackTrace(); + } } } @@ -252,12 +265,11 @@ public class NUSTitle { String company_code = document.getElementsByTagName("company_code").item(0).getTextContent().toString(); String content_platform = document.getElementsByTagName("content_platform").item(0).getTextContent().toString(); String region = document.getElementsByTagName("region").item(0).getTextContent().toString(); - NUSTitleInformation nusinfo = new NUSTitleInformation(Util.StringToLong(title_id),longname,ID6,proc,content_platform,company_code,Integer.parseInt(region),new String[1]); + NUSTitleInformation nusinfo = new NUSTitleInformation(Util.StringToLong(title_id),longname,ID6,proc,content_platform,company_code,(int) Util.StringToLong(region),new String[1]); return nusinfo; } catch (ParserConfigurationException | SAXException | IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + Logger.log("Error while parsing the meta files"); } return null; diff --git a/src/de/mas/jnustool/Starter.java b/src/de/mas/jnustool/Starter.java index 7daa106..6da6cf9 100644 --- a/src/de/mas/jnustool/Starter.java +++ b/src/de/mas/jnustool/Starter.java @@ -62,6 +62,7 @@ public class Starter { try { title.downloadEncryptedFiles(null); } catch (IOException e) { + e.printStackTrace(); } System.exit(0); } diff --git a/src/de/mas/jnustool/TitleMetaData.java b/src/de/mas/jnustool/TitleMetaData.java index 32491fe..62cfece 100644 --- a/src/de/mas/jnustool/TitleMetaData.java +++ b/src/de/mas/jnustool/TitleMetaData.java @@ -59,7 +59,7 @@ public class TitleMetaData { setTotalContentSize(); }else{ - System.err.println("Invalid TMD"); + Logger.log("Invalid TMD"); throw new IllegalArgumentException("Invalid TMD"); } } diff --git a/src/de/mas/jnustool/gui/NUSGUI.java b/src/de/mas/jnustool/gui/NUSGUI.java index 2334f77..d0feeeb 100644 --- a/src/de/mas/jnustool/gui/NUSGUI.java +++ b/src/de/mas/jnustool/gui/NUSGUI.java @@ -31,7 +31,7 @@ public class NUSGUI extends JFrame { super(); this.setResizable(false); setSize(600, 768); - setTitle(String.format("%016X", nus.getTitleID())); + setTitle(String.format("%016X", nus.getTitleID())); getContentPane().setLayout(null); JSplitPane splitPane = new JSplitPane(); diff --git a/src/de/mas/jnustool/util/Downloader.java b/src/de/mas/jnustool/util/Downloader.java index 2183706..8a075d5 100644 --- a/src/de/mas/jnustool/util/Downloader.java +++ b/src/de/mas/jnustool/util/Downloader.java @@ -9,6 +9,7 @@ import java.net.HttpURLConnection; import java.net.URL; import de.mas.jnustool.FEntry; +import de.mas.jnustool.Logger; import de.mas.jnustool.Progress; public class Downloader { @@ -165,7 +166,7 @@ public class Downloader { } inputStream.close(); }else{ - System.err.println("File not found: " + fileURL); + Logger.log("File not found: " + fileURL); } httpConn.disconnect(); return file;