2016-02-01 20:54:01 +01:00
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileReader;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public class Starter {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
2016-02-02 01:36:50 +01:00
|
|
|
System.out.println("JNUSTool 0.0.2 - pre alpha - by Maschell");
|
2016-02-01 23:57:01 +01:00
|
|
|
System.out.println();
|
2016-02-01 20:54:01 +01:00
|
|
|
try {
|
|
|
|
readConfig();
|
|
|
|
} catch (IOException e) {
|
|
|
|
System.err.println("Error while reading config! Needs to be:");
|
|
|
|
System.err.println("DOWNLOAD URL BASE");
|
|
|
|
System.err.println("COMMONKEY");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(args.length != 0){
|
|
|
|
long titleID = Util.StringToLong(args[0]);
|
|
|
|
String key = null;
|
|
|
|
if( args.length > 1 && args[1].length() == 32){
|
|
|
|
key = args[1].substring(0, 32);
|
|
|
|
}
|
2016-02-01 23:57:01 +01:00
|
|
|
NUSGUI m = new NUSGUI(new NUSTitle(titleID, key));
|
|
|
|
m.setVisible(true);
|
2016-02-01 20:54:01 +01:00
|
|
|
}else{
|
|
|
|
System.out.println("Need parameters: TITLEID [KEY]");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-01 23:57:01 +01:00
|
|
|
public static void readConfig() throws IOException {
|
2016-02-01 20:54:01 +01:00
|
|
|
BufferedReader in = new BufferedReader(new FileReader(new File("config")));
|
|
|
|
Downloader.URL_BASE = in.readLine();
|
|
|
|
Util.commonKey = Util.hexStringToByteArray(in.readLine());
|
|
|
|
in.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|