Other small fixes

This commit is contained in:
Maschell 2016-03-02 21:13:13 +01:00
parent 146de37d27
commit bc5c84498e
3 changed files with 23 additions and 18 deletions

Binary file not shown.

View File

@ -169,16 +169,16 @@ public class NUSTitle {
setLongNameFolder(String.format("%016X", getTitleID())); setLongNameFolder(String.format("%016X", getTitleID()));
if(tmd.isUpdate()){
byte[] metaxml = fst.metaFENtry.downloadAsByteArray(); byte[] metaxml = fst.metaFENtry.downloadAsByteArray();
if(metaxml != null){ if(metaxml != null){
InputStream bis = new ByteArrayInputStream(metaxml); InputStream bis = new ByteArrayInputStream(metaxml);
NUSTitleInformation nusinfo = readMeta(bis); NUSTitleInformation nusinfo = readMeta(bis);
String folder = nusinfo.getLongnameEN() + " [" + nusinfo.getID6() + "]"; String folder = nusinfo.getLongnameEN() + " [" + nusinfo.getID6() + "]";
String subfolder = "/" + "updates" + "/" + "v" + tmd.titleVersion; String subfolder = "";
setTargetPath(folder + subfolder); if(tmd.isUpdate()) subfolder = "/" + "updates" + "/" + "v" + tmd.titleVersion;
setLongNameFolder(folder); setTargetPath(folder + subfolder);
} setLongNameFolder(folder);
} }
if(Settings.downloadContent){ if(Settings.downloadContent){
@ -201,15 +201,20 @@ public class NUSTitle {
Util.createSubfolder(getContentPath()); Util.createSubfolder(getContentPath());
Downloader.getInstance().downloadTMD(titleID,version,getContentPath()); Downloader.getInstance().downloadTMD(titleID,version,getContentPath());
Downloader.getInstance().downloadTicket(titleID,getContentPath());
tmd.downloadContents(progress); tmd.downloadContents(progress);
try{
Downloader.getInstance().downloadTicket(titleID,getContentPath());
FileOutputStream fos = new FileOutputStream(getContentPath() + "/title.cert");
fos.write(ticket.cert0);
fos.write(tmd.cert);
fos.write(ticket.cert1);
fos.close();
}catch(Exception e){
Logger.log("Random error.");
}
FileOutputStream fos = new FileOutputStream(getContentPath() +"/title.cert");
fos.write(ticket.cert0);
fos.write(tmd.cert);
fos.write(ticket.cert1);
fos.close();
} }
NUSTitleInformation readMeta(InputStream bis) { NUSTitleInformation readMeta(InputStream bis) {

View File

@ -164,7 +164,7 @@ public class TitleMetaData {
} }
public boolean isUpdate() { public boolean isUpdate() {
return (titleID & 0x5000000000000L) == 0x5000000000000L; return (titleID & 0x5000E00000000L) == 0x5000E00000000L;
} }
public void downloadContents(Progress progress) throws IOException{ public void downloadContents(Progress progress) throws IOException{