Read version directly from POM
This commit is contained in:
parent
57b9f0e2b3
commit
27d1dea9dd
6 changed files with 18 additions and 21 deletions
25
pom.xml
25
pom.xml
|
@ -237,19 +237,6 @@
|
|||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.1</version> <!-- 3.1.2 breaks build on JDK 9+ -->
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>the.bytecode.club.bytecodeviewer.BytecodeViewer</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
|
@ -287,9 +274,21 @@
|
|||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>META-INF/*LICENSE*</exclude>
|
||||
<exclude>META-INF/*NOTICE*</exclude>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>the.bytecode.club.bytecodeviewer.BytecodeViewer</mainClass>
|
||||
<manifestEntries>
|
||||
<Implementation-Version>${version}</Implementation-Version>
|
||||
</manifestEntries>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.io.PrintStream;
|
|||
public class Constants
|
||||
{
|
||||
/*per version*/
|
||||
public static final String VERSION = "2.10.14"; //could be loaded from the pom
|
||||
public static final String VERSION = BytecodeViewer.class.getPackage().getImplementationVersion();
|
||||
public static String krakatauVersion = "12";
|
||||
public static String enjarifyVersion = "4";
|
||||
public static final boolean BLOCK_TAB_MENU = true;
|
||||
|
|
|
@ -51,8 +51,6 @@ public class KrakatauAssembler extends InternalCompiler
|
|||
if(!ExternalResources.getSingleton().hasSetPython2Command())
|
||||
return null;
|
||||
|
||||
String origName = MiscUtils.randomString(20);
|
||||
|
||||
File tempD = new File(Constants.tempDirectory + fs + MiscUtils.randomString(32) + fs);
|
||||
tempD.mkdir();
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import java.io.PrintWriter;
|
|||
import java.io.StringWriter;
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
|
|
@ -117,16 +117,16 @@ public abstract class MalwareCodeScanner implements CodeScanner
|
|||
|
||||
public void foundLDC(MalwareScan scan, String ldc, String foundAt)
|
||||
{
|
||||
scan.sb.append(header() + " Found LDC \"").append(ldc).append("\" ").append(foundAt);
|
||||
scan.sb.append(header()).append(" Found LDC \"").append(ldc).append("\" ").append(foundAt);
|
||||
}
|
||||
|
||||
public void foundMethod(MalwareScan scan, String foundAt)
|
||||
{
|
||||
scan.sb.append(header() + " Found Method call to ").append(foundAt);
|
||||
scan.sb.append(header()).append(" Found Method call to ").append(foundAt);
|
||||
}
|
||||
|
||||
public void found(MalwareScan scan, String found)
|
||||
{
|
||||
scan.sb.append(header() + " Found ").append(found);
|
||||
scan.sb.append(header()).append(" Found ").append(found);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package the.bytecode.club.bytecodeviewer.util;
|
||||
|
||||
import java.util.Objects;
|
||||
import me.konloch.kontainer.io.HTTPRequest;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.Configuration;
|
||||
|
@ -58,7 +59,7 @@ public class VersionChecker implements Runnable
|
|||
|
||||
}
|
||||
|
||||
if (!VERSION.equals(version))
|
||||
if (VERSION != null && !VERSION.equals(version))
|
||||
{
|
||||
MultipleChoiceDialogue outdatedDialogue = new MultipleChoiceDialogue("Bytecode Viewer - Outdated Version",
|
||||
"Your version: " + VERSION + ", latest version: "
|
||||
|
|
Loading…
Reference in a new issue