|
@@ -36,6 +36,9 @@ public class FirmwareAutoDumper
|
|
|
private static final String[] hackfixsuffixes = new String[]
|
|
|
{"-rc","rc","-build","build"};
|
|
|
|
|
|
+ private static final String[] fileextensionfuckyous = new String[]
|
|
|
+ {"Pro.img"};
|
|
|
+
|
|
|
private static final Map<String,List<String>> forceVersionsForCheck = new HashMap<>();
|
|
|
|
|
|
private static final String[][] indexes = new String[][]
|
|
@@ -142,8 +145,20 @@ public class FirmwareAutoDumper
|
|
|
final HashMap<String, String> basenamelookup = new LinkedHashMap<>();
|
|
|
// filename --> real basename
|
|
|
|
|
|
- Consumer<String> linehandler = (line) ->
|
|
|
+ Consumer<String> linehandler = (line_raw) ->
|
|
|
{
|
|
|
+ String realExt = null;
|
|
|
+ String line = line_raw;
|
|
|
+ for(String suffixcheck:fileextensionfuckyous)
|
|
|
+ {
|
|
|
+ if(line_raw.endsWith(suffixcheck))
|
|
|
+ {
|
|
|
+ realExt = suffixcheck;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
String[] linesplitted = line.split(":");
|
|
|
|
|
|
String FWFileName;
|
|
@@ -177,7 +192,12 @@ public class FirmwareAutoDumper
|
|
|
|
|
|
try {
|
|
|
l.info("Processing line:" + line + "\n Basename:" + FWBAsename + "of index "+index[0]);
|
|
|
- int[] fwnumber = splitVersionAndPullFW(FWFileName, f.getVersions(), deepmode,index[0], "Sus Version with File line: "+line);
|
|
|
+ int[] fwnumber = splitVersionAndPullFW(
|
|
|
+ FWFileName,
|
|
|
+ f.getVersions(),
|
|
|
+ deepmode,
|
|
|
+ index[0], "Sus Version with File line: "+line,
|
|
|
+ realExt);
|
|
|
f.setMajor(fwnumber[0]);
|
|
|
f.setMinor(fwnumber[1]);
|
|
|
f.setPatch(fwnumber[2]);
|
|
@@ -217,6 +237,10 @@ public class FirmwareAutoDumper
|
|
|
|
|
|
private static void generateIACSV(File destination, File outbase)
|
|
|
{
|
|
|
+ if(EntryPoint.c.getArchiveOrgCollection()==null)
|
|
|
+ {
|
|
|
+ return; //kein archive.org file da nicht configuriert
|
|
|
+ }
|
|
|
HashSet<String> csvlines = new HashSet<>();
|
|
|
state.getFirmwares().forEach((k,v)->
|
|
|
{
|
|
@@ -239,7 +263,7 @@ public class FirmwareAutoDumper
|
|
|
{
|
|
|
v2.setIAUploaded(true);
|
|
|
String filename = new File(outbase,v2.getFilename()).getAbsoluteFile().toString();
|
|
|
- csvlines.add(itemname+","+filename+",firmware,open_source_software,software");
|
|
|
+ csvlines.add(itemname+","+filename+",firmware,"+EntryPoint.c.getArchiveOrgCollection()+",software");
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -394,7 +418,13 @@ public class FirmwareAutoDumper
|
|
|
|
|
|
|
|
|
|
|
|
- private static int[] splitVersionAndPullFW(String filename,HashMap<String,FirmwareVersion> knownVersions, boolean deepmode,String indexUsed, String useForSusVersion) throws IOException {
|
|
|
+ private static int[] splitVersionAndPullFW(
|
|
|
+ String filename,
|
|
|
+ HashMap<String,
|
|
|
+ FirmwareVersion> knownVersions,
|
|
|
+ boolean deepmode,String indexUsed,
|
|
|
+ String useForSusVersion,
|
|
|
+ String realext) throws IOException {
|
|
|
String[] magic = filename.split("-v");
|
|
|
boolean fuckingoddity = false;
|
|
|
boolean hackfix50R_SR = false;
|
|
@@ -425,6 +455,15 @@ public class FirmwareAutoDumper
|
|
|
|
|
|
String[] vsplit = version.split("\\.");
|
|
|
|
|
|
+ if(realext != null) //Hackfix again since Sena got no consistency in the file naming scheme... ,,|,,
|
|
|
+ {
|
|
|
+ int suffixlen = realext.split("\\.").length;
|
|
|
+ ArrayList tmp = new ArrayList<String>(vsplit.length);
|
|
|
+ tmp.addAll(Arrays.asList(vsplit));
|
|
|
+ vsplit = (String[])(tmp.subList(0,vsplit.length-(suffixlen-1)).toArray(new String[1]));
|
|
|
+ vsplit[vsplit.length-1]=realext;
|
|
|
+ }
|
|
|
+
|
|
|
String suffix = "";
|
|
|
int major=0,minor=0,patch=0;
|
|
|
major=Integer.valueOf(vsplit[0]);
|
|
@@ -441,15 +480,24 @@ public class FirmwareAutoDumper
|
|
|
{
|
|
|
|
|
|
minor = Integer.valueOf(vsplit[1]);
|
|
|
- patch = Integer.valueOf(vsplit[2].substring(0,1));
|
|
|
- if(vsplit[2].length()>1)
|
|
|
+ try
|
|
|
{
|
|
|
- suffix = vsplit[2].substring(1)+"."+vsplit[3];
|
|
|
+ patch = Integer.valueOf(vsplit[2]);
|
|
|
+ suffix = "."+vsplit[3];
|
|
|
}
|
|
|
- else
|
|
|
+ catch(NumberFormatException ex)
|
|
|
{
|
|
|
- suffix = "."+vsplit[3];
|
|
|
+ patch = Integer.valueOf(vsplit[2].substring(0,1));
|
|
|
+ if(vsplit[2].length()>1)
|
|
|
+ {
|
|
|
+ suffix = vsplit[2].substring(1)+"."+vsplit[3];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ suffix = "."+vsplit[3];
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|