2019-04-15 11:45:15 +02:00
|
|
|
package de.mas.wiiu.jnus.jnustool.util;
|
2016-02-02 22:55:33 +01:00
|
|
|
|
2016-10-31 15:08:14 +01:00
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileReader;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
2019-04-15 11:45:15 +02:00
|
|
|
import de.mas.wiiu.jnus.jnustool.Logger;
|
2016-02-02 22:55:33 +01:00
|
|
|
|
|
|
|
public class Settings {
|
|
|
|
public static boolean downloadContent = false;
|
2016-03-02 19:48:04 +01:00
|
|
|
public static boolean useCachedFiles = true;
|
2016-02-02 22:55:33 +01:00
|
|
|
public static boolean downloadWhenCachedFilesMissingOrBroken = true;
|
|
|
|
public static boolean skipBrokenFiles = false;
|
|
|
|
public static boolean skipExistingFiles = true;
|
|
|
|
public static boolean skipExistingTMDTICKET = true;
|
2016-04-11 12:48:21 +02:00
|
|
|
public static boolean DL_ALL_VERSIONS = false;
|
|
|
|
public static String FILELIST_NAME = "filelist.txt";
|
2016-04-24 13:36:54 +02:00
|
|
|
public static boolean logToPrintLn = true;
|
2016-10-31 15:08:14 +01:00
|
|
|
public static String updateCSVPath = "updateinfos.csv";
|
|
|
|
public static boolean updateCSVFromServer = true;
|
|
|
|
public static String updateListVersionURL = "";
|
|
|
|
public static String updateListURL = "%d";
|
|
|
|
public static boolean deepHashCheck = true;
|
|
|
|
|
|
|
|
public static void readConfig() throws IOException {
|
|
|
|
BufferedReader in = new BufferedReader(new FileReader(new File("config")));
|
|
|
|
Downloader.URL_BASE = in.readLine();
|
|
|
|
String commonkey = in.readLine();
|
|
|
|
if(commonkey.length() != 32){
|
|
|
|
Logger.messageBox("CommonKey length is wrong");
|
|
|
|
Logger.log("Commonkey length is wrong");
|
|
|
|
System.exit(1);
|
|
|
|
}
|
|
|
|
Util.commonKey = Util.hexStringToByteArray(commonkey);
|
|
|
|
Settings.updateCSVPath = in.readLine();
|
|
|
|
Settings.updateListVersionURL = in.readLine();
|
|
|
|
Settings.updateListURL = in.readLine();
|
|
|
|
in.close();
|
|
|
|
}
|
2016-02-02 22:55:33 +01:00
|
|
|
}
|